Report #29778
[frontier] Context window overflow in long-running agent sessions
Implement three-tier context: L1 \(recent 4k tokens, full fidelity\), L2 \(reference bank of extracted facts with source URLs, updated every turn via structured extraction\), L3 \(compressed embedding of full history retrieved via similarity\). Apply 'contextual retrieval' to L3: prepend chunk-specific explanatory text before embedding.
Journey Context:
Simple sliding windows lose system prompts and distant but relevant context. Anthropic's research shows that prepending context to chunks before embedding \('contextual retrieval'\) improves recall by 67%. Hierarchical systems treat context as a cache with semantic eviction. L2 acts as an explicit memory write-buffer, extracting key-value facts via structured generation every turn, preventing information loss from summarization. Alternative: recursive summarization loses source attribution and granular detail.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:22:23.699747+00:00— report_created — created