
Bettermemory
io.github.0Mattias由 GitHub 账号 0Mattias 发布v8.0.0更新于 Oct 24, 2026
Memory for coding agents, checked against the filesystem and git before it is believed.
概览
面向编码代理的本地记忆服务器,在模型采信之前会用文件系统和 git 校验已存事实。
- 可以做什么
- 把记忆以纯 markdown 文件保存,并附带一个派生的 SQLite 索引;记忆通过显式工具调用获取,而不是自动注入。每条检索结果都带有陈旧度判定,包括日历年龄、所引用路径是否仍存在、上次确认后落地的提交数;诸如 path、path::symbol 或 path::NAME=literal 的声明会对照工作区重新检查。检索采用确定性词法排序(关键词加 BM25),不使用嵌入模型;写入闸门会拦截临时状态、形似密钥的令牌和近似重复内容。整理与健康工具会显示漂移、变冷或相互矛盾的记录。
- 适用场景
- 适合需要让编码代理跨会话保留知识、又不愿引用过时事实的场景,尤其是文件和符号经常变动的代码仓库。也适合希望记忆文件可 grep、可经 git 同步且无需云账号的团队,以及偏好确定性检索而非嵌入检索的用户。
- 运行要求
- 以 Python 包(pypi bettermemory)通过 stdio 在本地运行,可用 uv tool install、pipx 或 pip 安装到虚拟环境,也可用 uvx 免安装试用。需要 Python 3.11–3.14 和支持的 MCP 客户端;配置使用 bettermemory init 并指定客户端名称,bettermemory doctor 可验证接线。未声明账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Bettermemory,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[PyPI] [CI] [Python 3.11-3.14] [MIT] [bettermemory MCP server]
An MCP memory server for coding agents. Stored facts get checked against the filesystem and git before the model relies on them, so a memory that has rotted is flagged instead of quoted back at you.
Install
Claude Code — two slash commands, zero config:
Anything else that speaks MCP:
Restart the client. bettermemory doctor exits 0 when it's wired
correctly and prints a one-line fix for anything that isn't.
Try it without installing: uvx bettermemory try writes a memory
citing a file, deletes the file, and shows the next search flagging it.
Offline, throwaway store.
What it does
- Checks memory before believing it. Every hit carries a staleness
verdict: calendar age, whether the paths it cites still exist, the
commits landed since it was last confirmed, and how the record
entered the store (written here, pulled, or placed by hand).
Declared claims
(
path,path::symbol,path::NAME=literal) are re-checked against the working tree; a claim that stops being true blocks the stamp instead of riding along. - Retrieval is deliberate. Memory is a tool call, not an injection. Write gates bounce transient state, secret-shaped tokens and near-duplicates; claims about you are labelled as inferences, so they stay distinguishable and correctable.
- The code is the model. Search is deterministic lexical ranking — keyword + BM25, fused — over your own vocabulary. No embedding models, no downloads, nothing to warm up, same answer every time.
- Plain files. One markdown file per memory. Greppable,
git-syncable, no cloud, no account. The SQLite index beside the
files is a derived cache you can delete;
bettermemory reindexrebuilds it. - Rot gets acted on, not accumulated. Episodes journal per-session run-state without polluting durable search; health telemetry and curation tools surface what drifted, what went cold, and what contradicts what.
- Receipts, not adjectives. The claims above are measured by
preregistered benchmarks whose frozen result artifacts — misses
included — live in bench/ (
results/*.json, each carrying the declared terms it was scored under), andbettermemory evalscores whether memory actually helped against your own log (ours is published).
For agents
You were likely handed this link with "set this up." On Claude Code, the two plugin commands above are the whole install — skip to step 3. Everywhere else, steps are idempotent and safe to re-run:
uv tool install bettermemory— orpipx install bettermemory, orpip install bettermemoryinto a venv. Python 3.11–3.14.bettermemory init --client claude-code— likewiseclaude-desktop,cursor,cline,hermes. For any other MCP host, plainbettermemory initprints the canonicalmcpServersJSON snippet plus known config locations. (Continue needs a hand-written YAML entry — see docs/clients.md.)bettermemory doctor— exit 0 means correctly wired; every failed check prints a one-line fix.- Have the user restart the client so the server loads, then confirm by asking the model "what memory tools do you have?"
Your operating contract — tool signatures, retrieval discipline,
write gates — is docs/api.md; the server's
instructions block delivers the core policy automatically. For the
long-form policy in your system prompt: bettermemory init --with-addendum. Migrating from Claude Code's built-in auto-memory:
bettermemory ingest imports those files once.
Everything else
The rest is written down: mechanics, storage format, the full tool surface, CLI, configuration and limitations in internals; per-client setup in clients and installation; eval methodology in eval; postmortems in incidents; release history in CHANGELOG; dev setup and the compatibility contract in CONTRIBUTING.
MIT licensed — see LICENSE.
来源:README.md,提交 129b024
工具
0版本历史
5- v8.0.0最新Sep 24, 2026
- v7.19.2Sep 21, 2026
- v7.19.1Sep 17, 2026
- v7.19.0Sep 17, 2026
- v7.17.2Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分