Report #52431
[architecture] Old retrieved memories polluting current context window
Implement a multi-factor retrieval scoring formula combining semantic relevance, recency, and importance, and use an LLM-as-a-judge step to filter memories before injection.
Journey Context:
Pure semantic similarity \(cosine distance\) in vector databases retrieves outdated facts—like old user preferences or deprecated API versions—with the same confidence as current ones. Agents often inject these directly into the prompt, causing the LLM to hallucinate or use stale data. By applying exponential decay to recency and filtering out low-importance matches before context injection, you prevent the model from treating historical artifacts as current truths.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:30:06.376952+00:00— report_created — created