remem-mcp — Local-first MCP Memory + CodeGraph + Wiki

io.github.tinhien11由 GitHub 账号 tinhien11 发布v0.5.18更新于 Oct 24, 2026

Local-first memory for AI coding agents. Memory + CodeGraph + Wiki in one SQLite file.

发布方自己的服务:Remember Me – Bible Verse Collections

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

面向 AI 编程助手的本地优先记忆服务器,把记忆、代码结构与 wiki 笔记存放在同一个 SQLite 文件中,并在会话间重新注入。

可以做什么
记忆的召回与捕获:把过往错误、决策和偏好注入助手上下文,在上下文压缩后仍保留,并在会话结束时自动抽取、归纳,支持衰减与遗忘。用 tree-sitter 建立代码图谱,索引九种语言的符号、调用与导入,可搜索符号、查找调用方并评估影响范围,替代 grep。维护 wiki 笔记并记录反馈,配合关键词、向量与实体混合检索以及共现记忆链接。把记忆导出为 JSONL 文件,经 git 供团队共享,并通过本地网页查看器、错误面板和状态命令检查运行情况。
适用场景
适合使用 Claude Code、Cursor、Codex 等编程助手、希望助手跨会话和上下文压缩后仍记得过往错误与项目上下文的开发者,也适合需要结构化代码导航但不想使用云服务或 API 密钥的人。
运行要求
以本地 stdio 进程运行,通过 npx 从 npm 包 remem-mcp 安装;需要 Node.js 和本地 SQLite 文件。无需 API 密钥、云账号或数据库服务器。可选环境变量用于设置数据库路径、跨项目记忆键、统一流程和静默模式,也可添加可选配置文件和按仓库的忽略文件。
安装前请注意
安装会探测受支持的助手并注册 MCP 服务器及钩子,这些钩子在会话开始、每次提示、工具调用后、压缩后和会话结束时运行,因此助手会自动捕获提示内容和失败的命令。捕获的记忆保存在本地,但可导出为 JSONL 文件并提交到 git,从而分享给所有拉取该仓库的人,提交前应先检查导出内容。跨项目记忆需通过会话键显式开启。

安装

在 SourceWeft 中

  1. 打开 控制台中的 remem-mcp — Local-first MCP Memory + CodeGraph + Wiki,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

remem-mcp

[npm version] [GitHub stars] [License: MIT] [Benchmark]

Your coding agent stops repeating the same mistakes.

Local-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.

No API key. No cloud. No database server. Just a SQLite file.


Install

bash
npx remem-mcp setup

Auto-detects ZCode, Claude Code, Cursor, Devin, Codex. Registers MCP server + hooks.


Quick start

  1. Restart your agent (quit and reopen)
  2. Ask: "what do you remember?"
  3. If agent recalls past context = memory working

In your agent, you can say:

  • "index the code in src" → CodeGraph indexes symbols
  • "find who calls function X" → caller analysis
  • "what do you remember?" → recall past context

What happens automatically

WhenWhat
Session startPast errors, decisions, and persona injected into agent context
Each promptMatching memory injected into agent context
Failed commandsAuto-captured as error memories
Context compactionMemory re-injected after compaction
Session endWorker auto-extracts facts, consolidates summaries, updates persona

You don't run any commands. The agent calls recall() before answering and capture() after work — the skill tells it to.


How it works

AI Agent (ZCode / Claude Code / Devin / Cursor / Codex)    │    ├── MCP tools ──▶ recall, capture, codegraph_*, wiki_*, feedback    │    └── Hooks ──▶ SessionStart, UserPromptSubmit,                  PostToolUse, PostCompaction, SessionEnd                        │                        ▼              SQLite (memory.db)
  L0 captures → L1 atoms → L2 scenarios → L3 persona  (raw)        (facts)      (summaries)    (preferences)
  CodeGraph: symbols + calls + imports (tree-sitter, 9 languages)  Memory links: Hebbian co-retrieval (frequently co-retrieved = stronger)

No LLM API key needed — rule-based extraction + keyword grouping.


CodeGraph

Structural code indexing via tree-sitter. The agent uses codegraph_search instead of grep to find symbols.

bash
npx remem-mcp index --path src              # index a directorynpx remem-mcp search-code --query "parseTar"  # find symbolsnpx remem-mcp callers <id>                  # who calls this?npx remem-mcp impact <id>                   # blast radius

9 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.

RepoFilesSymbolsCallsTime
remem-mcp793016,4563s
AZR Go4553,41741,603111s
Orca TS3,0007,63278,981705s

Why it's different

remem-mcpMem0Claude MEMORY.mdMneme
Survives compactionYesYes — cloudNo — 200-line capYes
Learns from errorsYes — autoNoNoNo
SearchHybrid BM25 + vector + entitiesVector onlyNoVector + graph
Memory linksHebbian co-retrievalNoNoGraph
Decay/forgetYesNoNoNo
CodeGraphYes — 6-strategy call resolutionNoNoNo
Token offloadYes — Mermaid canvasNoNoNo
Setup1 commandAPI key + cloudBuilt-inBuild from source
CostFree$19–249/moFreeFree

Useful commands

bash
npx remem-mcp status           # health + hooks + DB + CodeGraphnpx remem-mcp viewer           # web UI at localhost:7331npx remem-mcp errors           # error dashboardnpx remem-mcp recent [N]       # recent capturesnpx remem-mcp help all         # full list of 40+ subcommands

Configuration

All settings have defaults. Config file is optional: ~/.config/remem-mcp/config.json.

SettingEnv varDefault
DB pathREMEM_DB_PATH~/.local/share/remem-mcp/memory.db
Cross-project memoryREMEM_GLOBAL_SESSION_KEY(unset)
Unified flow (F1+F2+F3)REMEM_FLOW(unset, set to full)
Suppress hook feedbackREMEM_QUIET(unset, set to 1)

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.

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.

Per-repo capture exclusions — Drop a .remem.toml in any project root:

toml
[capture]ignore_paths = ["node_modules", "dist", ".git", "*.min.js"]

Benchmark

Benchmarkremem-mcpMem0Without memory
AMB (L1/L2/L3)100/100/100——
LoCoMo (long conversation QA)9592.5—
PersonaMem (personalization)100—48
LongMemEval (ICLR 2025)9694.4—
bash
bash scripts/bench-all.sh --quick   # AMB only (~2 min)

Architecture

See ARCHITECTURE.md for full system diagrams, schema, and performance details.

Credits

Core based on TencentDB Agent Memory (MIT, Tencent 2026). CodeGraph call resolution adapted from Codebase-Memory (arXiv:2603.27277). Recall boost adapted from ai-memory by Akita On Rails. Contextual retrieval from Anthropic (2024).

License

MIT. See LICENSE.

来源:README.md,提交 7590cec

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.5.18最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Remem 集成