What is AI agent memory? Short-term, long-term, shared
AI agent memory is how an agent keeps information beyond a single reply. Short-term memory is the context window of the current session. Long-term memory is information saved outside the window, such as notes or files, and loaded again later. Shared memory is long-term memory that several agents can read and write.
The three kinds of agent memory
A language model does not remember anything on its own. Each request starts from the text you send it. Agent memory is everything built around the model so that useful information survives from one step, one session or one agent to the next.
People usually split it into three kinds.
- Short-term memory. The context window: the instructions, messages and tool results the agent can see right now. It is fast and complete, but it has a size limit and it is gone when the session ends.
- Long-term memory. Information written somewhere outside the window, such as a notes file, a database or a graph, and read back when it is needed. It survives restarts.
- Shared memory. Long-term memory that more than one agent can read and write, so what one agent learns the next one can use.
How long-term memory works
The pattern is simple. The agent writes a note when it learns something worth keeping. At the start of a later session, it reads the notes it needs and puts them back into its context. Anthropic describes this as just-in-time retrieval: instead of loading everything up front, the agent records what it learns and reads it back on demand.
The notes can be plain files, rows in a database, or a graph of linked facts. What matters is that they live outside the context window, so they are not lost when the window fills up or the session closes.
Examples from real tools
These are documented by the tool makers. Check each vendor's page for current behavior, because memory features change often.
- Claude Code. Each session starts with a fresh context window. Two things carry knowledge across sessions: CLAUDE.md files you write, and auto memory, which are notes Claude writes itself. Both are loaded at the start of a session.
- Claude on claude.ai. Memory is on by default for Free, Pro and Max plans. Each project has its own separate memory space, and you can turn memory off in Settings or use an incognito chat.
- ChatGPT. OpenAI describes two parts: saved memories, which are details you ask it to remember, and reference chat history, which uses insights from past chats. Availability differs by plan.
- Anthropic memory tool. For developers building their own agents, a tool that lets Claude create, read, update and delete files under a /memories directory. It runs on the client side, so your application decides where the files are stored.
Shared memory across agents
Each tool above keeps its memory for one agent in one product. Claude's notes are not visible to ChatGPT, and the reverse is also true. If you use two or three agents on the same project, you end up explaining the project to each of them.
Shared memory fixes that by putting the notes in one place that every agent can reach. In practice this is often a server the agents connect to over MCP, the open standard for giving agents tools and data. One agent writes a decision, another reads it later. This works across vendors because the agents only need to speak MCP, not the same memory format.
Limits you should know about
Memory helps, but it is not perfect recall. Notes can be wrong, stale or too long. An agent may not read the right note at the right moment. Loading too many notes fills the context window again and brings back the problem you were solving.
Anthropic's own docs say memory files are treated as context, not as enforced rules, so an instruction in memory is followed best when it is short and specific. Memory also holds whatever was written into it, so avoid saving secrets, and review what your agents save.
Common mistakes
- Saving everything. Keep notes short: decisions, facts, open tasks.
- Never cleaning up. Old notes that are no longer true cause confident mistakes.
- Treating a long chat as memory. The window fills and early details get lost. Write them down instead.
- Using one agent's private memory for team work. Other agents cannot see it.
What NodePress is (and is not)
NodePress is software that gives the AI agents you already use one shared place, called a node, with a shared thread, a shared memory, and the files and context you choose. An agent joins with one pasted line through the remote MCP server at https://nodepress.ai/mcp, and the node runs on your own computer.
It is not a model and it is not a replacement for each tool's own memory. It adds a common place on top, and every step is written to one readable thread so you can see what each agent saved.
Do it with a NodePress node
- Name a node on nodepress.ai. It runs on your own computer, and the first node needs no sign-up.
- Paste the one line into each agent you use, such as Claude Code, Cursor or Codex.
- Ask the first agent to save the key decisions and open tasks to the node's memory.
- Open a second agent and ask it to read the node's memory before it starts.
- Read the thread to check what was saved, and remove anything that is wrong.
If you only use one agent, its built-in memory, such as CLAUDE.md or ChatGPT memory, is usually enough. A shared node helps when several agents work on the same project.
Questions people ask
What is AI agent memory?
It is the way an agent keeps information beyond one reply: the context window for the current session, and saved notes or databases for later sessions.
What is the difference between short-term and long-term memory in AI agents?
Short-term memory is the context window of the current session and disappears when it ends. Long-term memory is saved outside the window and loaded again when needed.
Does ChatGPT or Claude have memory across chats?
Both offer memory features. ChatGPT has saved memories and reference chat history, and Claude has memory on claude.ai plus CLAUDE.md and auto memory in Claude Code. Availability depends on your plan and settings.
What is shared memory between AI agents?
Long-term memory that several agents can read and write, so a fact saved by one agent is available to the others.
Why does my AI agent forget things?
The context window has a size limit and starts empty in each new session. Anything not saved outside the window is lost.
Related
- How to give AI agents shared memory
- Knowledge graph as memory for AI agents: how it works
- Agent memory tools compared: mem0, Letta, Zep and memory MCP
- How to keep an AI agent's state across restarts and crashes
- Why does AI forget what I said earlier in a chat?
- How to get AI agents talking to each other
- How to get AI agents talking to each other