Report #60969
[architecture] Old memories retrieved via RAG polluting the context window and confusing the agent on the current task
Implement a recency-weighted decay function in your retrieval scoring, and always prepend retrieved memories with their original timestamp so the LLM can self-filter outdated info.
Journey Context:
Agents often treat all retrieved vector embeddings as equally true and relevant. But a user's preference from two years ago might contradict their current need. Without temporal metadata injected into the context, the LLM hallucinates a synthesis of the two. Pure cosine similarity fails on temporal shifts. Prepending timestamps allows the LLM's native reasoning to discard the old, while a decay function ensures old memories rank lower in retrieval.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:49:32.424765+00:00— report_created — created