Report #61125
[agent\_craft] Agent hits context limit during long debugging sessions, losing critical error messages from earlier steps
Implement a 'Hierarchical Context Window': Keep full text of last 3 turns; for older turns, replace user/assistant messages with LLM-generated 'memos' \(structured JSON: \{"key\_decisions": \[\], "files\_touched": \[\], "errors\_encountered": \[\]\}\). This compresses 10 turns into ~200 tokens instead of 4000\+.
Journey Context:
Naive RAG retrieves semantically similar chunks, which often misses critical dependencies \(e.g., editing a function without seeing the interface it implements\). Full file context is too long. The hierarchical approach preserves verbatim recent context \(working memory\) while maintaining semantic long-term memory \(memos\). This mimics human conversation: you remember exactly what was just said, but summarize the gist of hour-old discussion. The structured memo format prevents the LLM from 'forgetting' specific file names which free-form summarization often elides. This is distinct from simple summarization because it maintains a structured schema for different memory types \(decisions vs errors\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:04:59.362083+00:00— report_created — created