Working memory
Active information for the current decision cycle. In practice: the context window — instructions, the latest messages, tool results, retrieved facts.
- Lives in the prompt of each call
- Rebuilt every turn
- Bounded by the context window
A language model forgets everything between calls. Memory is what the software around it writes down, and chooses to show it again.
Researchers borrowed four names from cognitive science to describe agent memory — working, episodic, semantic and procedural — and the CoALA framework gave them precise meanings for language agents. This guide defines each type, shows how memory moves during one decision cycle, compares the ways to keep a long conversation small, and lists what to govern before an agent remembers anything about your business.
Updated · 7 sources
The four AI agent memory types are working memory — the information in the model’s context for the current step; episodic memory — records of past interactions and runs; semantic memory — stored facts about the world and the business; and procedural memory — how to act, held in the model’s weights, the agent’s code and its instructions. The definitions come from the CoALA framework for language agents (2023).
Only working memory reaches the model directly. The other three are long-term stores: something has to retrieve from them into working memory before the model can use them, and something has to write to them for the agent to learn.
Active information for the current decision cycle. In practice: the context window — instructions, the latest messages, tool results, retrieved facts.
Experience from earlier cycles: what was asked, what the agent did, how it went. Used to recall a past case or avoid a past mistake.
Knowledge about the world and about the agent itself — facts that stay true across conversations.
How to do things. CoALA splits it in two: implicit, in the model’s weights; explicit, in the agent’s code, instructions and skills.
Why the names matter. They tell you what to store and how to retrieve it. A user’s preferred currency is semantic; the refund the agent issued yesterday is episodic; the refund procedure is procedural. Mixing them in one undifferentiated “memory” is how agents end up obeying a remark someone made once.
CoALA describes three internal actions on memory — retrieval, reasoning and learning — and external actions on the world. Every agent loop is some arrangement of them.
The observation from the action becomes working memory for the next cycle.
A long conversation outgrows any context window, and long inputs lose recall before they overflow. Each strategy below trades exact recall for room — the further right, the more is kept as distilled fact rather than as words.
A summary of a summary loses detail and can end up stating things nobody said. Fold new turns into one fresh summary instead.
Old tool output is often the largest, least useful block — Anthropic calls clearing it one of the safest, lightest forms of compaction.
Pair compaction with a memory store: compaction keeps the window small, memory keeps the facts that must outlive it.
Memory is only useful if the right piece reaches working memory at the right moment — and nothing it should not see comes with it.
Store each memory with who, when, which conversation and which source.
Make it findable by keyword, by meaning, or by a plain path or key.
Keep a name or reference in context; load the body only when the step needs it.
Return only what the person asking may see.
Put the memory near the question and say where it came from.
Which memory should hold this?
Memory turns one conversation’s content into another conversation’s input. That is useful — and it is also how private data leaks across users and how one planted instruction persists for weeks.
Botminds keeps two kinds of conversation memory and never summarises a summary — so a long conversation stays inside its budget without drifting from what was said.
Memory is one provider in a context built from budgeted tiers, with every block visible in a preview. Read context engineering on Botminds, and see an agent’s parts in the anatomy of an agent.
The four AI agent memory types are working memory (the current context), episodic memory (past interactions and runs), semantic memory (facts about the world and the business) and procedural memory (how to act — weights, code and instructions). The CoALA framework set out these definitions for language agents in 2023.
Short-term memory is working memory: what is in the model’s context on this call, rebuilt every turn. Long-term memory is everything stored outside the model — episodic, semantic and procedural — which reaches the model only when it is retrieved into the context.
Episodic memory stores experience from earlier decision cycles: past conversations, actions and outcomes. An agent uses it to recall how a similar case went, or to continue work from a previous session.
Semantic memory holds knowledge that stays true across conversations — documents, policies, records and facts about a user or the agent itself. It is usually searched by keyword or by meaning and placed into the context when relevant.
Procedural memory is knowledge of how to act. CoALA describes two forms: implicit, in the language model’s weights, and explicit, in the agent’s code — which in practice includes its instructions, skills and tool implementations.
A language model keeps nothing between calls; each request starts from what is sent to it. Memory is built by the application around the model, which stores conversations and facts and puts the relevant parts back into the context.
By keeping the latest messages word for word and replacing older ones with a summary, by compacting the whole context near its limit, or by writing notes outside the window and reading them back. Most agents combine two of these.
Retrieval-augmented generation is a way to read from semantic memory: it searches a store and places the results in working memory. Agent memory also covers writing new memories and keeping episodic records, which RAG alone does not.
Bring one process and its documents. We’ll show you the agents, the controls and the record, running on your data.