Your personal memory, across sessions, agents, and devices.

agentmemory: How the Coding Agent Memory Server Works

memU Team memU Team

agentmemory is an open-source memory server for coding agents. Its GitHub repository had 30,164 stars when we checked on November 6, 2026. Version 0.9.32 shipped on November 4. The agentmemory facts below come from the project's own docs and code. We build memU, which works on the same problem, so the comparison at the end uses only facts stated here.

What is agentmemory, in one sentence?

agentmemory is a local server that records coding agent sessions through hooks and lets any connected agent search them through MCP tools or a REST API.

Rohit Ghumare started the repository on February 25, 2026, under the Apache-2.0 license. The README pitches it for a long list of coding agents "and any MCP client." They all talk to the same server, so one memory store serves every agent on the machine.

How does agentmemory differ from built-in agent memory?

Claude Code keeps its own memory per project. agentmemory sits outside any one host.

Claude Code auto memory agentmemory
Who writes it Claude, during the session Hooks record events. Rule-based compression by default, an LLM only if you pick a provider
What it records Notes Claude decides to keep Prompts, tool calls, errors and the agent's final reply each turn
Where it lives MEMORY.md plus topic files per project A file-backed store, state_store.db, in a local data folder
What loads at start The first 200 lines or 25KB of MEMORY.md Nothing by default. With injection on, up to 2,000 tokens
How you look at it Edit the Markdown or use /memory A local web viewer, MCP tools and a REST API
Which agents read it Claude Code only Any connected host, 26 in the README's table

Claude Code facts come from Anthropic's memory docs. The agentmemory column uses its README and storage guide.

What does agentmemory capture?

On Claude Code, the plugin registers 12 lifecycle hooks. SessionStart registers the session and project path, and SessionEnd closes it. In between, the hooks save each prompt after a privacy filter and every tool call with its input and output, errors included. At Stop they also save the assistant's final reply for the turn.

Codex gets 6 of those hooks through its plugin. On other hosts, capture depends on which events the host exposes. The config template caps stored tool output at 8,000 characters per observation.

Which model processes the memory, and who pays?

By default, none. Without a provider setting, the config template says agentmemory "sends no session content to an LLM." Each observation goes through synthetic compression, a rule-based step that tags its type and pulls out file paths. Keyword search with BM25 works in this mode.

Since 0.9.32, an API key in your environment no longer turns anything on. You name a provider: Anthropic, OpenAI, Gemini, OpenRouter or MiniMax. A local OpenAI-compatible server such as Ollama also works. A separate switch uses your Claude subscription through the Agent SDK.

A provider unlocks session summaries and consolidation into lessons and facts. LLM-written compression needs a second flag. The README warns it "can make a request for each captured observation," so check your provider's pricing first. You pay the provider directly.

Semantic search is opt-in too. One setting downloads a small embedding model once and runs it on your machine.

Where does agentmemory store memory?

In a file-backed key-value store. The storage guide says records live in memory and are written to state_store.db every two seconds. On macOS the data folder is ~/Library/Application Support/agentmemory. Redis is an optional backend.

Search fuses BM25 keywords with vectors when embeddings are on. A knowledge graph adds matches when the query names known entities. The README says memories decay over time and stale ones are evicted automatically.

The server is local by default. To reach it from more than one machine, you can run it on a server with the project's Docker deploy templates. Its mesh sync tool can also sync two instances peer to peer.

What does agentmemory inject into a new session?

Nothing, unless you turn it on. The SessionStart hook only registers the session unless injection is enabled. First-run setup asks about it with "No" as the default and a cost note, since injection spends session tokens.

With injection on, the context builder assembles a project profile with saved lessons. It adds the project's most recent sessions. The block is capped at 2,000 tokens by default. A separate 1,500-token budget re-injects memory before Claude Code compacts the conversation.

Without injection, the agent reaches memory on demand. The plugin bundles 17 skills, such as recall and remember, and an MCP server with 54 tools. On a host connected only through MCP, nothing is captured automatically. The agent saves and searches through those tools. Other tools let several agents coordinate, for example by leasing a task to one agent or sending signals between them.

What privacy controls does agentmemory have?

Secret scrubbing is on by default. The API section says secrets are redacted on every write path. That covers API keys and tokens, and also private keys or passwords embedded in URLs. Text inside private tags is stripped before storage. The server and viewer bind to localhost, and a random secret protects the API.

The privacy policy, updated November 3, 2026, says "nothing that agentmemory records leaves your machine" by default. It also says the project sends no usage data. Data leaves only through options you enable, such as an outside model provider or a remote server.

Which agents does agentmemory support, and how do you install it?

