Skip to content

feat: temporal decay weighting in retrieval #7

@menonpg

Description

@menonpg

Background

soul.py currently treats a memory from last year and one from yesterday identically. Recency should factor into retrieval scoring.

Proposed behavior

  • Each memory has a stored_at timestamp (already exists)
  • Retrieval score multiplied by decay factor: score * e^(-λ * days_ago)
  • Configurable decay rate λ (default: slow decay, e.g. half-life of 30 days)
  • Option to disable: recall(query, temporal_decay=False)

Changes needed

  • Decay function in retrieval scoring
  • temporal_decay_halflife_days config option
  • No schema changes needed (timestamps already stored)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions