Report #1623
[architecture] Old retrieved memories polluting new agent instructions
Bound retrieved memories with XML tags and place the current task or user query at the bottom of the prompt, after the retrieved context.
Journey Context:
LLMs suffer from distraction and will follow imperative language found in retrieved context if it looks like the main prompt. By explicitly labeling the memory as reference material and placing the actual system instruction or user query at the very end, you leverage the model's recency bias to prioritize the immediate task over historical artifacts. Without this, an old memory containing instructions \(e.g., 'always use Python 3.8'\) will override the current system prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T05:30:35.726623+00:00— report_created — created