Report #39815
[architecture] Agent runs out of context window or hallucinates by stuffing entire conversation history into the prompt
Implement a two-tier memory architecture: working memory \(context window\) for the immediate task stack, and long-term memory \(vector store\) for semantic retrieval. Only inject retrieved long-term memories into working memory when semantically relevant to the current step.
Journey Context:
Developers often treat the LLM context window as the sole memory store, hitting token limits and degrading attention. Conversely, relying solely on a vector store without a structured working memory leads to disconnected, single-shot responses lacking conversational continuity. The tradeoff is latency vs. precision: working memory is fast and precise but small; long-term memory is vast but lossy and requires retrieval latency. Virtual context management \(splitting main/in-context memory from archival\) solves this.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:18:14.537127+00:00— report_created — created