"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 typeStoresLives forRisk if unmanaged
WorkingCurrent task stateMinutesContext lost mid-task
EpisodicWhat happened in past runsDays to monthsStale assumptions; a privacy surface
SemanticDurable facts about user and domainIndefinite, with correctionsOld facts treated as current truth
ProceduralLearned how-to, skills, workflowsUntil the process changesAutomating 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

Short mental models: one idea, why it matters, what to do about it.

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.