This is an early release preview. You may encounter bugs.
Agentmemory logo
Unclaimed

Tool coding memory

Agentmemory

#1 Persistent memory for AI coding agents based on real-world benchmarks

B 77/100 GitHub score ? This grade is derived from GitHub signals, not user votes. Open for the full breakdown.
Discussion

01 / Summary

About Agentmemory.

agentmemory is a local-first memory server for coding agents. It captures what an agent did during a session through the agent's own hooks, keeps the record on your machine, and hands the relevant context back at the start of the next session. It works with Claude Code, GitHub Copilot CLI, Cursor, Gemini CLI, Codex CLI, Hermes, OpenClaw, Pi, OpenCode, and any MCP client, and runs keyless by default: capture and recall need no account, API key, or cloud service.

When a tool-use hook fires, the observation is deduplicated by hash, passed through a privacy filter that strips secrets and API keys, stored raw, compressed (synthetically by default, or by an LLM when a provider is configured and the option is turned on), embedded when an embedding provider is active, and indexed. At session end the session is summarized, with optional knowledge-graph extraction. At session start the project profile is loaded, a hybrid search runs, and the result is injected into the conversation within a token budget (2,000 tokens by default). Hooks also capture user prompts, file access, tool failures, and sub-agent lifecycle events, and re-inject memory before context compaction.

Memory is consolidated in four tiers: working (raw observations), episodic (compressed session summaries), semantic (extracted facts and patterns), and procedural (workflows and decision patterns). Memories decay on an Ebbinghaus curve, strengthen when accessed, and are evicted when stale, and contradictions are detected and resolved. Retrieval fuses three streams with Reciprocal Rank Fusion: BM25 keyword matching with stemming and synonym expansion (always on), cosine similarity over dense embeddings (when an embedding provider is configured), and knowledge-graph traversal (when entities are detected in the query), diversified to at most three results per session.

Benchmark agentmemory Comparison
LongMemEval-S R@5 (500 questions) 95.2% BM25-only fallback 86.2%
LongMemEval-S R@10 98.6% BM25-only fallback 94.6%
LongMemEval-S MRR 88.2% BM25-only fallback 71.5%
Context tokens at 240 observations ~1,900 22K+ when a 200-line memory file is loaded whole
Tokens per year (estimated) ~170K ~650K for LLM-summarized context

The server exposes the same memory over MCP and REST, so several agents can share it: 54 MCP tools (trimmable to a core set of 8), 6 resources, 3 prompts, and 17 skills in the Claude Code SKILL.md format. Multi-agent setups tag every write with an agent role and run in shared or isolated mode, with team namespaces, action leases, signals, and routines for coordination. Every observation carries an immutable origin channel, any memory can be traced back to its source observations, and memory state can be versioned, rolled back, and diffed as git snapshots. A real-time viewer streams new memories and audit entries and replays any recorded session as a timeline.

The runtime is built on the iii engine, which supplies HTTP triggers, key-value state with an in-memory vector index, WebSocket streams, and worker supervision in place of a separate web framework, database, and process manager. Optional LLM-backed compression is auto-detected from the configured provider: Anthropic, MiniMax (Anthropic-compatible), Gemini, OpenRouter, OpenAI, or any OpenAI-compatible local server such as Ollama, LM Studio, vLLM, or llama.cpp. Embeddings default to a local all-MiniLM-L6-v2 model once opted in, with remote providers as an option. Measured workload data puts DeepSeek V4 and Qwen3-Coder within rounding error of Claude Sonnet on the compression task at 10–70 times lower cost.

  • Automatic capture: hooks record prompts, tool calls and results, file access, failures, and sub-agent lifecycle, deduplicated and privacy-filtered before storage
  • Hybrid retrieval: BM25 with stemming and synonyms, vector similarity when an embedding provider is active, and knowledge-graph traversal, fused with Reciprocal Rank Fusion and diversified per session
  • Four-tier consolidation: working, episodic, semantic, and procedural memory with decay, reinforcement on access, auto-eviction, and contradiction detection
  • Session-start injection: loads the project profile, runs a hybrid search, and injects the result within a configurable token budget, re-injecting before context compaction
  • MCP and REST access: 54 MCP tools (or a core set of 8), 6 resources, 3 prompts, and 17 skills, plus a REST API, so any MCP client or several agents can share one memory
  • Multi-agent scoping: per-role tagging with shared or isolated recall, team namespaces, exclusive action leases, signals, and routines
  • Provenance and history: immutable origin channels on every observation, citation back to source observations, versioning with supersession, and git snapshots to version, roll back, and diff memory state
  • Real-time viewer and replay: a local viewer streams memories, observations, audit entries, graph changes, and health, and replays recorded sessions as a timeline
  • Keyless by default: capture and BM25 recall need no provider, with optional local embeddings and optional LLM-written compression through Anthropic, MiniMax, Gemini, OpenRouter, OpenAI, or any OpenAI-compatible local server
  • Agent coverage: Claude Code, GitHub Copilot CLI, Cursor, Gemini CLI, Codex CLI, Hermes, OpenClaw, Pi, OpenCode, and any MCP client, with a bi-directional bridge to Claude Code's memory file
  • Benchmarks and eval harness: LongMemEval-S R@5 of 95.2% with a reproducible adapter-pluggable harness that scores grep, vector, and agentmemory side by side

02 / Discussion CREDIBILITY-GATED

Discussion

Reading is open to everyone. Posting and voting need a verified identity or a GitHub grade of B or higher.

  • No discussions yet.

04 / Build

Build with Agentmemory.

Browse the catalog for frameworks, tools, and harnesses, each scored on real GitHub credibility.

Get Agentmemory →

Browse the catalog