AI coding agents lose all context the moment a session ends. Every new conversation with Claude Code, Codex, or Cursor starts from zero — no memory of the codebase decisions made yesterday, the patterns you asked it to follow, or the bugs it helped fix. agentmemory solves this by acting as a persistent memory layer that any MCP-compatible coding agent can read from and write to between sessions, with hooks and a REST API for agents outside the MCP ecosystem.
The system combines vector similarity search with a knowledge graph so memories are retrieved by both semantic meaning and relational structure. The hybrid approach reaches a 95.2% recall rate on the LongMemEval-S benchmark, which measures real-world memory quality in long agent workflows, while reducing context tokens by up to 92% versus naive context injection. A local markdown store keeps everything on disk and readable without running a database, and the 51 MCP tools cover memory creation, smart search, sessioning, summarisation, governance, and decay so agents manage what they remember and forget without developer intervention.
agentmemory integrates directly with the Model Context Protocol, making it compatible with every major coding agent that supports MCP — Claude Code, Codex CLI, Cursor, Windsurf, Cline, OpenCode, Kilo Code, Hermes, OpenClaw, pi, and Gemini CLI — and exposes 12 hooks plus 4 skills for agents that prefer hook-based orchestration. Installation is a single npm command (npm install -g @agentmemory/agentmemory). The project reached over 11,500 GitHub stars in the weeks after launch, driven by a concrete community pain point: developers losing hours to agent context resets on long-running tasks. It ships under Apache-2.0 and is entirely self-hosted; no data leaves the machine.