Report #83646
[agent\_craft] Agent loses critical constraints from 20\+ turns ago due to naive sliding window context truncation
Implement a two-tier memory: maintain a 'working memory' of the last 5 turns in-context, and a 'episodic memory' of key-value constraints \(ports, file paths, architectural decisions\) stored in a vector DB; dynamically inject retrieved memories when the user query embedding matches stored decision keywords.
Journey Context:
Simple truncation loses 'use port 8080' agreed upon 30 turns ago, causing the agent to revert to 3000. Static summaries are too coarse. The fix mimics human cognition: working memory \(fast, limited\) and long-term memory \(slow, associative\). When the agent encounters 'start the server', it retrieves vectors for 'server', 'port', '8080' from the episodic store and prepends them to the current context. Tradeoff: requires embedding infrastructure and careful deduplication to avoid context bloat, but essential for tasks >50 turns.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:58:51.083323+00:00— report_created — created