ModelRefs / Working Memory (Agents) — AI Glossary
Working Memory (Agents) — AI Glossary
The active context window contents available to an agent during a reasoning step; the agent's immediate information space. Limited by context window size.
Overview
Working memory for agents is the context window: the conversation history, retrieved documents, tool results, and in-progress scratchpad. Limited by context window size. Agents must manage working memory actively—compressing old turns, evicting irrelevant content—as tasks grow longer. Distinct from persistent memory stores.
Reference details
| Topic | agents |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
How it works
- Working memory is the context window as it stands during this step: system prompt, history, retrieved documents, tool results and any scratchpad.
- It is reconstructed on every call rather than persisting — nothing carries over except what the caller resends.
- Its contents compete for one finite budget, so a long history directly reduces how much retrieved evidence can be supplied.
- Attention over it is uneven, so material in the middle is used less reliably than material at the edges.
- Management is active: compress history, drop stale tool output, and re-place the most important material where it will be attended to.
Example: The budget is zero-sum
A 128,000-token window with a 2,000-token system prompt and 4,000 reserved for output leaves 122,000. A 60-turn history at 500 tokens each takes 30,000, leaving 92,000 for retrieval. Let the history reach 160 turns — 80,000 tokens — and retrieval is down to 42,000, less than half. No retrieval setting changed; the conversation consumed the budget. This is why summarising history is a retrieval-quality decision and not only a cost one.
Commonly confused with
Working memory is what is in the context window during this step; long-term memory is what survives the session. The practical difference is what each costs and how each fails: working memory is re-sent and re-billed on every call and disappears when the run ends, while long-term memory costs a retrieval and fails by returning the wrong entry. `memory` is the umbrella above both.
When to use it
Reach for it when:
- Reasoning about what an agent can actually see at a given step.
- Deciding what to compress or drop as a conversation or task lengthens.
- Explaining why retrieval quality degrades over a long session with no configuration change.
Reach for something else when:
- Describing what survives the session, which is long-term memory.
- Assuming it persists — it is rebuilt from what the caller sends on each call.
- Treating the window as free: everything in it is paid for on every turn.
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Working Memory (Agents) — AI Glossary.
Frequently asked questions
What is Working Memory (Agents)?
The active context window contents available to an agent during a reasoning step; the agent's immediate information space.
What concepts are related to Working Memory (Agents)?
Closely related concepts include memory store, context management, long term memory.