rohitg00/agentmemory
⭐ 3,810 · TypeScript · GitHub Repo
#1 Persistent memory for AI coding agents based on real-world benchmarks
agentmemory agents ai claude claudecode codex copilot cursor
1-Sentence Summary
Persistent, searchable memory for 15+ AI coding agents with 95% retrieval accuracy and zero external databases.
🔥 Key Capabilities & USP
Universal Agent Memory: Eliminates the pain of re-explaining architecture, bugs, or preferences across 15+ different AI coding agents (Claude Code, Cursor, Gemini CLI, Codex CLI, OpenCode, Cline, Goose, Aider, and any MCP/REST client). All agents share the same memory server, creating a unified context that persists across sessions and tools.
95.2% Retrieval Accuracy: Achieves 95.2% recall@5 on the LongMemEval-S benchmark using hybrid search that combines BM25 fallback with semantic embeddings. This means your agent finds the right memory when it needs it, not just similar-sounding text.
Zero External Database Dependencies: Runs entirely in-process with local embeddings support for zero-cost operation. No need to spin up PostgreSQL, Redis, or vector databases—just
npx @agentmemory/agentmemoryand you're running.51 MCP Tools & 12 Auto Hooks: Comprehensive tooling for memory management with automatic hooks that silently capture agent activity. The hooks system lets you instrument any agent workflow without manual memory calls.
Token & Cost Efficiency: Uses 92% fewer tokens than full context pasting (~170K tokens/year vs 19.5M+) and costs ~$10/year compared to $500+ for alternative solutions. This is the #1 persistent memory solution based on real-world benchmarks, not just marketing claims.

Technical Architecture
| Component | Description |
|---|---|
| Core Engine | Built on the iii engine with hybrid search (BM25 + semantic embeddings) |
| Embeddings | Supports local embeddings for cost-free operation; remote embeddings optional |
| API Surface | 104 REST API endpoints + MCP server for agent integration |
| Memory Store | In-process storage with confidence scoring, lifecycle management, and knowledge graphs |
| Hooks System | 12 automatic hooks that silently capture agent activity without manual instrumentation |
| Filesystem Connector | @agentmemory/fs-watcher package for file-change-driven memory updates |
| Viewer & Debugging | Built-in real-time web viewer for inspecting memory state + iii console for debugging |
Quick Start Guide
# Install and start the memory server
npx @agentmemory/agentmemoryThat's it. The server starts with zero configuration, providing an MCP server, REST API, and hooks system. Your AI coding agents can immediately connect and begin sharing persistent memory.
Pros, Cons & Use Cases
Pros
- Works across 15+ agents—unified memory for your entire AI toolchain
- 95.2% recall@5 retrieval accuracy on real-world benchmarks
- Zero external databases—no infrastructure overhead
- Token-efficient—92% fewer tokens than context pasting
- Cost-effective—~$10/year vs $500+ for alternatives
- Open source with 51 MCP tools and 12 auto hooks
Cons
- Requires initial setup—the memory server must be running for agents to connect
- Memory quality depends on agent activity capture—poor instrumentation yields poor recall
- May have overhead for very simple, single-session workflows where persistence isn't needed
Who should NOT use this?
- Single-agent, single-session users who never switch tools or revisit projects
- Developers allergic to any server setup—even a lightweight in-process server
- Projects with trivial context where re-explaining takes seconds, not minutes
Ideal Use Cases
- Multi-agent workflows where Claude Code, Cursor, and Gemini CLI collaborate on the same codebase
- Long-running projects where architecture decisions and bug fixes span weeks or months
- Team environments where multiple developers use different AI assistants but need shared project memory
- CI/CD pipelines where agents need to remember build configurations and test failures across runs
Community & Activity
With 3,810 stars and active development (last updated May 2026), agentmemory has clearly struck a nerve in the AI coding community. The project is rapidly gaining traction as developers realize that context-switching between AI agents is the new productivity bottleneck. The comprehensive feature set—51 MCP tools, 12 auto hooks, 104 REST endpoints—shows a team that's shipping fast and listening to the community. If you're tired of repeating yourself to every AI agent you use, this is the project to watch (and star).