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)
Background
soul.py currently treats a memory from last year and one from yesterday identically. Recency should factor into retrieval scoring.
Proposed behavior
stored_attimestamp (already exists)score * e^(-λ * days_ago)recall(query, temporal_decay=False)Changes needed
temporal_decay_halflife_daysconfig option