When teams first build an agent, "memory" usually means one thing: a vector store of past messages. That's fine for a demo. It falls apart the moment the agent has to do anything serious over a long stretch of time. Memory isn't one thing. It's at least three.

The three layers we actually ship

Borrowing terms from cognitive science doesn't always pay off, but here it maps directly onto the failure modes we keep running into in production. Real agents need separate stores for what's happening now, what happened recently, and what's generally true.

Working
The current turn The user's last message, the tool results from this loop, the active plan. Lives in the context window. Cheap to read, expensive to grow.
Episodic
What happened, when Timestamped events: past conversations, tool calls the agent made, decisions it took along the way. Lets the agent reason about its own history without reloading everything from scratch.
Semantic
What's generally true Facts that don't expire: user preferences, account rules, product taxonomies, FAQ snippets. Indexed by meaning, not by recency.

Why a single vector store breaks

The temptation is to dump everything into one collection and let cosine similarity sort it out. Three failure modes show up almost immediately:

Memory is a routing problem, not a storage problem. The hard part is deciding what kind of memory a question needs, not where to put the bytes.

How we route in practice

Before any retrieval, a small classifier inspects the agent's intent and picks a strategy:

The summariser between layers

Episodic memory grows fast. We compress it nightly: a model reads a day's worth of events and writes a short summary keyed by themes, things like "user fought with the refund flow twice" or "agent escalated three tickets to a human." Summaries get stored alongside the raw events with a higher retrieval weight, so the agent reaches for the digest before the firehose.

What we'd tell a team starting today

Done well, memory becomes the part of the system users notice most, not because it's flashy but because the agent stops feeling like it just met them.

Related reading