Report #1780
[architecture] Agent stuffs all retrieved memory into the LLM context window, hitting token limits and degrading instruction following
Implement a two-tier memory architecture: working memory \(context window\) for the current reasoning step, and long-term memory \(vector DB\) for historical facts. Only inject distilled summaries or highly relevant facts into working memory.
Journey Context:
LLMs suffer from 'lost in the middle' degradation and instruction-following failures when context is bloated. Developers often treat RAG as 'dump the top-K chunks into the prompt.' Instead, the agent must synthesize or filter retrieved long-term memory before writing it to working memory, treating the context window as a scarce, high-performance scratchpad rather than a dumping ground.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T07:32:53.798537+00:00— report_created — created