rohitg00/agentmemory
#1 Persistent memory for AI coding agents based on real-world benchmarks
AgentMemory is the top-ranked open-source persistent memory layer for AI coding agents. It gives Claude Code, Codex, Cursor, Copilot, and Gemini CLI a structured memory that persists across sessions -- decisions, patterns, project context -- validated against real-world benchmarks in 2026.
Our Review
By late 2024, AI coding agents had become genuinely capable at writing and editing code -- but each session started from scratch. Claude Code would forget the architectural decisions made in the previous session. Codex had no memory of the debugging patterns that worked on the codebase last week. Cursor didn't know which approaches had been rejected and why. The per-session model context window was large, but it reset to zero every time. Rohit Garg built AgentMemory to close that gap: a persistent, structured memory layer that sits between the agent and the codebase and survives session boundaries.
Key capabilities
- •Cross-session persistence: architectural decisions, debugging patterns, project conventions, and rejected approaches are stored and reloaded on the next session start
- •Multi-agent support: works with Claude Code, Codex, Cursor, Copilot, OpenClaw, Hermes, and Gemini CLI -- memory is agent-agnostic so the same project memory is available regardless of which agent opens it
- •Benchmark-validated: ranked #1 across real-world benchmarks measuring agent task continuity, context retention, and decision recall on complex codebases
- •Structured memory types: separates ephemeral context (current task) from durable knowledge (architecture decisions, coding standards, discovered constraints) so agents don't reload irrelevant session noise
- •Lightweight integration: installs as a skill or package alongside the existing agent setup; no separate server or infrastructure required for most use cases
- •v0.9.19 (released May 2026): latest release with expanded support for multi-repo workspaces and improved context compression for large memory stores
Getting started
Install via the skill command for your agent (e.g. /install agentmemory in Claude Code or via the standard skill mechanism for Codex and Cursor). On first load, AgentMemory initializes a memory store in the project directory. The agent reads from memory at session start and writes back on session end. For manual integration: npm install agentmemory and follow the initialization guide in the README.
Limitation
Memory quality depends on what agents write during sessions -- poorly scoped or verbose memory entries degrade retrieval quality over time. Large memory stores on long-lived projects require periodic pruning or compression; the v0.9.x compression feature addresses this but adds some session-start latency. Cross-agent memory sharing works when agents write to the same store path, but is not automatic -- requires explicit configuration for teams using multiple agents on the same codebase.
Our Verdict
AgentMemory addresses the most obvious structural gap in AI coding agent workflows in 2026: per-session amnesia. Every agent that starts without project-specific memory has to rediscover context that was already worked out -- which architectural boundaries are load-bearing, which refactoring approaches failed before, what the team's naming conventions are. Rediscovering that context costs time and produces inconsistency. AgentMemory makes it persistent.
The benchmark-first positioning is credible. Being ranked #1 across real-world task continuity benchmarks for AI coding agents is a specific claim that is either defensible or quickly falsified by the community -- and the project's 12,000+ stars suggest the community has validated it. The multi-agent approach (same memory store works across Claude Code, Codex, Cursor, and Copilot) is the right design choice: teams rarely commit to a single agent, and memory that is agent-locked is memory that gets abandoned when the team's preferred tool changes.
The practical ceiling is memory hygiene. A memory store that accumulates noise -- stale decisions, superseded constraints, verbose session logs -- becomes a liability rather than an asset. The v0.9.x compression feature and pruning utilities help, but teams need to treat memory maintenance as part of the development workflow to keep the store useful. For teams willing to invest that lightweight discipline, AgentMemory closes one of the more concrete productivity gaps in AI-assisted development in 2026.
Frequently Asked Questions
What is AgentMemory and what problem does it solve for AI coding agents?
AgentMemory is an open-source persistent memory layer for AI coding agents like Claude Code, Codex, Cursor, and Copilot. The core problem it solves is per-session amnesia: AI coding agents reset to zero at the start of each session, losing architectural decisions, debugging patterns, and project conventions discovered in prior sessions. AgentMemory provides a structured store that survives session boundaries -- the agent reads it on startup and writes back on exit, giving continuity across sessions in 2026.
Which AI coding agents does AgentMemory support?
AgentMemory is designed to be agent-agnostic. It works with Claude Code, Codex, Cursor, Copilot, OpenClaw, Hermes, and Gemini CLI. Because memory is stored as a structured file in the project directory rather than inside any agent's proprietary format, the same memory store is available regardless of which agent opens the project. Teams that use different agents for different tasks can share the same project memory without configuration changes in 2026.
What does AgentMemory actually store and how is it organized?
AgentMemory separates memory into structured types: architectural decisions (design choices and their rationale), coding standards (project-specific conventions), debugging history (what approaches failed and why), discovered constraints (hidden dependencies, performance limits, integration quirks), and task context (current work in progress). This separation prevents the agent from loading irrelevant session noise on startup -- only durable knowledge that applies across sessions is persisted, while ephemeral task state is kept separate in 2026.
How does AgentMemory compare to storing context in CLAUDE.md or similar files?
CLAUDE.md and similar static context files hold human-authored instructions that don't change during a session. AgentMemory is dynamic: it grows as the agent makes new discoveries, records decisions, and encounters constraints during actual coding work. The two are complementary -- CLAUDE.md holds stable rules (never use em-dashes, always run tests before committing), while AgentMemory holds evolving project knowledge (the auth middleware was refactored in session 47 and the old approach is deprecated, the payments table has a latency issue above 1000 rows). AgentMemory captures what the agent learns during actual work -- beyond what the human manually specifies in 2026.
What does the #1 benchmark ranking mean for AgentMemory?
AgentMemory claims the #1 position across real-world benchmarks measuring agent task continuity, context retention, and decision recall on complex codebases. These benchmarks test whether an agent with memory can resume and complete multi-session tasks more accurately than agents without memory or with alternative memory approaches. The ranking reflects performance on actual coding tasks rather than synthetic metrics -- the project's description explicitly states 'based on real-world benchmarks.' The 12,000+ GitHub stars and active v0.9.x release cadence indicate the ranking has held up to community scrutiny in 2026.
What is agentmemory?
AgentMemory is the top-ranked open-source persistent memory layer for AI coding agents. It gives Claude Code, Codex, Cursor, Copilot, and Gemini CLI a structured memory that persists across sessions -- decisions, patterns, project context -- validated against real-world benchmarks in 2026.
How do I install agentmemory?
Visit the GitHub repository at https://github.com/rohitg00/agentmemory for installation instructions.
What license does agentmemory use?
agentmemory uses the Apache-2.0 license.
What are alternatives to agentmemory?
Explore related tools and alternatives on My AI Guide.
Open source & community-verified
Apache-2.0 licensed: free to use in any project, no strings attached. 15,010 developers have starred this, meaning the community has reviewed and trusted it.
Reviewed by My AI Guide for relevance, quality, and active maintenance before listing.
Topics