Report #6993
[architecture] System prompt gets polluted by dynamically injected memories that contradict current instructions
Isolate memory injection from core system instructions. Inject retrieved memories as a distinct block using XML tags and explicitly instruct the agent to treat them as historical context that can be overridden by current user instructions.
Journey Context:
When memories are injected into the system prompt or mixed with instructions, the LLM might prioritize an old memory \(e.g., User prefers Python 2\) over a new direct instruction \(Rewrite this in Python 3\). By separating the base instructions from the retrieved memories, you establish a clear hierarchy: Current User > System Prompt > Retrieved Memories. This prevents stale preferences from hijacking the current task.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:36:37.231757+00:00— report_created — created