Agent Memory
Also called: Agentic Memory · AI Agent Memory
Agent memory is the mechanism by which an AI agent retains and later reuses information beyond what fits in a single prompt — across steps in a task, or across separate sessions.
A single call to a language model has no memory of its own — everything it "knows" about the current conversation has to be re-supplied as text in the context window on every call. Agent memory is the set of techniques an agent uses to work around that limit: deciding what information to carry forward, where to store it when it doesn't fit in the immediate context, and how to bring it back when it's needed again.
The problem shows up in two different shapes. Within a single task, an agent running many steps needs to remember what it already tried, what it found, and what's still left to do — this is often called working memory, and it usually just lives in the growing context window itself (see context-engineering for how that gets managed as it grows). Across separate sessions — a user coming back the next day, or a long-running agent picking up where it left off — the agent needs somewhere durable to store information outside any single context window, commonly called long-term memory.
There's no single required architecture for either kind. Common approaches for long-term memory include storing raw or summarized text in a searchable store (often a vector database, retrieved by semantic similarity) and appending structured records of past events (an episodic log) that the agent can query later. Which approach fits depends on whether the agent mainly needs to recall facts, past decisions, or specific past interactions.
How it works
In practice, memory almost always ends up back in the context window — storing information externally only helps if the agent can retrieve the relevant piece and re-insert it as text (or structured data) into a future prompt. So a memory system typically has a write path (deciding what's worth saving, and in what form) and a read path (deciding what to retrieve for the current step, usually by relevance to the current task or a similarity search over past entries). Getting the write path wrong means the agent forgets things that mattered; getting the read path wrong means it either misses relevant context or floods the prompt with irrelevant history.
Example
A coding agent working across multiple sessions on the same project might keep a short summary of architectural decisions made so far in a long-term store, so a new session doesn't have to re-derive them from scratch or re-read the entire codebase — while still using ordinary working memory (the context window) to track the steps of whatever task it's doing right now.
How it differs
Agent memory is sometimes conflated with context engineering. Context engineering is about curating what goes into a single context window for the step at hand; agent memory is the (often external, persistent) store that context engineering decides whether and when to pull information from.
Common misconceptions
FAQ
What is agent memory used for?
Is agent memory the same as a vector database?
Does every AI agent need long-term memory?
Last checked: 2026-08-28