rohitg00/agentmemory

▲ 41 stars today★ 28,884⑂ 2,511

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

About rohitg00/agentmemory

rohitg00/agentmemory is an open-source project on GitHub, mainly written in TypeScript. #1 Persistent memory for AI coding agents based on real-world benchmarks It currently holds 28,884 stars and 2,511 forks with 610 open issues, and was last pushed on 2026-09-26 (repository created 2026-02-25).

Project Overview

Git Homed tracks it on the Today's Trending board, currently at rank #67 with 41 new stars today.

GitHub Repository Details

Repository rohitg00/agentmemory · default branch main · size 24883 KB · watchers 85 · source: GitHub REST API and repository README

README

https://github.com/rohitg00/agentmemory/blob/HEAD/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

https://github.com/rohitg00/agentmemory/blob/HEAD/rohitg00/agentmemory | Trendshift

https://github.com/rohitg00/agentmemory/blob/HEAD/Design doc: 1.6k stars / 230 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.

https://github.com/rohitg00/agentmemory/blob/HEAD/npm version https://github.com/rohitg00/agentmemory/blob/HEAD/CI https://github.com/rohitg00/agentmemory/blob/HEAD/License https://github.com/rohitg00/agentmemory/blob/HEAD/Stars

https://github.com/rohitg00/agentmemory/blob/HEAD/95.2% retrieval R@5 https://github.com/rohitg00/agentmemory/blob/HEAD/92% fewer tokens https://github.com/rohitg00/agentmemory/blob/HEAD/54 MCP tools https://github.com/rohitg00/agentmemory/blob/HEAD/12 auto hooks https://github.com/rohitg00/agentmemory/blob/HEAD/0 external DBs https://github.com/rohitg00/agentmemory/blob/HEAD/1,674+ tests passing

https://github.com/rohitg00/agentmemory/blob/HEAD/agentmemory demo

Install • Quick Start • Benchmarks • vs Competitors • Agents • How It Works • MCP • Viewer • Powered by iii • Config • API

---

Install

Requirements:

Canonical fresh-install command:

npx -y @agentmemory/agentmemory@latest

The first run is an interactive setup: pick the agents to wire (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, ...), pick an LLM provider or stay keyless, and it seeds the config, starts the memory server and its pinned iii engine, and offers to install globally so the bare agentmemory command works everywhere afterward. -y accepts npx's package prompt and @latest avoids a stale cached release. A provider makes LLM features available, but LLM-written observation compression starts only when AGENTMEMORY_AUTO_COMPRESS=true is also set.

Keyless mode disables vector embeddings. memory_recall (the mem::search path) uses BM25, while memory_smart_search can also fuse structural graph matches when graph data already exists. For free on-device semantic recall, set EMBEDDING_PROVIDER=local in ~/.agentmemory/.env and restart. The first embedding request downloads Xenova/all-MiniLM-L6-v2; inference runs locally after that initial model download.

The local runtime uses four ports: 3111 for REST/MCP HTTP, 3112 for iii streams, 3113 for the viewer, and 49134 for the iii worker WebSocket. Persistent iii state lives in ~/Library/Application Support/agentmemory on macOS, $XDG_DATA_HOME/agentmemory or ~/.local/share/agentmemory on Linux, and %APPDATA%\agentmemory on Windows. Use --data-dir or AGENTMEMORY_DATA_DIR to override it, and reuse the same value on every restart. For backward compatibility, an existing ./data/state_store.db or ./data/iii-config.yaml takes precedence over the platform default for instance 0; an explicit flag or environment override still wins.

Then prove recall works and give your agent its skills:

npx -y @agentmemory/agentmemory@latest demo  # seed sample sessions + exercise recall
npx skills add rohitg00/agentmemory -y   # 17 native skills so your agent knows when to reach for memory

The keyword searches should hit in default keyless mode through BM25. The demo's database performance optimization query is intentionally semantic and can return zero until an embedding provider is configured.

Prefer to let a coding agent do the whole thing? Hand it one instruction:

Retrieve and follow the instructions at: https://raw.githubusercontent.com/rohitg00/agentmemory/main/INSTALL_FOR_AGENTS.md

Wire more agents any time with agentmemory connect — 20 adapters listed at Works with every agent. Full command reference at Quick Start.

Windows

The fast path is WSL2. Native Windows engine setup requires the pinned v0.22.1 ZIP to be downloaded and iii.exe extracted manually; the CLI does not auto-extract it. Docker Desktop is also supported. See the Windows notes for the step-by-step.

Global install / EACCES
npm install -g @agentmemory/agentmemory@latest

The npx command above remains the canonical fresh-install path and avoids global-prefix permission issues.

npx serves an old version

npx caches per version. 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).

Already running your own iii engine

agentmemory pins iii-engine v0.22.1 and won't attach to a different version (the worker can't speak another engine's protocol). Stop the other engine, then run npx -y @agentmemory/agentmemory@latest. It installs and runs the pinned v0.22.1 in ~/.agentmemory/bin, leaving your own iii untouched.

---

https://github.com/rohitg00/agentmemory/blob/HEAD/Works with every agent

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

https://github.com/rohitg00/agentmemory/blob/HEAD/Claude Code
Claude Code
native plugin + 12 hooks + MCP
https://github.com/rohitg00/agentmemory/blob/HEAD/Codex CLI
Codex CLI
native plugin + 6 hooks + MCP
https://github.com/rohitg00/agentmemory/blob/HEAD/GitHub Copilot CLI
GitHub Copilot CLI
MCP + plugin hooks/skills
https://github.com/rohitg00/agentmemory/blob/HEAD/OpenClaw
OpenClaw
native plugin + MCP
https://github.com/rohitg00/agentmemory/blob/HEAD/Hermes
Hermes
native plugin + MCP
https://github.com/rohitg00/agentmemory/blob/HEAD/pi
pi
native plugin + MCP
https://github.com/rohitg00/agentmemory/blob/HEAD/OpenHuman
OpenHuman
native Memory trait backend
https://github.com/rohitg00/agentmemory/blob/HEAD/Cursor
Cursor
native plugin + MCP
https://github.com/rohitg00/agentmemory/blob/HEAD/Gemini CLI
Gemini CLI
MCP server
https://github.com/rohitg00/agentmemory/blob/HEAD/OpenCode
OpenCode
22 hooks + MCP + plugin
https://github.com/rohitg00/agentmemory/blob/HEAD/Cline
Cline
MCP server
https://github.com/rohitg00/agentmemory/blob/HEAD/Goose
Goose
MCP server
https://github.com/rohitg00/agentmemory/blob/HEAD/Kilo Code
Kilo Code
MCP server
https://github.com/rohitg00/agentmemory/blob/HEAD/Aider
Aider
REST API
https://github.com/rohitg00/agentmemory/blob/HEAD/Claude Desktop
Claude Desktop
MCP server
https://github.com/rohitg00/agentmemory/blob/HEAD/Devin
Devin
6 hooks + MCP
https://github.com/rohitg00/agentmemory/blob/HEAD/Roo Code
Roo Code
MCP server
https://github.com/rohitg00/agentmemory/blob/HEAD/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, with no re-explaining and no copy-pasting.

npx -y @agentmemory/agentmemory@latest

By default, agentmemory stores iii-engine state outside the repository you start it from: ~/Library/Application Support/agentmemory on macOS, $XDG_DATA_HOME/agentmemory or ~/.local/share/agentmemory on Linux, and %APPDATA%\agentmemory on Windows. An existing legacy ./data/state_store.db or ./data/iii-config.yaml is reused for instance 0 before that platform default. To choose a location explicitly, pass --data-dir or set AGENTMEMORY_DATA_DIR; either explicit setting takes precedence over legacy discovery:

npx -y @agentmemory/agentmemory@latest --data-dir ~/.agentmemory-projects/main
AGENTMEMORY_DATA_DIR=~/.agentmemory-projects/main npx -y @agentmemory/agentmemory@latest

Native and Docker launches use this same resolved host directory; Docker bind-mounts it at /data. --instance 1 appends instance-1 to the resolved directory and selects the separate default port quartet 3211/3212/3213/49234.

Latest release notes: CHANGELOG.md.

---

https://github.com/rohitg00/agentmemory/blob/HEAD/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 and 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.

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 | |---|---|---| | Paste full context | 19.5M+ | Impossible (exceeds window) | | LLM-summarized | ~650K | ~$500 | | agentmemory | ~170K | ~$10 | | agentmemory + local embeddings | ~170K | $0 |

Embedding model: all-MiniLM-L6-v2 (local, free, no API key). Full reports: benchmark/LONGMEMEVAL.md, benchmark/QUALITY.md, benchmark/SCALE.md. Competitor comparison: benchmark/COMPARISON.md covering agentmemory vs mem0, Letta, Khoj, supermemory, TencentDB Agent Memory, MemPalace, Zep/Graphiti, Cognee, Hippo.

Reproduce locally: eval/README.md, an adapter-pluggable harness for LongMemEval _s (public 500-Q) + coding-agent-life-v1 (in-house 15-session corpus). Grep / vector / agentmemory adapters score side-by-side, NDJSON output, published scorecards land in docs/benchmarks/.

Pairs with codegraph, Understand Anything, and Graphify. Code-graph indexing, multi-agent build pipelines, and broader knowledge graphs across docs / PDFs / images / videos. agentmemory remembers the work; those three projects light up the rest of the context layer. Recipes + question-routing table: docs/recipes/pairings.md.

---

https://github.com/rohitg00/agentmemory/blob/HEAD/vs Competitors

