mnema: decision records for AI coding agents

io.github.felipesauer由 GitHub 帳號 felipesauer 發布v0.1.5更新於 Nov 5, 2026

Signed, append-only decision records for AI coding agents, over MCP. Verify them offline.

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

概覽

AI 產生的概覽

在程式碼儲存庫中保存附簽章、僅可追加的決策紀錄,AI 編碼代理透過 MCP 寫入,並可離線驗證。

可以做什麼
  • 在儲存庫內的共用、本機私有或全域紀錄樹中記錄決策與任務,每項事實簽章後追加。
  • 讓工作通過關卡流轉,記錄附簡報與備註的交接,並查看每個任務由誰處理中。
  • 不需金鑰與網路即可驗證紀錄,並顯示每次判定達到的涵蓋層級。
  • 查詢對某個路徑生效的規則,包括從其他儲存庫繼承並固定於某個提交的規則。
  • 初始化紀錄與代理指示檔,並檢查會改寫紀錄的設定。
適用情境
適合多個代理與人員共同維護同一個儲存庫、希望把改動背後的理由保存成可簽章、可核查的條目,而不是散落在對話中的情況。也適合需要留下可稽核的決策與任務交接軌跡、並讓外部人員不必取得你的金鑰就能驗證的團隊。
執行需求
以本機 stdio 程序執行,從 npm 套件 @mnema/code 安裝,需要 Node 24.15.0 或更高的 24 版本,或 26.0.0 以上;此套件僅支援 ESM。需要一個用來建立紀錄的儲存庫,以及代表本機身分的簽章金鑰。未宣告驗證、環境變數或標頭。
安裝前請注意
紀錄是可察覺竄改而非不可竄改:它不會阻止修改,預設也偵測不到連同最後一個檢查點一起截斷的情況。任何能執行命令列的人都以本機身分寫入,因此它不是存取控制。持有簽章金鑰的人可以改寫後重新簽章。代理在工作過程中會寫入紀錄,init 會把指示寫進 AGENTS.md、CLAUDE.md、GEMINI.md 及各宿主規則檔。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 mnema: decision records for AI coding agents,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

其他 MCP 客戶端

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

README

@mnema/code

[The mnema family: @mnema/code, the command line and the MCP server over one record, with the SDK, a VS Code extension, an agent in CI, the GitHub Action, mnema site and Stacks around it]

[CI] [npm: @mnema/code] [License: Apache-2.0] [Node 24.15.0 or a later 24, or 26.0.0 or later]

Your decisions, handed to your agents' sessions and held at the edits they govern: append-only and signed in the repository, and checkable by anyone.

Tamper-evident, not tamper-proof: what is still in the record has not changed since it was signed, and a stranger can check that without your keys and without installing this.

This is the package you install: the mnema command line and the MCP server of mnema, two surfaces over one record. The agent writes through MCP while it works, and the plugin in plugin/ hands the record to a session as it opens; you read, audit and verify from the terminal. It holds no domain logic of its own: the workflow rules and the proof live in @mnema/core and @mnema/chain.

