The agentmemory repository provides a persistent memory engine designed for AI coding agents, enabling them to retain and recall information across sessions without the need for repeated explanations or manual context re-entry. Built atop the iii engine, agentmemory serves as a memory server that integrates seamlessly with a wide array of popular AI coding agents, including Claude Code, Codex CLI, Cursor, Gemini CLI, Hermes, OpenClaw, pi, OpenCode, and any client supporting the MCP protocol or REST API. Its core purpose is to solve the problem of limited, ephemeral memory in coding agents, which often leads to redundant explanations, repeated bug discoveries, and stale context files.
Agentmemory operates by automatically capturing agent actions, compressing them into a searchable memory store, and injecting relevant context when a new session begins. This process is entirely automated via hooks and plugins, requiring minimal manual intervention. The system supports 12 auto hooks, 51 MCP tools, and works with any agent capable of MCP or HTTP communication, allowing for shared memory across multiple agents. It is self-hosted by default, requiring no external databases—using only SQLite and the iii engine for storage and retrieval.
The repository emphasizes high retrieval accuracy and efficiency. According to benchmarks (LongMemEval-S, ICLR 2025), agentmemory achieves a retrieval rate (R@5) of 95.2%, outperforming competitors like mem0 and Letta/MemGPT. Its hybrid search approach combines BM25 keyword search, vector embeddings, and knowledge graphs, using RRF fusion to maximize recall. This enables semantic search capabilities, allowing agents to find relevant information even when queries are phrased differently from the original context. The memory engine is highly token-efficient, reducing annual token usage to approximately 170,000 tokens (~$10/year), a significant improvement over traditional methods that require millions of tokens and incur higher costs.
Agentmemory features a real-time viewer accessible via a web interface (port 3113), where users can observe memory formation, replay sessions, and import transcripts from other agents (such as Claude Code JSONL files). The replay functionality allows users to scrub through session timelines, viewing prompts, tool calls, and responses as discrete events with playback controls. Maintenance and upgrades are streamlined through CLI commands, and the system is compatible with the stable iii-sdk and iii-engine versions.
Compared to other memory solutions, agentmemory stands out for its automated capture, multi-agent support, hybrid search, and lack of framework lock-in. It requires no external vector databases or cloud dashboards, making it suitable for privacy-conscious users and those seeking self-hosted solutions. The memory lifecycle is managed through four-tier consolidation, decay, and auto-forget mechanisms, ensuring that memory remains relevant and efficient over time.
Installation is straightforward via npm or npx, and agent-specific wiring is documented for each supported agent. The repository includes extensive tests (950+ passing), detailed benchmarks, and comprehensive documentation. Overall, agentmemory addresses the critical need for persistent, efficient, and context-aware memory in AI coding agents, enhancing their usability and effectiveness in real-world coding workflows.