Favicon of AgentMemory

AgentMemory

An MCP memory server that gives Claude Code, Cursor, Codex CLI, Copilot CLI and other AI coding agents searchable memory that persists across sessions.

AgentMemory website screenshot
AgentMemory GitHub repository preview

agentmemory is a self-hosted memory server for AI coding agents. It captures what an agent does in a session, compresses it into searchable memory, and injects relevant context back into the next session, so you stop re-explaining architecture decisions, bug history, and coding preferences every time you start a new chat. It's built for developers who use Claude Code, Cursor, GitHub Copilot CLI, Codex CLI, Gemini CLI, or any other agent that speaks MCP or REST, and who are hitting the limits of static context files like CLAUDE.md or .cursorrules.

The project is built on the iii engine and ships as an npm package (@agentmemory/agentmemory) written in TypeScript, licensed under Apache-2.0. One server instance can serve memory to multiple agents at once, since they all talk to the same local process over MCP or HTTP.

Key features

  • Cross-agent memory server: a single running instance serves Claude Code, Copilot CLI, Cursor, Codex CLI, Gemini CLI, Hermes, OpenClaw, pi, OpenCode, Cline, Goose, and any other MCP or HTTP client.
  • Hybrid retrieval: combines keyword and vector search rather than relying on either alone; benchmarked against grep and BM25-only baselines on LongMemEval-S and an in-house coding-agent corpus.
  • Local embeddings by default: uses the all-MiniLM-L6-v2 model locally, so retrieval doesn't require an external API key or incur per-query cost.
  • Large MCP tool surface: exposes 54 MCP tools and 12 automatic hooks that capture session context without manual tagging.
  • No external database dependency: runs standalone and persists state to disk in a per-OS app-data directory or a custom path you set.
  • Native skills install: skills can be added via npx skills add so an agent knows when to call the memory tools instead of guessing.
  • Published benchmarks: comparison docs cover retrieval accuracy and token savings against mem0, Letta, Khoj, supermemory, MemPalace, and Hippo.

Ideal use cases

agentmemory fits developers who work with the same codebase across many agent sessions and are tired of re-explaining setup decisions, test coverage, or library choices each time. It also fits teams standardizing on multiple coding agents (say, Claude Code for one dev, Cursor for another) who want shared context instead of duplicated CLAUDE.md files that cap out around 200 lines. If you're pairing it with code-graph or knowledge-graph tools, agentmemory's job is specifically the session memory layer, not code indexing or document search.

It's not a fit if you need a managed cloud memory service with no local process to run, or if you're doing one-off scripts where there's no repeated session to remember across. Native Windows support is limited: the recommended path is WSL2, and agentmemory connect is currently unsupported on native Windows.

Installation

Install the CLI globally with npm, then start the server and connect it to your agent:

npm install -g @agentmemory/agentmemory
agentmemory                        # start the memory server on :3111
agentmemory demo                   # seed sample sessions and verify recall
agentmemory connect claude-code     # wire MCP into your agent (also: copilot-cli, codex, cursor, gemini-cli, ...)
npx skills add rohitg00/agentmemory -y   # install native skills so the agent knows when to use the tools

You can also run it without a global install:

npx @agentmemory/agentmemory

By default, state is stored outside the repo you launch it from (for example ~/Library/Application Support/agentmemory on macOS, ~/.local/share/agentmemory on Linux, %APPDATA%\agentmemory on Windows). To pick a specific location, pass --data-dir or set the environment variable:

npx @agentmemory/agentmemory --data-dir ~/.agentmemory-projects/main
AGENTMEMORY_DATA_DIR=~/.agentmemory-projects/main npx @agentmemory/agentmemory

If you already run your own iii engine, note that agentmemory pins a specific iii-engine version and won't attach to a mismatched one; stop the other engine before running agentmemory so it can install and use its pinned version separately.

Frequently asked questions

Share:

Stars
27.5K
Forks
2.4K
Last commit
3 days ago
Repository age
6 months
License
Apache-2.0
Self-hosted
No
Activity score
83/100
View Repository
Ad
Favicon

 

  
 

Similar to AgentMemory

Favicon

 

  
 
Favicon

 

  
 
Favicon