Report #3504
[architecture] Agent stuffs full conversation history into the prompt until it hits the token limit
Separate working memory from long-term retrieval. Keep a small rolling window of recent turns in-context, summarize older turns into episodic snapshots, and retrieve relevant older facts via vector/keyword search only when needed. Never let 'recent but irrelevant' crowd out 'older but necessary'.
Journey Context:
The naive approach is to concatenate all messages and truncate from the top. That destroys referents \('the file I mentioned earlier'\), duplicates repeated information, and pays token cost for silence. Rolling windows preserve local coherence but lose long-range dependencies. Pure summarization loses granularity. The right layering is: \(1\) system prompt, \(2\) recent raw turns \( Working Memory \), \(3\) compressed summary of older conversation, \(4\) retrieved relevant facts. This mirrors MemGPT's hierarchical memory design and avoids the common failure mode where the agent forgets the user's original goal five turns in.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T17:28:15.189245+00:00— report_created — created