The README's agent table lists 26 hosts, and the depth varies. Native plugins with capture hooks cover Claude Code, Codex CLI, Cursor, OpenCode, OpenClaw, Hermes, pi, Oh My Pi and DeepSeek Harness. Copilot CLI and Devin can add capture hooks too, as can Antigravity. About a dozen others, including Gemini CLI and Zed, connect as MCP servers. Aider uses the REST API.

You need Node.js 20 or later. Start the server, which also runs the setup wizard:

npx -y @agentmemory/agentmemory@latest

Then connect a host, either with the agentmemory connect command or through its plugin system. In Claude Code:

/plugin marketplace add rohitg00/agentmemory
/plugin install agentmemory

The server must be running for capture to work. The viewer at localhost port 3113 shows memories and sessions, with a replay of past ones. You can edit or forget a memory there, and export the store. Native Windows works, but only the Copilot CLI connector is automated there, per the Windows notes.

How does agentmemory compare with claude-mem?

Both capture coding sessions through hooks, and both are Apache-2.0. Our claude-mem guide covers that plugin. The main split is the default model use.

agentmemory claude-mem
Model use by default None. Rule-based compression and keyword search An observer model, Haiku by default, on your Claude plan or a hosted trial
Storage A file-backed store, Redis optional SQLite plus a Chroma vector index
Startup context Off by default. Up to 2,000 tokens when on On by default. An index of 50 observations
Agent replies Final reply of each turn is stored Not stored as observations
Secret redaction On for every write Opt-in regex redaction
Usage telemetry None, per its privacy policy PostHog, on by default
Paid services None. No hosted service A hosted observer and Cloud Sync

claude-mem gives you a startup index and semantic search with no extra setup. The cost is observer model calls on your tool events. agentmemory spends no model tokens until you configure a provider or turn on injection.

What should you read in the fine print?

The repository description ranks agentmemory first "based on real-world benchmarks." Treat that as the project's own claim. Its October 28 evaluation is careful about scope. It tested only the BM25 search component of a 0.9.31 build, and it says no third-party memory product was run.

On LongMemEval-S, the project reports that BM25 found every required session in the top five for 84.7% of answerable questions. A plain grep baseline scored 72.1%. On the project's small coding fixture, the grep baseline did better: 100% against 93.3%. The doc says answer quality and hybrid search need separate tests. We found no independent test of either.

The memory server is one more process to keep running. Hooks that cannot reach it queue events in a local file until it returns. The project also moves fast: 0.9.32 changed provider behavior in a breaking way, so read release notes before upgrading.

The bottom line

agentmemory is a strong pick if you want one local memory for several coding agents and want it free of LLM calls by default. Install it and connect your main host, then run keyless for a week. Turn on semantic search or startup injection later, once you know what each one costs you.

How does agentmemory's memory differ from memU's?

Say Claude Code fixes a flaky auth test on your desktop, and agentmemory captures every step. That evening you open Codex on a laptop. Its local server has never seen the fix, unless you deployed agentmemory to a server or set up mesh sync between machines.

agentmemory memU
Who writes the memory Hooks capture raw events. Rule-based compression by default, an LLM provider if you add one The host agent distills its own session logs on its own model usage. memU's service makes no LLM calls
When it records Live, on each hooked event A scheduled background task slices new session logs into jobs
What you can open Records you can view, edit, forget and export in a local viewer, plus MCP tools and a REST API Plain Markdown memory and skill files that you and your agents both read
Reusable workflows Lessons in its store, plus 17 bundled skills for using memory Distills reusable skills from your own history, as Markdown
Across devices Local by default. Self-host a remote server or sync instances Hosted on memu.so, free and cross-device

agentmemory is the right pick if you want everything on one machine with no account and no model calls. It also covers hosts memU's README does not name, such as Gemini CLI or Zed. Its multi-agent tools, such as leases and signals between agents, have no counterpart in memU's README. memU fits when you want your agents to write memory as Markdown files. It also carries that memory across machines without a server of your own.

To try memU hosted, get an API key from memu.so and send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is YOUR_MEMU_API_KEY.

The self-hosted setup and the per-host support matrix are in the memU GitHub repository. For a wider survey, see our AI agent memory frameworks guide. More on the design is at memu.pro.

FAQ

Is agentmemory free?

Yes. It is open source under Apache-2.0 with no hosted service. Costs come only from an LLM or embedding provider you enable.

Does agentmemory need an API key?

No. Capture and keyword search work without any key. Semantic search can run on a local embedding model, and summaries need a provider you select.

Where does agentmemory store data?

In a file-backed store named state_store.db in a local data folder, which is ~/Library/Application Support/agentmemory on macOS. Redis is an optional backend.

Does agentmemory work with Codex and Cursor?

Yes. Both get native plugins with lifecycle hooks and an MCP server, and they share one memory with Claude Code and other connected hosts.

Does agentmemory send my code to the cloud?

Not by default. Its privacy policy says nothing it records leaves your machine unless you enable an outside provider or a remote server.