Report #8970
[architecture] Agent context window fills up with stale conversation history causing hallucination and instruction drift
Implement a rolling context window with a summarization step. Instead of keeping raw text, summarize older turns into a compressed episodic memory block, keeping only the last N turns intact.
Journey Context:
Agents often just append messages until hitting the token limit, then naively truncate the top. Truncation loses the initial system prompt or early critical instructions. Summarization preserves semantic intent while freeing up tokens. The tradeoff is loss of exact detail \(e.g., specific names/numbers\), which is why extracted semantic memory \(facts\) must accompany episodic summarization so critical data is not permanently lost.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:04:33.776449+00:00— report_created — created