Drafted with AI help, human-reviewed by The Agent Loop.
Your agent's context window is RAM, not a disk. Close the session and the working set is gone. That is not a bug in your prompt — it is the architecture.
Why it forgets
- Every turn must refit history + tools + state in one window; old turns get truncated or buried (memory decay writeup)
- One 2026 summary: constraint compliance fell 73% → 33% between turn 5 and turn 16 without memory help (4,416 trials, same writeup)
- Stale tool output stays in context after the file changed — contamination, not "hallucination"
Minimum fix
- External notes (file, SQLite, vector store) + read/write tools
- Load 3–10 relevant notes at session start; append decisions, pitfalls, conventions
- Edit and delete paths — memory without correction stores the lie forever (why wrong sticky memory is worse)
- Keep raw history if you migrate models: compressed notes swung +9.9 / −13.3 pp on upgrade in one study (arXiv)
session 1 ──write──► notes.md ──read──► session 2
▲ edit/delete (human)
Where it fails
- Pure RAG: stores everything, forgets nothing useful, never reflects (4 architectures)
- You never inspect what was written
Bottom line: Give the agent a dumb file it can read, write, and correct. A perfect model with amnesia still ships the wrong config twice.
FAQ
Is RAG agent memory?
RAG is retrieval. Real memory also summarizes, forgets stale facts, and lets you fix errors.
What should I store first?
Decisions, pitfalls, file map, conventions — not full chat logs.
Do I need a vector DB?
Start with one markdown file. Add vectors when search fails.
Does a bigger window fix this?
It delays fill and cost; it does not replace correction paths or cross-session state.
Top comments (0)