MCPcopy
hub / github.com/rohitg00/agentmemory

github.com/rohitg00/agentmemory @v0.9.27 sqlite

repository ↗ · DeepWiki ↗ · release v0.9.27 ↗
1,602 symbols 5,625 edges 373 files 4 documented · 0%
README

agentmemory — Persistent memory for AI coding agents

Your coding agent remembers everything. No more re-explaining. Built on iii engine

Persistent memory for Claude Code, GitHub Copilot CLI, Cursor, Gemini CLI, Codex CLI, Hermes, OpenClaw, pi, OpenCode, and any MCP client.

English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Español | Türkçe | Русский | हिन्दी | Português | Français | Deutsch

rohitg00/agentmemory | Trendshift

  <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=rohitg00/agentmemory&type=date&legend=top-left" />

Design doc: 1.3k stars / 182 forks on the gist

The gist extends Karpathy's LLM Wiki pattern with confidence scoring, lifecycle, knowledge graphs, and hybrid search: agentmemory is the implementation.

npm version npm downloads CI License Stars

95.2% retrieval R@5

92% fewer tokens

53 MCP tools

12 auto hooks

0 external DBs

1,390+ tests passing

agentmemory demo

InstallQuick StartBenchmarksvs CompetitorsAgentsHow It WorksMCPVieweriii ConsolePowered by iiiConfigAPI


Install

npm install -g @agentmemory/agentmemory          # once — bare `agentmemory` on PATH
# If you hit EACCES on macOS/Linux system Node installs, retry with:
# sudo npm install -g @agentmemory/agentmemory
agentmemory                                      # start the memory server on :3111
agentmemory demo                                 # seed sample sessions + prove recall
agentmemory connect claude-code                  # wire MCP into your agent (also: copilot-cli, codex, cursor, gemini-cli, ...)
npx skills add rohitg00/agentmemory -y           # install 8 native skills so your agent knows when to use the tools

Or via npx (no install):

npx @agentmemory/agentmemory

Heads-up — npx caches per version. If a bare npx @agentmemory/agentmemory serves an older release, force the latest with npx -y @agentmemory/agentmemory@latest, or clear the cache once with rm -rf ~/.npm/_npx (macOS/Linux; on Windows delete %LOCALAPPDATA%\npm-cache\_npx). The first npx run from v0.9.16+ prompts to install globally inline so the bare agentmemory command works everywhere afterwards.

Full options at Quick Start below. Agent-specific wiring at Works with every agent.


Works with every agent

agentmemory works with any agent that supports hooks, MCP, or REST API. All agents share the same memory server.

Claude Code Claude Code native plugin + 12 hooks + MCP Codex CLI Codex CLI native plugin + 6 hooks + MCP GitHub Copilot CLI GitHub Copilot CLI MCP + plugin hooks/skills OpenClaw OpenClaw native plugin + MCP Hermes Hermes native plugin + MCP pi pi native plugin + MCP OpenHuman OpenHuman native Memory trait backend Cursor Cursor MCP server Gemini CLI Gemini CLI MCP server
OpenCode OpenCode 22 hooks + MCP + plugin Cline Cline MCP server Goose Goose MCP server Kilo Code Kilo Code MCP server Aider Aider REST API Claude Desktop Claude Desktop MCP server Windsurf Windsurf MCP server Roo Code Roo Code MCP server
Warp Warp connect + MCP + skills

Works with any agent that speaks MCP or HTTP. One server, memories shared across all of them.


You explain the same architecture every session. You re-discover the same bugs. You re-teach the same preferences. Built-in memory (CLAUDE.md, .cursorrules) caps out at 200 lines and goes stale. agentmemory fixes this. It silently captures what your agent does, compresses it into searchable memory, and injects the right context when the next session starts. One command. Works across agents.

