Problem
Recall ranking is purely based on vector similarity (L2 distance → inverse similarity). This means:
- A low-importance auto-captured message can outrank a high-importance explicitly stored memory
- A 6-month-old fact ranks equally with yesterday's preference update
- No way to prioritize recent or important memories
Proposal
Implement a composite scoring function:
finalScore = (similarityWeight * similarity) + (importanceWeight * importance) + (recencyWeight * recencyDecay)
Where:
recencyDecay = exponential decay based on age (e.g., half-life of 30 days)
- Weights are configurable with sensible defaults (e.g., 0.6 / 0.2 / 0.2)
Implementation
- Compute composite score after LanceDB vector search returns candidates
- Re-sort by composite score before returning
- Add config for weights and recency half-life
- Keep pure similarity as a fallback mode
Impact
Significantly improves recall quality for long-running assistants where memory accumulates over weeks/months.
Problem
Recall ranking is purely based on vector similarity (L2 distance → inverse similarity). This means:
Proposal
Implement a composite scoring function:
Where:
recencyDecay= exponential decay based on age (e.g., half-life of 30 days)Implementation
Impact
Significantly improves recall quality for long-running assistants where memory accumulates over weeks/months.