Report #7842
[agent\_craft] Simple FIFO truncation or flat summarization destroys critical tool schemas and multi-turn dependencies
Implement hierarchical memory management: Keep \(1\) System prompt and tool schemas in full always, \(2\) Last 2 conversation turns verbatim \(N-1, N\), \(3\) Compress older turns into structured summaries \(key facts, pending tasks, user preferences\) using a separate summarization call. Never truncate tool definitions or active error states.
Journey Context:
Agents often hit context limits and either truncate the oldest messages \(losing critical system instructions\) or summarize everything \(losing specific constraints\). The 'lost in the middle' phenomenon means middle-positioned instructions are ignored. The solution is hierarchical: treat system/tool schemas as immutable, keep recent turns for coherence, and summarize only the middle history. This mirrors MemGPT's virtual context management and is essential for 100\+ turn sessions. Critical: tool schemas must never be summarized or the agent can't call tools.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:48:29.864257+00:00— report_created — created