What changes: Session 1 you set up JWT auth. Session 2 you ask for rate limiting. The agent already knows your auth uses jose middleware in src/middleware/auth.ts, your tests cover token validation, and you chose jose over jsonwebtoken for Edge compatibility. No re-explaining. No copy-pasting. The agent just knows.

npx @agentmemory/agentmemory

Latest release notes: CHANGELOG.md.


Benchmarks

### Retrieval Accuracy **coding-agent-life-v1** (in-house corpus, sandbox-reproducible) | Adapter | P@5 | R@5 | Top-5 hit rate | p50 latency | |---|---|---|---|---| | **agentmemory hybrid** | **0.240** | **1.000** | **15 / 15** | 14 ms | | grep baseline | 0.227 | 0.967 | 15 / 15 | 0 ms | 100% top-5 hit rate at the **P@5 math ceiling** for this corpus (0.240, see scorecard). Hybrid retrieves every gold session; grep misses 1 of 2 gold on the multi-session temporal query. Lift is **recall + temporal**, not aggregate precision — this benchmark is small + gold-sparse, the larger LongMemEval-S below differentiates better. Full per-type breakdown + correction note: [`docs/benchmarks/2026-05-20-coding-agent-life-v1.md`](docs/benchmarks/2026-05-20-coding-agent-life-v1.md). **LongMemEval-S** (ICLR 2025, 500 questions) | System | R@5 | R@10 | MRR | |---|---|---|---| | **agentmemory** | **95.2%** | **98.6%** | **88.2%** | | BM25-only fallback | 86.2% | 94.6% | 71.5% | ### Token Savings | Approach | Tokens/yr | Cost/yr | |---|---|---| | P

Extension points exported contracts — how you extend this code

MemoryProvider (Interface)
(no doc) [9 implementers]
src/types.ts
RunConfig (Interface)
(no doc)
benchmark/load-100k.ts
ScaleResult (Interface)
(no doc)
benchmark/scale-eval.ts
LabeledQuery (Interface)
(no doc)
benchmark/dataset.ts
QualityMetrics (Interface)
(no doc)
benchmark/quality-eval.ts
QueryResult (Interface)
(no doc)
benchmark/real-embeddings-eval.ts
LongMemEvalEntry (Interface)
(no doc)
benchmark/longmemeval-bench.ts
CliOptions (Interface)
(no doc)
eval/runner/coding-life.ts

Core symbols most depended-on inside this repo

set
called by 926
src/state/kv.ts
get
called by 657
src/state/kv.ts
push
called by 534
src/functions/graph-retrieval.ts
has
called by 270
src/state/search-index.ts
add
called by 175
src/state/vector-index.ts
delete
called by 153
src/state/kv.ts
checkAuth
called by 119
src/triggers/api.ts
recordAudit
called by 110
src/functions/audit.ts

Shape

Function 1,182
Method 204
Interface 152
Class 64

Languages

TypeScript97%
Python3%

Modules by API surface

src/cli.ts82 symbols
src/types.ts77 symbols
integrations/hermes/__init__.py42 symbols
src/config.ts28 symbols
src/state/index-persistence.ts25 symbols
src/functions/search.ts21 symbols
benchmark/quality-eval.ts20 symbols
integrations/filesystem-watcher/watcher.mjs19 symbols
src/viewer/server.ts18 symbols
src/mcp/transport.ts18 symbols
src/functions/graph-retrieval.ts18 symbols
benchmark/load-100k.ts18 symbols

Dependencies from manifests, versioned

@anthropic-ai/claude-agent-sdk0.3.142 · 1×
@anthropic-ai/sdk0.100.1 · 1×
@clack/prompts1.2.0 · 1×
@types/node25.9.1 · 1×
@types/react19.2.16 · 1×
@types/react-dom19.2.3 · 1×
dotenv17.4.2 · 1×
iii-sdk0.11.2 · 1×
next16.2.7 · 1×
react19.2.7 · 1×
react-dom19.2.7 · 1×

For agents

$ claude mcp add agentmemory \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact