rohitg00 /
agentmemory
Shared long-term memory for coding agents like Claude Code, Cursor and Codex
- 29.8k stars
- 718 stars since 3 Oct
- TypeScript
- Updated yesterday
- Some experience
- Memory, RAG & data
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.
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@latestnpx -y @agentmemory/agentmemory@latest demonpx skills add rohitg00/agentmemory -yCommands are copied from the project's README. Read it on GitHub for the full setup.
More in Memory, RAG & data
vectorize-io/hindsight
Memory server that lets AI agents store, search and learn from past interactions