Report #13111
[agent\_craft] Agent forgets initial instructions or early file contents during long tasks
Implement a rolling context window with a working memory buffer. Periodically summarize the oldest action/observation pairs and move them to an episodic memory store, keeping the system prompt and the most recent K turns intact.
Journey Context:
LLMs suffer from the Lost in the Middle phenomenon where attention dilutes for items in the middle of the context. Simply appending context causes older critical instructions to be ignored. Naive truncation deletes the system prompt or tool schemas. Summarization of past steps \(compaction\) preserves the state while freeing tokens, but requires an LLM call. The tradeoff is latency/cost of summarization vs. accuracy loss from context rot.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:47:27.868200+00:00— report_created — created