New here? Start this series at Day 31: Give an agent an outcome, a boundary and a stop condition first
- Day 31: Give an agent an outcome, a boundary and a stop condition first
- Day 32: Agent behavior is a loop, not a prompt
- Day 33: Plan before acting when actions cost money or carry risk
- Day 34: Tool access is where AI becomes operational risk
- Day 35: Agent memory is several stores, each with its own rules
- Day 36: Reflection is worth it only when it changes the next action
"Just add memory to the agent" is like "just add furniture to the house." Which room, and for what?
The question sounds pedantic until you notice that the four kinds of agent memory are really four different data-lifecycle problems wearing one word.
Four memory types, four different retention problems
| Memory type | Stores | Lives for | Risk if unmanaged |
|---|---|---|---|
| Working | Current task state | Minutes | Context lost mid-task |
| Episodic | What happened in past runs | Days to months | Stale assumptions; a privacy surface |
| Semantic | Durable facts about user and domain | Indefinite, with corrections | Old facts treated as current truth |
| Procedural | Learned how-to, skills, workflows | Until the process changes | Automating a habit that is now wrong |
The question that separates asset from liability
Teams answer "what should the agent remember" easily, usually with "everything."
The harder questions are the ones nobody schedules time for:
- Retention: how long does each class live, and what actually expires it? Episodic memory in particular grows without limit unless something removes it.
- Correction: when a stored fact turns out to be wrong, what updates it, and does the correction win at retrieval time, or does it simply sit alongside the original with equal weight? This is where a lot of "the agent keeps insisting" behaviour comes from. Version each fact and filter superseded versions out before ranking; similarity search has no notion of which version is current.
- Access: who and what can read each class. Episodic memory is the sharp one here. It records what users did, which makes it a privacy surface that arrived without a privacy review.
Remembering everything is not a feature
An agent whose memory only grows gets confidently out of date, and it does so gradually enough that nobody notices the transition.
Procedural memory is the most treacherous of the four for exactly this reason. It encodes how we do things here, and when the underlying process changes, the agent keeps executing the old one competently. The failure looks like correct behaviour, because it was correct, last quarter.
Where to start
Before reaching for a memory framework, answer the boring version in one table: what does this agent remember, for how long, who can read it, and what removes it.
If the memory plan came before the use cases, filling that in tends to show that the agent needs far less memory than assumed, and that two of the four planned categories have no use case behind them. Do not build a store whose row you cannot complete.
Then add a row for what must never be stored, such as credentials or anything a user pasted by mistake, and enforce it with a filter on the write path rather than an instruction to the agent. The separation lives in the rules more than the infrastructure. The classes can share one database as separate collections, but each needs its own retention job, access policy and deletion path, and every one of those is something you now operate.
Terms in this piece
About this explainer
- Format
- Explainer
- Level
- Practitioner
- Read
- 2 min read
- Published
- Jun 27, 2026
- Disciplines
Short mental models: one idea, why it matters, what to do about it.
More on these topics
Comparison · · 8 min read
Direct APIs, MCP tools and Code Mode: three ways an agent reaches your systems
How I choose between hand-written tools, MCP tool calls and Code Mode by where the plan runs, and why I built codemcp to test it.
Decision note · · 2 min read
We built our own TypeScript orchestrator, and stayed on it
Why our enterprise AI platform runs agents on a TypeScript execution layer we started almost two years ago, and why reaching near-parity with the frameworks argued for staying.
Comparison · · 1 min read
LangGraph vs writing the agent loop yourself
Two ways to write the same supervisor, an explicit state graph or a loop your own code owns on the model API. Compared on control flow, tracing, testing, checkpointing and what each makes hard.
Discussion