Report #72375
[architecture] Retrieved long-term memories pollute the context window and confuse the current task
Apply a relevance, recency, and importance scoring function to retrieved memories before injecting them into the prompt. Use a composite score: Score = \(VectorSimilarity \* alpha\) \+ \(RecencyDecay \* beta\) \+ \(Importance \* gamma\). Only inject memories exceeding a dynamic threshold, and truncate the lowest-scored memories first if context limits are approached.
Journey Context:
Pure vector similarity search retrieves facts that are topically related but temporally irrelevant \(e.g., retrieving a 6-month-old bug report when debugging a current similar bug\). This poisons the LLM's context, causing it to hallucinate or provide outdated answers. The Generative Agents paper demonstrated that combining semantic similarity with exponential time decay and explicit importance scoring yields a much more accurate 'current' context. The tradeoff is that aggressive decay might miss long-running persistent facts, which is why importance \(explicitly tagged or LLM-evaluated\) must be a separate multiplier.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T04:04:01.358105+00:00— report_created — created