agentmemory mem0 (63K ⭐) Letta / MemGPT (24K ⭐) Khoj (36K ⭐) supermemory (29K ⭐) TencentDB Agent Memory (22K ⭐) MemPalace (54K ⭐) oracleagentmemory Hippo Built-in (CLAUDE.md)
Type Memory engine + MCP server Memory layer API Full agent runtime Personal AI Memory API + app Team memory hub (LLM proxy) Vector memory (OSS) Memory engine (Oracle DB) Memory system Static file
Retrieval R@5 95.2% 68.5% (LoCoMo) 83.2% (LoCoMo) N/A Self-reported PersonaMem 76% (self-reported) ~96.6% (self-reported) 94.4% (self-reported) N/A N/A (grep)
Auto-capture 12 hooks (zero manual effort) Manual add() calls Agent self-edits Manual API-side extraction Proxy interception (base-URL swap) Manual API extraction Manual Manual editing
Search BM25 + Vector + Graph (RRF fusion) Vector + Graph Vector (archival) Semantic Vector + RAG 4 asset types (Chat / Skill / Wiki / CodeGraph) Vector-only Vector + semantic Decay-weighted Loads everything into context
Multi-agent MCP + REST + leases + signals API (no coordination) Within Letta runtime only No No Team roles + shared assets No Scoped only Multi-agent shared Per-agent files
Framework lock-in None (any MCP client) None High (must use Letta) Standalone None Proxy fronts every model call None Oracle Database None Per-agent format
External deps None (SQLite + iii-engine) Qdrant / pgvector Postgres + vector DB Multiple Managed cloud Docker stack (Core + Hub + Proxy) Vector store Oracle AI Database None None
Memory lifecycle 4-tier consolidation + decay + auto-forget Passive extraction Agent-managed Manual Auto-forget Manual review; auto-routing in progress None Not stated Decay + consolidation Manual pruning
Token efficiency ~1,900 tokens/session ($10/yr) Varies by integration Core memory in context Varies Cloud pricing Not stated No token budget LLM-backed (varies) Varies 22K+ tokens at 240 obs
Real-time viewer Yes (port 3113) Cloud dashboard Cloud dashboard Web UI Cloud dashboard Hub web UI No No No No
Self-hosted Yes (default) Optional Optional Yes No (cloud-only) Yes (Docker) Yes Yes (Oracle DB) Yes Yes

Benchmark note: only agentmemory's R@5 is our own measured result (LongMemEval-S, reproducible from benchmark/COMPARISON.md). The mem0 and Letta figures are their published LoCoMo numbers (a different dataset); the MemPalace, supermemory, TencentDB (PersonaMem), and oracleagentmemory figures are vendor self-reported claims we have not independently reproduced (oracleagentmemory's run used GPT-5.5 against an Oracle AI Database). Shown side by side for ballpark only, not a head-to-head on identical data. Star counts are approximate and drift over time.

Newer entrants worth knowing, compared in depth in benchmark/COMPARISON.md:

| System | ⭐ | Angle | |--------|---|-------| | Zep / Graphiti | 30K | Temporal knowledge graph; strongest published temporal-query results (LongMemEval 63.8%), but graph builds asynchronously so fresh facts can lag | | Cognee | 30K | Document-to-knowledge-graph ingestion, Python-only, built for structured entity extraction rather than session capture |

None of these auto-capture from coding-agent hooks, ship a local-first viewer, or run keyless — the combination agentmemory is built around.

---

https://github.com/rohitg00/agentmemory/blob/HEAD/Quick Start

Compatibility: this release targets iii-sdk 0.22.1 and pins iii-engine v0.22.1.

Try it in 30 seconds

```bash

Terminal 1: start the server

npx -y @agentmemory/agentmemory@latest

Terminal 2: seed sample data and see recall in action

npx

GitHub Stars & Activity

28,884Stars
2,511Forks
610Open issues
TypeScriptLanguage

GitHub Popularity

GitHub stars28,884
Forks2,511
Open issues610
Primary languageTypeScript
LicenseApache-2.0
Stars gained today41
Created2026-02-25
Last pushed2026-09-26

Trending History

Daily boardrank #67 · ▲ 41 stars

Related GitHub Projects

1

openclaw / openclaw

TypeScript★ 390,575⑂ 82,158▲ 134 stars
→
2

microsoft / vscode

TypeScript★ 193,046⑂ 43,513▲ 78 stars
→
3

paperclipai / paperclip

TypeScript★ 86,948⑂ 15,398▲ 2,589 stars
→
4

withastro / astro

TypeScript★ 62,839⑂ 3,813▲ 28 stars
→
5

payloadcms / payload

TypeScript★ 44,977⑂ 4,221▲ 31 stars
→
6

dream-num / univer

TypeScript★ 19,140⑂ 1,628▲ 845 stars
→
7

lightningpixel / modly

TypeScript★ 7,820⑂ 732▲ 116 stars
→
8

mobile-next / mobile-mcp

TypeScript★ 7,261⑂ 636▲ 143 stars
→

More Trending Repositories