{
  "markdown": "# remem-mcp\n\n[![npm version](https://img.shields.io/npm/v/remem-mcp.svg)](https://www.npmjs.com/package/remem-mcp)\n[![GitHub stars](https://img.shields.io/github/stars/tinhien11/remem-mcp.svg)](https://github.com/tinhien11/remem-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Benchmark](https://img.shields.io/badge/AMB-100%2F100%2F100-brightgreen)](https://github.com/tinhien11/remem-mcp)\n\n> Your coding agent stops repeating the same mistakes.\n\nLocal-first memory that survives context compaction. Learns from every error, injects fixes before the next attempt, and syncs to your git repo so your whole team shares it.\n\n**No API key. No cloud. No database server. Just a SQLite file.**\n\n---\n\n## Install\n\n```bash\nnpx remem-mcp setup\n```\n\nAuto-detects Claude Code, Cursor, Devin, Codex. Registers MCP server + hooks. Restart your agent.\n\nThat's it. Use your agent normally — memory works automatically.\n\n```bash\nnpx remem-mcp status    # verify: hooks ✓, DB ✓, CodeGraph ✓\n```\n\n---\n\n## What happens automatically\n\n| When | What |\n|---|---|\n| Session start | Past errors, decisions, and persona injected into agent context |\n| Each prompt | Matching memory injected (you'll see `[remem-mcp]` at the top) |\n| Tool calls | Verbose output offloaded to refs, Mermaid canvas injected (92% token cut) |\n| Session end | Worker auto-extracts facts, consolidates summaries, updates persona |\n\nYou don't run any commands. The agent calls `recall()` before answering and `capture()` after work — the skill tells it to.\n\n---\n\n## How it works\n\n```\nAI Agent (Claude Code / Devin / Cursor / Codex)\n    │\n    ├── MCP tools ──▶ recall, capture, codegraph_*, wiki_*, feedback\n    │\n    └── Hooks ──▶ SessionStart, UserPromptSubmit, PreToolUse,\n                  PostToolUse, Stop, PostCompact\n                        │\n                        ▼\n              SQLite (memory.db)\n\n  L0 captures → L1 atoms → L2 scenarios → L3 persona\n  (raw)        (facts)      (summaries)    (preferences)\n\n  CodeGraph: symbols + calls + imports (tree-sitter, 9 languages)\n  Memory links: Hebbian co-retrieval (frequently co-retrieved = stronger)\n```\n\n**No LLM API key needed** — rule-based extraction + keyword grouping.\n\n---\n\n## CodeGraph\n\nStructural code indexing via tree-sitter. The agent uses `codegraph_search` instead of grep to find symbols.\n\n```bash\nnpx remem-mcp index --path src              # index a directory\nnpx remem-mcp search-code --query \"parseTar\"  # find symbols\nnpx remem-mcp callers <id>                  # who calls this?\nnpx remem-mcp impact <id>                   # blast radius\n```\n\n9 languages: TS/JS/Python/Go/Rust/Java/C/C++/C#. 6-strategy call resolution (import-map → same-module → unique-name → suffix → fuzzy). Stdlib calls filtered out.\n\n| Repo | Files | Symbols | Calls | Time |\n|---|---|---|---|---|\n| remem-mcp | 79 | 301 | 6,456 | 3s |\n| AZR Go | 455 | 3,417 | 41,603 | 111s |\n| Orca TS | 3,000 | 7,632 | 78,981 | 705s |\n\n---\n\n## Why it's different\n\n| | remem-mcp | Mem0 | Claude MEMORY.md | Mneme |\n|---|---|---|---|---|\n| **Survives compaction** | Yes | Yes — cloud | No — 200-line cap | Yes |\n| **Learns from errors** | Yes — auto | No | No | No |\n| **Search** | Hybrid BM25 + vector + entities | Vector only | No | Vector + graph |\n| **Memory links** | Hebbian co-retrieval | No | No | Graph |\n| **Decay/forget** | Yes | No | No | No |\n| **CodeGraph** | Yes — 6-strategy call resolution | No | No | No |\n| **Token offload** | Yes — Mermaid canvas | No | No | No |\n| **Setup** | 1 command | API key + cloud | Built-in | Build from source |\n| **Cost** | Free | $19–249/mo | Free | Free |\n\n---\n\n## Per-agent install\n\n<details>\n<summary>Claude Code</summary>\n\n```bash\nclaude mcp add remem-mcp --scope user -- npx -y remem-mcp\nnpx remem-mcp install-hooks\n```\n</details>\n\n<details>\n<summary>Cursor</summary>\n\n[![Install in Cursor](https://img.shields.io/badge/Cursor-Install-blue)](cursor://anysphere.cursor-deeplink/mcp/install?name=remem-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInJlbWVtLW1jcCJdfQ==)\n\nOr add to `~/.cursor/mcp.json`:\n```json\n{\n  \"mcpServers\": {\n    \"remem-mcp\": { \"command\": \"npx\", \"args\": [\"-y\", \"remem-mcp\"] }\n  }\n}\n```\n</details>\n\n<details>\n<summary>Devin CLI</summary>\n\n```bash\ndevin mcp add remem-mcp --scope user -- npx -y remem-mcp\nnpx remem-mcp install-hooks\n```\n</details>\n\n<details>\n<summary>Codex CLI</summary>\n\nAdd to `~/.codex/config.toml`:\n```toml\n[mcp_servers.remem-mcp]\ncommand = \"npx\"\nargs = [\"-y\", \"remem-mcp\"]\n```\nThen run `npx remem-mcp install-hooks`.\n</details>\n\n---\n\n## Useful commands\n\n```bash\nnpx remem-mcp status           # health + hooks + DB + CodeGraph\nnpx remem-mcp viewer           # web UI at localhost:7331\nnpx remem-mcp errors           # error dashboard\nnpx remem-mcp recent [N]       # recent captures\nnpx remem-mcp help all         # full list of 40+ subcommands\n```\n\n---\n\n## Configuration\n\nAll settings have defaults. Config file is optional: `~/.config/remem-mcp/config.json`.\n\n| Setting | Env var | Default |\n|---|---|---|\n| DB path | `REMEM_DB_PATH` | `~/.local/share/remem-mcp/memory.db` |\n| Cross-project memory | `REMEM_GLOBAL_SESSION_KEY` | _(unset)_ |\n| Unified flow (F1+F2+F3) | `REMEM_FLOW` | _(unset, set to `full`)_ |\n| Suppress hook feedback | `REMEM_QUIET` | _(unset, set to `1`)_ |\n\n**Global memory policy** — set `REMEM_GLOBAL_SESSION_KEY` to *read* cross-project memory automatically. Captures stay project-local unless the user explicitly asks to save globally; then use `session_key: \"global\"`. Do not auto-classify ordinary captures into global.\n\n**Team sharing** — `npx remem-mcp sync-export` writes `.remem-mcp/memory-export.jsonl`. Commit it to git. Team members get the same memory on `git pull`.\n\n**Per-repo capture exclusions** — Drop a `.remem.toml` in any project root:\n```toml\n[capture]\nignore_paths = [\"node_modules\", \"dist\", \".git\", \"*.min.js\"]\n```\n\n---\n\n## Benchmark\n\n| Benchmark | remem-mcp | Mem0 | Without memory |\n|---|---|---|---|\n| **AMB** (L1/L2/L3) | **100/100/100** | — | — |\n| **LoCoMo** (long conversation QA) | **95** | 92.5 | — |\n| **PersonaMem** (personalization) | **100** | — | 48 |\n| **LongMemEval** (ICLR 2025) | **96** | 94.4 | — |\n\n```bash\nbash scripts/bench-all.sh --quick   # AMB only (~2 min)\n```\n\n---\n\n## Architecture\n\nSee [ARCHITECTURE.md](./ARCHITECTURE.md) for full system diagrams, schema, and performance details.\n\n## Credits\n\nCore based on [TencentDB Agent Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory) (MIT, Tencent 2026). CodeGraph call resolution adapted from Codebase-Memory (arXiv:2603.27277). Recall boost adapted from [ai-memory](https://github.com/akitaonrails/ai-memory) by Akita On Rails. Contextual retrieval from [Anthropic](https://www.anthropic.com/news/contextual-retrieval) (2024).\n\n## License\n\nMIT. See [LICENSE](./LICENSE).\n",
  "bytes": 6861,
  "sha": "fd72bf8479657f13ac32f684b3bda33b5caae8d5443b5453f31a27abbcb4b09b",
  "repo_slug": "tinhien11/remem-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_tinhien11_remem_mcp_7fe3c81b/readme"
}