# What is AI agent memory?

AI agent memory can mean information an agent stores and retrieves beyond the current prompt or conversation. Anthropic documents [persistent memory](https://www.knowman.io/guides/persistent-memory-for-ai-agents) files, while OpenAI documents two approaches: a broader summary of relevant context and explicit saved memory items ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool), [OpenAI](https://help.openai.com/en/articles/8590148-memory-in-chatgpt)).

## Context and persistent memory

Anthropic documents [memory files](https://www.knowman.io/guides/claude-code-memory) that persist between sessions. This lets Claude retain knowledge over time without keeping everything in the context window ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)).

## How persistent agent memory works

Anthropic's memory tool lets Claude create, read, update, and delete files that persist between sessions. Claude records what it learns in files under `/memories` and retrieves them on demand rather than loading everything up front ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)).

The application controls the storage. Claude requests file operations, while the developer runs them against storage the application controls. Anthropic also documents checking the memory directory before a task, plus using memory as a recovery mechanism when a new session resumes earlier work ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)).

## Claude's documented memory approach

Claude's documented approach combines durable files with just-in-time retrieval. The agent writes what it learns, then reads selected memory when it is needed. For long-running agents, Anthropic recommends pairing memory with compaction, which keeps active context small while memory preserves information that must survive summarization ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)).

Memory requires care. Anthropic recommends deleting files that have not been accessed in a long time. It also documents a path-validation risk, because a malicious path can reach files outside the memory directory ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)).

## ChatGPT's documented memory approach

OpenAI documents two approaches. Improved Memory continually updates a broader summary of relevant context, while legacy [saved memories](https://www.knowman.io/guides/how-to-give-chatgpt-memory) use an explicit list of individual items. ChatGPT decides which available information is relevant, and saved memories are stored separately from chat history ([OpenAI](https://help.openai.com/en/articles/8590148-memory-in-chatgpt)).

Depending on plan and region, sources can include past chats, saved memories, [custom instructions](https://www.knowman.io/guides/give-your-ai-context), saved files, and connected-app content. Temporary chats do not create or update memories, even when personalization is on ([OpenAI](https://help.openai.com/en/articles/8590148-memory-in-chatgpt)).

## Where a knowledge base fits

Anthropic lists building up a knowledge base over time as a use case for its memory tool ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)).

The [Model Context Protocol](https://www.knowman.io/guides/what-is-an-mcp-server) gives AI applications a standard way to connect to external data sources such as local files and databases. The protocol documentation does not describe how a knowledge base integrates with agent memory ([Model Context Protocol](https://modelcontextprotocol.io/docs/2026-07-28/getting-started/intro)).

## How knowledge differs from memory

The available documentation does not provide a general distinction between [a knowledge base](https://www.knowman.io/guides/knowledge-base-vs-second-brain-vs-pkm) and agent memory. Anthropic lists building a knowledge base over time as a memory-tool use case, while OpenAI describes what its Memory feature can use and how saved memories are handled ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool), [OpenAI](https://help.openai.com/en/articles/8590148-memory-in-chatgpt)).

For related reading, see the [personal knowledge base guide](https://www.knowman.io/guides/personal-knowledge-base), [knowledge base for AI agents guide](https://www.knowman.io/guides/knowledge-base-for-ai-agents), and [persistent memory for AI agents guide](https://www.knowman.io/guides/persistent-memory-for-ai-agents).

## Where KnowMan fits

KnowMan is built for one person's library today. It saves articles and links, reads and tags them, [answers questions](https://www.knowman.io/guides/ai-knowledge-base) with citations, and keeps memories such as claims, decisions, and playbooks. Its MCP tools can search [saved items](https://www.knowman.io/guides/how-to-save-articles), answer with citations, read one item, save a URL, list recent items, and retrieve memories. See [the MCP server guide](https://www.knowman.io/guides/mcp-server-knowledge-base) for setup details.

KnowMan runs locally as a stdio server with `npx -y @knowman/mcp` and as a hosted server at https://api.knowman.io/mcp. Connect to the hosted server with OAuth sign-in on the KnowMan consent page or an API key sent as an `Authorization: Bearer` header.

## Connect this agent to KnowMan

Add the hosted KnowMan server at https://api.knowman.io/mcp in an MCP client that supports OAuth, then sign in on the KnowMan consent page and approve access. Or create an API key in KnowMan settings and send it as an `Authorization: Bearer <key>` header.

For Claude Code, configure the hosted server with `claude mcp add --transport http knowman https://api.knowman.io/mcp --header "Authorization: Bearer <key>"`. For the local server, use `npx -y @knowman/mcp`; setup details are in the [open-source client](https://github.com/Essatt/knowman-mcp).

## Questions

### What is the difference between short-term context and long-term memory?

The available documentation does not define a general short-term context and long-term memory taxonomy. Anthropic documents persistent memory files that let Claude retain knowledge between sessions without keeping everything in the context window ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)).

### Does ChatGPT remember every conversation?

No. ChatGPT does not retain every detail from every conversation. It decides which available information is relevant, and memory can change as context changes ([OpenAI](https://help.openai.com/en/articles/8590148-memory-in-chatgpt)).

### Can an AI agent use a knowledge base as memory?

The available documentation does not explain this integration in general. Anthropic lists building up a knowledge base over time as a memory-tool use case, while MCP documents connecting applications to external data sources ([Anthropic](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool), [Model Context Protocol](https://modelcontextprotocol.io/docs/2026-07-28/getting-started/intro)).

### Where can I learn how to connect a knowledge base to an AI agent?

Start with the [knowledge base for AI agents guide](https://www.knowman.io/guides/knowledge-base-for-ai-agents), [connect any AI to your notes](https://www.knowman.io/guides/connect-any-ai-to-your-notes), and [MCP server guide](https://www.knowman.io/guides/mcp-server-knowledge-base). KnowMan runs locally with `npx -y @knowman/mcp` and as a hosted server at https://api.knowman.io/mcp, which clients can connect to using OAuth sign-in or an API key.

## Related guides

- [What Is a Knowledge Base for AI Agents?](https://www.knowman.io/guides/knowledge-base-for-ai-agents)

- [Persistent Memory for AI Agents](https://www.knowman.io/guides/persistent-memory-for-ai-agents)

- [Connect your knowledge base through KnowMan's MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base)

- [What is a personal knowledge base, and how do you build one?](https://www.knowman.io/guides/personal-knowledge-base)

- [How Do You Connect AI to Your Notes?](https://www.knowman.io/guides/connect-any-ai-to-your-notes)

- [Understand AI knowledge bases through the sources behind an answer](https://www.knowman.io/guides/ai-knowledge-base)

## More in this topic

- [How memory works in Claude Code](https://www.knowman.io/guides/claude-code-memory)
- [How to give ChatGPT Dots better memory](https://www.knowman.io/guides/chatgpt-dots-memory)
- [How to give Claude Duet better memory](https://www.knowman.io/guides/claude-duet-memory)

## Give your agent a durable knowledge source

Try KnowMan Pro for 14 days with no credit card. [Create your account](https://app.knowman.io/signup)

[Start free](https://app.knowman.io/signup)

Every new account starts with 14 days of Pro. No credit card.

Source: https://www.knowman.io/guides/ai-agent-memory