What it gives you

  • A record of decisions in the repository that agents and people write to, each fact signed and appended, in a committed tree the team shares, a private one for this machine and a global one.
  • A command line to record, read, move work through its gates and verify, and an MCP server over stdio for the agent to do the same: both ask the same gate. At a terminal, mnema decision review goes through the decisions awaiting a judgement one by one (accept, reject, skip or quit), with no id to copy, and signs each verdict with your own key.
  • mnema init, which founds the record and leaves in .mnema/ a README.md that says what the folder is and an .editorconfig that unsets what an outer one could impose on its bytes; where the repository has a .prettierignore or declares prettier, it adds the line .mnema/ to it and says so. It writes the mnema instructions (when to call the mnema tools, and what never goes in the record) into AGENTS.md, into a CLAUDE.md or GEMINI.md that exists, and into a rule file of its own for Claude Code, Copilot and Cursor, and names each file. At a terminal it first shows what it found around the folder, asks which agent hosts to write them for (arrows and space; the hosts found are checked; Esc founds nothing) and whether an agent may accept what you choose, and shows everything it will write, once, before it writes any of it; with no terminal, or with --all-hosts or --yes, it asks nothing and writes all four (an agent whose shell is a pseudo-terminal passes --all-hosts or --yes, or it waits at the question). Run again in a project founded before, it adds only what that project lacks beside the record; mnema instructions, with --check or --remove, writes, checks or removes the instructions. mnema doctor points at a missing README, .prettierignore line or instructions block, names a pre-commit hook, Biome, dprint or lint-staged configuration that would rewrite the record, and edits none of those files.
  • Tasks that carry their words. The --description of task create and the --brief of task handoff (and the same two arguments of the create_task and record_handoff tools) record up to 64 KiB of text beside the task, as a note about it; mnema show <task> serves the description, the last handoff with its brief and the notes, and the opening read says who has each task in flight and what happened last. A handoff that names no tree is recorded where its task lives. The format does not change.
  • mnema verify, which reads the record with no key and no network and prints the level it reached. A record a formatter rewrote is refused, and one line beside the refusal names the files, when reading them back in canonical form proves that is all that happened. An agent key one tree of the project retired is retired in the others it reads: what the key signed there after the retirement is refused, and not counted as attested.
  • A brief and a plugin that hand the decisions in force to an agent's session, and the rules addressed at a file beside a write to it (in Claude Code, Codex, Copilot CLI, Gemini CLI, Qwen Code and OpenCode). In Claude Code the plugin also hands the brief to a subagent as it starts, and, after a question the agent asked the person is answered, names the tool that records the choice. After a write there, a note of Claude Code's own memory for this project is copied into this machine's private tree, once per content (never the index MEMORY.md, never a note about the person, never the public tree; on until mnema switch off host-memory-mirror), and a file that holds decisions the record cites nowhere gets one line naming the command that imports it, which records nothing. When the mnema on the PATH is older than the plugin, the opening of the session says so and gives the command that fixes it; mnema doctor says it in either direction.
  • A record inherited from another repository (mnema inherit set), pinned at one commit and read only when it verifies there: its rules in force reach the paths they address, in mnema rules, mnema why, governing_rules and the gate before a write, each naming its origin and commit.
  • mnema usage --tools, which counts how many times each MCP tool was called, from a file this machine keeps in its home and never in the repository; mnema switch off tool-call-count stops it.
  • A session journal, which the Stop hook keeps on this machine, outside the record: ids and counts of what a session did with it (never its words), so the next Stop reads only what the host wrote since and the run the MCP server closes ends with an outcome that the resume and status readings print, and the notes the next session opens with say where this one stopped; a conversation that was compacted is handed back what entered the record while its session ran. mnema switch off session-journal, last-session and after-a-compaction stop them.
  • A task for the work a session hands to other agents, in the Claude Code plugin: the first dispatch of a session records one private task, each dispatch a private handoff on it (its short description and the path of a brief file, never the prompt), and the end of the session closes it; mnema switch off agent-mirror stops it. Every switch says where it begins and what it carries.

The reference has every verb and tool, and what each one leaves unproven.

What it proves, and what it does not

The record is tamper-evident, not tamper-proof: it does not stop an edit, and mnema verify shows when what is in the record has changed since it was signed, and a cut that leaves the last checkpoint in place; by default it does not catch a cut off the end that takes the last checkpoint with it, or one tail deleted whole while another remains (a key left without a tail is noted, not failed). A record in which no tail holds anything any more exits 1, by name, at every --require; --since <rev> exits 1 when files the revision held are gone. It reads the events and public keys of the project's trees, with no private key and no network, and prints each verdict verbatim.

  • It does not say every event is signed: the verdict names the level it reached, and only verified (T1/T2/T4) means every event is covered.
  • It does not catch someone holding the signing key who rewrites and signs again; a witness outside the machine (mnema witness stamp) dates the record, and the history a git remote keeps is what shows a cut.
  • It does not prove nothing was deleted: a tail removed together with its key, while another remains, leaves nothing on disk to cross.
  • It does not make the agent named on a fact the one that did the work, and it is not access control: anyone who can run the command line writes as this machine's identity.
  • It does not count every use of a tool: mnema usage --tools counts only the calls this machine's MCP server answered, nothing of it is signed, and verify does not read it.

The whole table, claim by claim, is in What it proves, and the long form of each row is in the reference.

Install

sh
npm i -g @mnema/code

Then mnema doctor says whether the mnema your shell runs is the one you meant. Where the package came from says how to check the published version against its npm provenance.

The install page has the steps for a Node installed by the system. Requires Node 24.15.0 or a later 24, or 26.0.0 or later; the package is ESM-only.

Your first record

sh
cd your-repositorymnema initmnema decision record "Use SQLite for the projection cache" \  "It is embedded, it is fast enough at our sizes, and it needs no service."mnema verify

Your first record shows what each of them prints, line by line.

Where to go next

The reference · Each host · How it works · The plugin · Where it fits · Evidence

License

Apache-2.0. See LICENSE and NOTICE, which this package carries.

來源:packages/code/README.md,提交 a6ceea2

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

1
  1. v0.1.5最新Nov 5, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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