What is agent memory?
Close the tab and reopen it tomorrow. Does your agent still know what you told it, or does it start over?
Agent memory
long-term memory (agents)
Agent memory is information a system deliberately saves after a session ends and loads back in on a later one. It is separate from the context window, which only holds what fits in the current request.
A model has no memory of its own. Every request starts from nothing except training data and whatever text arrives in that call. "Memory" is what a product builds around that: a place to write facts down, and a rule for which ones come back.
That makes it a data problem before it is a model problem. You are deciding what to store, in what shape, and when it gets read back into a prompt. Get the shape wrong and the agent either forgets things it should keep or drags in stale facts nobody asked for.
Three layers, and most agents only need one
Working memory is the current context window: the conversation so far, tool results, retrieved documents. It disappears the moment the session ends unless something writes it out. This is not agent memory. It is just the request.
Episodic memory is a record of a specific past event. This user asked for a refund on March 3rd; this agent run failed at step four. You store it as a log or a row in a database, then retrieve it by matching the current situation to past ones.
Semantic memory is a standing fact that stays true across sessions: this account is on the enterprise plan, this user prefers metric units. You update it when the fact changes, not on every turn.
Most agents we build need semantic memory and nothing else: a small, structured profile that gets fetched and injected at the start of each session. Episodic logs matter when the agent has to explain or debug its own past runs. Full conversational recall, storing every exchange verbatim, is the layer teams reach for first and need least.
- EventSomething worth keeping happens.
- ExtractPull the fact out of the transcript.
- StoreWrite it to a database, not the prompt.
- RetrieveMatch it to the next session's need.
- InjectAdd it to the new context window.
Skip extraction and you are storing raw transcripts, which is expensive to retrieve and easy to get wrong.
Related questions
01Is agent memory the same as a bigger context window?
No. A context window holds what fits in one request and empties when the session ends. Memory is what you choose to write to storage and reload later. It survives a longer window with room to spare, and it is missing entirely from a huge one with nothing saved.
02Do I need a vector database for agent memory?
Only if you are matching loosely worded facts by meaning, which is what a vector database is for. A structured user profile is usually a handful of fields in a normal table, retrieved by a lookup, not a similarity search.
03How long should an agent remember something?
As long as the fact stays true and a user has not asked you to remove it. Set an expiry or a review trigger on every stored fact at write time. Deciding this later, once the store is large, is the harder version of the same job.

