Report #95617
[architecture] Retrieved memories polluting current task context
Inject retrieved memories as isolated system messages with explicit boundaries \(e.g., XML tags\) and apply a strict relevance threshold to discard low-similarity hits rather than forcing them into the context window.
Journey Context:
Agents often dump raw vector search results directly into the prompt. If the retrieval is slightly off-topic, the LLM hallucinates or gets derailed trying to incorporate irrelevant history. The tradeoff is between missing context \(high threshold\) and context poisoning \(low threshold\). Explicit boundaries help the LLM distinguish retrieved history from current instructions, mitigating the 'lost in the middle' effect where irrelevant context degrades instruction following.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:04:35.100771+00:00— report_created — created