# agentmemory

> Shared long-term memory for coding agents like Claude Code, Cursor and Codex

- Repository: https://github.com/rohitg00/agentmemory
- Category: Memory, RAG & data
- Stars: 29,810 · Forks: 2,633 · Language: TypeScript · License: Apache-2.0
- Experience: Some experience
- Page: https://ir.adyog.com/repos/rohitg00/agentmemory/

Coding agents forget everything when a session ends, so you explain the same architecture and re-find the same bugs each time. agentmemory runs a local server that stores what happened and returns relevant pieces when the agent asks.

Agents connect in one of three ways: hooks that capture activity automatically, an MCP server with tools such as memory_recall and memory_smart_search, or a plain REST API. Because all agents talk to one server, something learned in Claude Code can be recalled from Cursor or Codex. It is built on the iii engine and needs no external database.

It works without any API key, using BM25 keyword search. You can turn on local embeddings for meaning-based search, or add an LLM provider for compressing observations. The README says it builds on Karpathy's LLM Wiki pattern with confidence scoring, lifecycle, knowledge graphs and hybrid search. Its benchmark and competitor claims come from the authors, so test it on your own workflow.

## What it does

- **Works across many agents**: Lists adapters for Claude Code, Codex CLI, Copilot CLI, Cursor, Gemini CLI, OpenCode, Cline, Goose, Aider and more. Add one with `agentmemory connect <agent>`.
- **Keyless by default**: Search uses BM25 with no API key. Setting EMBEDDING_PROVIDER=local adds on-device semantic search using a model downloaded once.
- **Hooks, MCP and REST**: Hooks capture activity automatically, MCP tools let agents query memory, and a REST API covers agents without either.
- **Skills for your agent**: One command installs 17 skills that teach the agent when to reach for memory.
- **Demo and viewer**: A demo command seeds sample sessions to test recall, and a local viewer runs on port 3113.

## What you could build

- Keep project context, past decisions and bug fixes available across coding sessions.
- Share one memory between Claude Code and Cursor so each knows what the other did.
- Add persistent memory to an agent that only supports MCP or HTTP.
- Run fully local semantic recall with on-device embeddings and no API key.
- Study how an agent memory layer combines hooks, search and a knowledge graph.

## Who it's for

Developers who use coding agents daily and are comfortable with Node.js, a terminal and editing a config file; knowing what MCP is helps.

## Get started

You need Node.js 20 or newer. Run the setup command, choose which agents to connect and whether to use an LLM provider, then run the demo to check that recall works.

```
npx -y @agentmemory/agentmemory@latest
```
```
npx -y @agentmemory/agentmemory@latest demo
```
```
npx skills add rohitg00/agentmemory -y
```

Tags: agent-memory, mcp, coding-agents, claude-code, bm25
