How to give your AI agents long-term memory you own

Updated · By the Cozy team

To give Claude, ChatGPT and Codex the same long-term memory, connect them all to one remote MCP knowledge base that stores plain Markdown. Built-in memory only works inside one assistant, and CLAUDE.md or AGENTS.md files only work on one machine. A shared MCP wiki such as Cozy lets every agent read, cite and update the same pages.

The four ways to give an AI agent memory

ApproachWorks across toolsWorks across machinesYou can read and edit itBest for
Built-in memory (ChatGPT, Claude, Gemini)NoYesPartlyPersonal preferences in one assistant
Context files (CLAUDE.md, AGENTS.md, context.md)PartlyNo, unless you sync themYesRules for one repository
Memory APIs (Mem0, Zep, Letta)Through your codeYesMostly notDevelopers building apps
A shared MCP wiki (Cozy)YesYesYesProjects, research and people you work with

Why your AI keeps forgetting

Each chat or agent session starts with an empty context window. Built-in memory adds a short summary of you, but it is kept per assistant: what you told ChatGPT does not reach Claude, and Claude memory is scoped per project. In Claude Code, Anthropic's docs describe CLAUDE.md as written by you and auto memory as written by Claude, stored per repository on your machine. None of these is a shared, cited record of your work.

Set up one memory for every agent

  1. Create the memory. Sign in at cozy.cloud. You get a private workspace called My wiki.
  2. Connect your agents. Add https://cozy.cloud/mcp to each client and sign in with OAuth. Claude, ChatGPT, Claude Code, Codex and Cursor all use the same URL, and connected agents are listed under Connectors → Agents. Details are in the MCP setup guide.
  3. Feed it sources. Connect Granola, Gmail, Google Drive, Notion, Slack or Linear, upload files, or post Markdown to the ingest API. Sources land in sources/ with stable IDs.
  4. Let the agent write pages. Ask it to organize: create pages in wiki/ with a type and description, link them, cite sources and keep wiki/index.md short.
  5. Recall at the start of a task. Ask the agent to call cozy_context for the project or person. It returns the page, its linked neighbors, its evidence and any warnings in one call.
  6. Keep it healthy. Run the maintain or dream prompt between tasks. cozy_health lists broken links, stale pages, conflicts and orphans in priority order.

What to store, and where

Keep memory trustworthy

Memory that agents write can drift. Cozy keeps every page tied to evidence: a page that cites a source which later changed is marked stale, disagreements are written as CONFLICT: lines with both sources, and the last 50 revisions of every file can be restored. You choose an agent's scopes when you approve it, and workspace credentials for scripts can be limited to read-only or to specific folders, so a coding agent can update agents/ without touching your personal pages.

Frequently asked questions

How do I give Claude long-term memory?

Turn on Claude's built-in memory for preferences, and connect Claude to a remote MCP knowledge base such as Cozy for project knowledge. Claude can then search, read and update the same pages in every conversation, on the web, desktop or Claude Code.

Can ChatGPT and Claude share memory?

Not natively. Each assistant keeps its own memory. To share, connect both to the same MCP server. With Cozy, both read and write one wiki of Markdown pages.

How do I stop re-explaining context to AI?

Write the context down once in a place every agent can reach, and have agents load it at the start of each task. A shared MCP wiki does this automatically: the agent calls one tool to get the relevant page, its linked pages and its sources.

Is a memory MCP server safe?

Look for scoped, expiring, revocable credentials, server-side folder permissions and restorable history. Cozy agents get no more access than you have in each workspace, capped by the scopes you approved, and can be disconnected at any time. Workspace credentials expire within 90 days and can carry folder prefixes, and the last 50 revisions of each file can be restored.

Give your agents a memory worth keeping

Cozy gives every account a private wiki that Claude, Codex, ChatGPT and other MCP clients can read and maintain.

Start your wiki