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.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

給編碼代理使用的本機記憶伺服器,在模型採信之前會用檔案系統與 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 金鑰或環境變數。
安裝前請注意
記憶以本機 markdown 檔案與 SQLite 快取形式保存,寫入內容會留在磁碟上,並可能透過 git 同步。寫入閘門據稱會攔下形似密鑰的權杖,但仍應避免在記憶中存放憑證或隱私資料。伺服器會讀取檔案系統與 git 歷史來驗證宣告;README 說明關於使用者的宣告會被標記為推論而非已核實事實。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Bettermemory,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[bettermemory]

[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:

/plugin marketplace add 0Mattias/bettermemory/plugin install bettermemory@bettermemory

Anything else that speaks MCP:

sh
uv tool install bettermemorybettermemory init --client claude-desktop   # or cursor / cline / claude-code / hermes

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 reindex rebuilds 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), and bettermemory eval scores 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:

  1. uv tool install bettermemory — or pipx install bettermemory, or pip install bettermemory into a venv. Python 3.11–3.14.
  2. bettermemory init --client claude-code — likewise claude-desktop, cursor, cline, hermes. For any other MCP host, plain bettermemory init prints the canonical mcpServers JSON snippet plus known config locations. (Continue needs a hand-written YAML entry — see docs/clients.md.)
  3. bettermemory doctor — exit 0 means correctly wired; every failed check prints a one-line fix.
  4. 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
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

5
  1. v8.0.0最新Sep 24, 2026
  2. v7.19.2Sep 21, 2026
  3. v7.19.1Sep 17, 2026
  4. v7.19.0Sep 17, 2026
  5. v7.17.2Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分