AI agent memory is information preserved outside the model's immediate response so it can be retrieved during later work. Useful memory is selective, scoped, and traceable. It is not simply an unlimited chat transcript.
The easiest way to understand agent memory is to separate three jobs: holding the current task, remembering durable preferences, and preserving the evidence and decisions for a specific project.
What is short-term agent memory?
Short-term memory is the active context used to complete the current task. It includes the user's request, recent messages, tool results, and files that have been brought into the conversation.
This memory is fast because it is already present in the model's context. It is also limited. As a conversation grows, older information may be summarized, omitted, or become less influential. Starting a new conversation often removes that working context entirely.
Short-term memory is best for:
- The current objective and constraints.
- Intermediate calculations or tool output.
- A draft being revised in the same session.
- A small number of source passages needed immediately.
It is a poor place to store the durable history of a project. Keeping everything active makes prompts expensive, noisy, and harder to reason about.
What is long-term agent memory?
Long-term memory preserves information that may be useful across sessions. Examples include writing preferences, a user's role, recurring workflows, important entities, or summaries of previous interactions.
This kind of memory can make an assistant feel consistent, but it has an important weakness: facts are often stored as short assertions without the evidence that produced them. A memory such as “the customer prefers weekly reports” is convenient, but it may not explain which customer, when the preference was stated, or whether it still applies.
Long-term memory should therefore be reserved for stable facts and preferences. It needs a way to be reviewed, corrected, and deleted.
What is project memory?
Project memory is a bounded collection of sources, decisions, and working knowledge tied to an outcome. It sits between the temporary conversation and a person's general long-term profile.
A project memory might hold customer interviews, research articles, technical notes, competitive examples, a product brief, and decisions made during the work. Its scope is narrow enough to retrieve accurately but durable enough to survive many conversations.
Project memory is especially valuable when several tools participate in the same work. A coding agent, writing assistant, and research interface can all consult the same project without sharing one enormous transcript.
| Memory type | Best scope | Typical contents | Main risk |
|---|---|---|---|
| Short-term | One task or conversation | Current instructions, recent messages, tool output | Important context disappears when the session changes |
| Long-term | A person or organization | Preferences, stable facts, recurring patterns | Thin facts become stale or lose provenance |
| Project | One ongoing outcome | Sources, decisions, examples, current working knowledge | Poor organization can return irrelevant evidence |
Memory needs retrieval, not just storage
Saving information is only half the system. The agent also needs a reliable way to decide what should enter the active context.
Keyword search works when the query uses the same language as the source. Semantic search helps when the idea is similar but the words differ. Metadata such as project, source type, date, and author helps constrain the search before relevance is calculated.
A good retrieval result should include the original source and enough surrounding text to interpret the passage. Otherwise the agent receives a detached sentence that may be easy to misuse.
How MCP fits into agent memory
The Model Context Protocol allows servers to expose resources, prompts, and tools to compatible clients. Memory can therefore remain in a focused service while the AI application requests relevant context when needed.
This architecture supports portability. The same memory service can be useful to more than one client, subject to each client's capabilities and the permissions the user approves. The AI application remains responsible for the conversation, while the server remains responsible for the project knowledge it exposes.
A useful memory hierarchy
Use a simple rule when designing an agentic workflow:
- Keep current instructions and intermediate work in short-term context.
- Keep stable preferences in editable long-term memory.
- Keep sources, decisions, and reusable evidence in project memory.
- Retrieve only what the current task needs.
- Preserve links back to the original material.
This hierarchy prevents “memory” from becoming a vague promise. Each layer has a clear owner, scope, and reason to exist.