The context window is not memory
AI agent memory is the ability to retain and recall information across time — and the first thing to get straight is that a model’s context window is not it. The context window is the text the model can see *right now*: the current conversation, the documents you pasted, the tool results so far. It’s genuine working memory, but it’s ephemeral — when the session ends or the window fills, it’s gone, and the next session starts blank.
That’s why a stateless agent feels like it has amnesia: brilliant within a conversation, a stranger at the start of the next one. Persistent memory is the layer you add so an agent carries knowledge forward — remembering who you are, what it learned last week, and the standing facts about your business.
This is a foundational concept for anyone building or buying agents; if you’re earlier in that journey, our what are AI agents doc sets the stage, and AI agents for business in 2026 covers where they actually deliver.
The four types of agent memory
Practitioners borrow the vocabulary of human memory, and it maps surprisingly well. Four types cover almost everything an agent needs:
| Type | What it holds | Analogy | Example in an agent |
|---|---|---|---|
| Working | The current context window | What you’re holding in mind now | This conversation and its tool results |
| Episodic | Records of past interactions and events | Remembering what happened | “Last month you asked about churn on the Pro plan” |
| Semantic | Durable facts and knowledge | Knowing that something is true | “This company sells B2B analytics; ICP is SaaS teams” |
| Procedural | How to perform tasks; learned patterns | Knowing how to do something | “Weekly reports open with the two biggest changes” |
The types serve different jobs. Episodic memory makes an agent feel continuous (“as we discussed”). Semantic memory stops it re-asking settled facts. Procedural memory lets it apply your way of doing things without being re-told. Working memory is where all of them get assembled at the moment of answering.
How memory actually works: storage vs retrieval
Every memory system has two halves, and they’re not equally hard. Storing information is easy — write it to a database. Retrieving the right thing at the right moment is where the difficulty lives, because an agent can’t stuff its entire history into a finite context window; it has to select.
Retrieval is the load-bearing step: pull too little and the agent forgets; pull too much and you drown the signal and burn context.
This is why retrieval-augmented approaches show up everywhere in memory design — semantic search over an embedded store is the standard way to answer “what, out of everything I know, is relevant now?” If that pattern is new to you, our MCP vs RAG guide covers the mechanics and where retrieval fits alongside live tools.
Ways to give an agent memory
There’s a spectrum from crude to sophisticated, and most real systems combine several rungs:
- Conversation summarization — roll older turns into a running summary so long sessions don’t blow the context window. The simplest form; it only helps within a session unless you persist the summary.
- A persistent memory store — write durable facts and events to a database and retrieve them on future sessions. This is the step from “long conversation” to “remembers me tomorrow.”
- Vector retrieval over memory — embed stored memories so the agent can pull the semantically relevant ones, not just the most recent. Scales to large histories.
- Model-provider memory tools — providers now ship first-class memory primitives; Anthropic, for instance, introduced a memory tool that lets Claude store and consult information across sessions via a dedicated tool interface.
- Curated “living” memory — a maintained document of the most important, deduplicated knowledge that’s injected on every run, distinct from a large searchable archive.
The sophisticated systems layer these: a small always-injected “hot” memory for the essentials, plus a large retrievable store for the long tail, plus a curation step that keeps both honest.
A working example: compounding business memory
To make this concrete, here’s how memory works in our own analyst — not as a pitch, but because it’s a real deployed instance of the layers above.
Our Assistant has an opt-in compounding workspace memory. After conversations, a cheap curation pass distils durable business facts, decisions and learnings into a living document — kept small, deduplicated, and superseded when facts change — that’s injected into every future run. That’s the always-hot semantic-plus-procedural layer. Alongside it sits a larger retrievable company brain: workspace knowledge embedded into a vector store and pulled by hybrid semantic-plus-keyword search only when a question needs it.
The design lesson generalizes beyond us: separate the small curated layer from the large retrievable one, and invest in curation. An agent that remembers everything badly is worse than one that remembers the right things well.
Frequently asked questions
What is AI agent memory?
It’s an agent’s ability to retain and recall information across time — beyond the current conversation. It spans working memory (the context window, which is ephemeral) and persistent memory (durable storage the agent can consult in future sessions), covering past interactions (episodic), stable facts (semantic), and learned procedures (procedural).
Is the context window the same as memory?
No. The context window is short-term working memory — everything the model can see in the current session — and it disappears when the session ends or the window fills. Persistent memory is a separate layer you add (a store plus retrieval, or a curated living document) so the agent remembers across sessions instead of starting blank each time.
What are the types of AI agent memory?
Four are commonly distinguished: working memory (the live context window), episodic memory (records of past interactions and events), semantic memory (durable facts and knowledge), and procedural memory (how to perform tasks and learned patterns). Most capable agents blend all four rather than relying on one.
How do you give an AI agent persistent memory?
Options range from summarizing conversations, to writing durable facts to a database, to embedding memories for vector retrieval, to using a provider’s memory tool, to maintaining a curated living document injected on every run. Strong systems combine a small always-injected “hot” memory with a large retrievable store, plus curation that deduplicates and supersedes stale facts.
Why is retrieval the hard part of agent memory?
Because an agent can’t fit its whole history into a finite context window, so it must select what’s relevant right now. Storing data is trivial; recalling the right memory at the right moment — via semantic similarity weighted by recency and importance — is what determines whether memory helps or just adds noise. Poor retrieval makes an agent forget or drown in irrelevance.
Sources
BusinessMCP Team
Every guide is written from running BusinessMCP on its own platform — the match rates, reply rates, and deliverability lessons are from our own data, not recycled blog folklore. About BusinessMCP
Turn your business into one AI-ready MCP server
Connect your tools, install one tracking script, and expose your unified data to any AI agent through a single secure endpoint.
Get started free