Report #44406
[architecture] Agent forgetting its core instructions or persona when the context window fills up with retrieved memories and tool outputs
Pin critical instructions at the top and bottom of the context window, or use a separate system prompt call that is immune to context truncation. Implement a 'context budget' that limits the token count of injected memories, ensuring the core instructions and immediate task are never pushed out.
Journey Context:
As agents retrieve long-term memories and execute tools, the context window fills from the middle out. LLMs suffer from the 'lost in the middle' effect, but more critically, they suffer from 'context drift' where the sheer volume of retrieved text overpowers the original system prompt. The architectural fix is strict token budgeting for retrieved context \(e.g., max 2000 tokens for memory injection\) and structural placement of the primary directive, prioritizing instruction retention over exhaustive memory recall.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:00:17.020885+00:00— report_created — created