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.
npx skills add so an agent knows when to call the memory tools instead of guessing.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.
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.