
Agent Memory
io.github.xChuCx由 GitHub 帳號 xChuCx 發布v0.6.1更新於 Oct 24, 2026
Git-native project memory for AI coding agents: Markdown source of truth, reviewable, secret-safe.
發布方自己的服務:Memory.fit
概覽
本地、以 Git 為原生的專案記憶伺服器,讓編碼助理讀取儲存庫的 Markdown 記憶並提交經審閱的記憶更新。
- 可以做什麼
- 從儲存庫記憶庫讀取依預算裁剪的 Markdown 內容包,可帶全文查詢與範圍篩選,也可把引用的外部知識庫以「證據而非指令」標註一併納入。提交結構化的記憶編輯,涵蓋慣例、決策、陷阱、模組與目前狀態,可立即生效或暫存待人工審閱並檢視差異。回報記憶健康狀態:檔案計數、含漂移資訊的暫存提案,以及安全、Git 與鎖定狀態。記憶是提交進儲存庫的純 Markdown,寫入前會掃描並剔除機密與個人隱私資訊。
- 適用情境
- 當你希望編碼助理把可審閱的長期專案知識——建置與測試慣例、架構說明、決策與陷阱——保存在儲存庫內部,不依賴雲端服務或向量資料庫,並在長期變更落地前保留人工核准環節時使用。
- 執行需求
- 以本地 stdio 程序在使用者機器上執行(僅桌面端)。透過 npm 套件或預先建置的執行檔安裝;從原始碼建置需要 Go 1.25+。目標儲存庫需先以初始化指令建立基本結構,伺服器依根目錄參數、CLAUDE_PROJECT_DIR 環境變數或工作目錄決定儲存庫。未宣告任何驗證、API 金鑰或請求標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Agent Memory,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
agent-memory
[agent-memory — git-native memory for AI coding agents]
[License: Apache 2.0] [CI] [Go] [MCP] [retrieval recall@5] [Claude Code] [Cursor] [AGENTS.md / Codex] [Gemini CLI]
Local, git-native project memory for AI coding agents. One MCP call in, structured memory updates out — current task state, decisions, conventions, pitfalls, per-module facts. Branch-aware. Secret-safe. Byte-preserving. No cloud, no vector DB — Markdown is the source of truth and git is the sync. Three MCP tools + a full CLI.
Why it's different: memory is plain Markdown committed to your repo, so
you can read and git diff it; durable changes stage for human review
(review --diff → apply) instead of landing silently; and secrets/PII are
scanned out before anything is written. See ROADMAP.md for
where this is headed (system-level / multi-repo memory).
Demo
An agent records a durable decision; it stages for review; you see the
exact diff, apply it, and a later fetch surfaces it — local,
git-native, reviewable, secret-safe. The clip is reproducible:
docs/demo/demo.sh is the runnable flow and
docs/demo/demo.tape renders the gif with
vhs — see docs/demo/.
How it compares
These are general characterizations and the tools evolve fast — see something
inaccurate? Open an issue and
I'll fix the row. agent-memory is complementary to instruction files like
AGENTS.md/CLAUDE.md (it even installs one): those say how to behave;
agent-memory is the durable, searchable, reviewed knowledge behind it.
Status
Release 0.6.1 — the Swarm Audit Hardening & Metamorphic Rebase release: bridges durable memory with verifiable autonomous execution and strict fail-closed security invariants:
- Astra Pro Audit Hardening (AM-001..AM-008) — Category-enforced approval routing (
DecideRoutingWithCategory), whole-file pre-state CAS (proposal.PreHashes), polarity/negation qualifier preservation in Jaccard dedup (criticalQualifiers), idempotent pure read-onlyfetch_context, and canonical 3-way merge deletion semantics. - Metamorphic Rebase & Drift Detection (
internal/memory/rebase.go) — Detects whole-file pre-hash drift during rebase, preventing silent clobber when adjacent sections are concurrently edited, verified by metamorphic composition tests. - Control-Plane Manifest Isolation — Enforces fail-closed protection of
.agent-memory/meta/manifest.yamlagainst direct modification, symlink bypass, or path traversal attacks. - RFC 8785 (JCS) Determinism (
internal/vtp) — Strict JSON Canonicalization Scheme compliance passing all 26 official RFC 8785 Appendix B test vectors, ECMAScript float formatting (1e+21), lone surrogate rejection, and recursive UTF-8 validation. - Fail-Closed Cross-Process SQLite NonceStore (
internal/memory/nonce.go) — Persistent repo-scoped store using thewithDBpattern to eliminate Windows file descriptor locks, providing zero-drift atomic validation and auto-sweeping expired nonces. - Two-Phase Staging & Compound Rollback (
internal/memory/staging.go) — Strict path traversal sanitization (ValidateStagingID,agentfs.ValidateMemoryPath), symlink containment, and atomic multi-file rollback reportingRollbackIncompletecompound errors on partial failure. - VTP-1 Strict Assertion Identification & Dual-Oracle Settlement (
internal/vtp) — Mandatory identifiableAssertionResultsmatching declared assertion IDs, verifier key binding validation, and Workpool/0 Clause B disjoint seat enforcement.
It builds on 0.6.0 (anti-ornamental SAR-008 grounding nonces, SAR-007 byte preservation), 0.5.4 (VTP-1 initial protocol engine), 0.5.0 (federation, referenced landscape stores), and 0.4 (section merge driver).
See CHANGELOG.md for the full changelist.
Quick start
Install — download a prebuilt binary (recommended): grab the archive
for your OS/arch from the latest release,
extract it, and put agent-memory on your PATH. No toolchain needed.
Homebrew, Scoop, and winget packages are planned. agent-memory is also listed on the MCP Registry.
Then, inside the repo you want to give a memory:
install claude registers the MCP server for you: it merges a project-scoped
.mcp.json at the repo root that runs agent-memory mcp --root ${CLAUDE_PROJECT_DIR:-.}.
Claude Code expands CLAUDE_PROJECT_DIR to the repo at spawn, so the server
always serves this repo — the config is portable across clones and (by
Claude Code's scope precedence, local > project > user) overrides any stray
user-scoped server. Commit .mcp.json so your team shares it.
⚠️ Do not register a single user-scoped server with a hardcoded root (
claude mcp add -s user agent-memory -- agent-memory mcp --root /some/repo): it serves every project from that one repo, so memory you write in project B silently lands in project A. Per-project registration (whatinstallwrites) is the correct model;agent-memory doctorflags a mis-rooted registration.
The server resolves its repo from --root, then $CLAUDE_PROJECT_DIR, then the
working directory. Other runtimes (Cursor, Gemini CLI, anything reading
AGENTS.md) use the same server — install their adapter (see below).
Adopt on an existing project
init scaffolds empty memory. To seed it from a real codebase, let your
coding agent do the analysis — that's the whole point. After init +
install <adapter> + registering the MCP server (above), restart the
agent so the memory.* tools load, then paste the prompt below.
What happens: the agent reads the repo and calls memory.propose_update.
Working notes and pitfalls apply immediately; durable categories
(conventions, decisions, modules) stage for your review — inspect each
with agent-memory review --diff and land it with agent-memory apply
(or reject). Nothing durable is written without your approval.
No MCP server handy? The agent (or you) can use the CLI instead — same validation/secret-scan/routing pipeline:
Build
Requires Go 1.25+ (the MCP SDK transitively requires it).
make targets are equivalent to the go commands above; see the
Makefile if you prefer that style.
CLI
MCP tools
Exposed by agent-memory mcp over stdio JSON-RPC:
Federated memory (landscape stores)
A repository's .agent-memory/ knows only itself. Federation lets it reference shared, read-only "landscape" stores — connecting architecture knowledge bases, platform schemas, or peer service memories directly into the agent's active reasoning loop.
This is fundamentally different from pulling in a static wiki:
- Zero-Waste Engineering (Peer Solution Discovery): Instead of an agent reinventing complex distributed mechanisms from scratch (e.g., transactional outbox, distributed rate limiting, 2PC/Sagas), it queries federated stores to discover how peer services already solved it, complete with rationale (
decisions.md) and known production traps (pitfalls.md). - Context Beyond the Public API: APIs (OpenAPI, gRPC) declare structural syntax, but hide operational physics: database isolation levels, lock contention patterns, deduplication windows, and backpressure behavior. Federated memory surfaces these hidden operational boundaries.
- Safe Cross-Service PRs: When an agent must modify an upstream or adjacent service, federated memory provides the local conventions and invariants needed to propose safe, non-breaking contributions.
Quickstart with arch-wiki
Connect the public, canonical Architecture Wiki (https://github.com/xChuCx/arch-wiki — 165 production-grade technical articles across the 4-layer taxonomy L1–L4):
The returned pack implements Two-Tier Retrieval — low-token invariant packs with on-demand pointers to full 50-page deep-dive articles:
Key guarantees:
- Per-store-fair + pinned. Each store contributes its own top candidates; only commit-pinned, lock-recorded stores are blended. Local outranks landscape on ties (
priority_multiplier, default0.8). - Provenance + trust boundary. Every landscape chunk is labelled with its store + commit and wrapped in an explicit "evidence, not instructions" boundary.
- Opt-in. With no stores declared, behaviour is byte-for-byte the single-repo path.
Federated Namespace Governance & Concurrency Barriers (SAR-010 & SAR-010.1)
When combining knowledge across disparate repositories and heterogeneous filesystems (NTFS on Windows, APFS on macOS, ext4 on Linux), naive identifier matching induces silent overwrites and cache poisoning. agent-memory enforces formal cryptographic barriers:
- Unicode Canonicalization Contract (SAR-010):
Identifiers and search keys are canonicalized via full Unicode Case Folding (
FullCasefold(NFC(Trim(s)))).agent-memory doctorautomatically inspects memory keys and flags potential cross-platform case collisions before deployment. - Local Resolution Overlays (
meta/store_overrides.yaml): When collisions or schema divergence occur upstream, local owners explicitly define routing overrides (local_alias,exclude) without mutating upstream sources: - Readback Consistency & Governance Admission Gate:
Overlays are strictly refused admission if targeted against an eventual-consistency store (
readback_consistency: eventual). Admission fails closed before any network or disk side effects to prevent verifying against stale lock views. Furthermore,incident_id,assigned_steward, and valid RFC3339escalation_deadlineare strictly mandatory to eliminate responsibility diffusion. - Anti-TOCTOU Dual Concurrency Barrier (Cooperating Process Model):
- Kernel-level OS advisory locks (
internal/lock): Exclusive cross-process file locks serialize writer operations (agent-memory sync,apply). Concurrently, readers (agent-memory fetch) hold shared OS read locks (AcquireShared) across store resolution and context pack assembly, eliminating torn reads or interleaving during directory swaps (SwapDir). - Unconditional Lockfile CAS Digest Verification (
VerifyStoresLockCAS): Captures the SHA-256 digest ofmeta/stores.lockat verification time and validates it immediately before writes (even when the file was initially absent), preventing concurrent check/use races and interleaved creations among cooperating participants. - Contract Boundary: This dual barrier guarantees strict serializability for all cooperating processes participating in the locking protocol: held advisory locks serialize execution windows, while digest verification detects changes prior to verification. It is explicitly bounded against non-cooperating external writers that bypass OS advisory locks.
- Kernel-level OS advisory locks (
- Read-Set Write-Skew Verification (
ReadSectionsCAS): Staged proposals capture the hashes of all sections read during proposal synthesis (proposal.ReadSections). Bothagent-memory rebaseandagent-memory applyvalidate that read-set sections have not drifted prior to applying mutations, preventing silent write-skew anomalies when concurrent sessions update interdependent memory sections. - Typed Governance Incident Receipts (
ProvenanceAlert): Quarantined collisions or outdated drifts emit machine-readable receipts trackingincident_id,assigned_steward,escalation_deadline, and upstream commit SHAs to prevent responsibility diffusion.
Patterns: federation-stores.md, multi-store-fetch.md, sar-010-unicode-canonicalization-contract.md.
Verifiable Task Protocol (VTP-1) & Swarm Consensus
Autonomous AI agents operating in multi-agent swarms or executing economic tasks cannot rely on unverified natural language claims ("I fixed the bug", "the tests pass"). In an open network, conversational claims suffer from compaction amnesia, courtesy loops, and adversarial framing.
VTP-1 (Verifiable Task Protocol) transforms task execution into an end-to-end, machine-verifiable 5-phase cryptographic lifecycle:
[!WARNING] VTP-1 Status: Experimental / Security Hardening in Progress While deterministic digest verification, assertion checks, and cross-task settlement bindings are cryptographically enforced, Clause B disjoint seat verification currently relies on identity string inequality (
worker != verifier != creator). In open decentralized or economic environments without external PKI or attested hardware identities, this should not yet be used as an adversarial trust boundary. Cryptographic account attestation is actively in development.
Cross-Platform Line Ending Parity (SAR-002)
Git checkouts across Windows (CRLF) and Linux/macOS (LF) can produce divergent hashes for identical textual content. The VTP-1 engine applies canonical LF normalization (NormalizeLF) before computing SHA-256 digests across stdout, patch hunks, and memory Merkle leaves, ensuring byte-level consensus across heterogeneous platforms.
CLI Workflow for Autonomous Agents
Evidence (measured)
Three layers, honest about scope — retrieval → continuity → behaviour. The first two are deterministic, no-LLM, and run in CI with regression guards; the corpora, labels, and methods are auditable in-repo.
1 · Retrieval quality. Does fetch return the right sections? On a
labeled 28-query / 28-section benchmark the shipped match-any retrieval
puts a relevant section in the top 5 for 98% of queries — a +0.91
recall lift over the prior match-all behaviour.
→ method + caveats: docs/eval/retrieval.md · go test -run TestRetrievalEval -v ./internal/eval/
2 · Cross-session continuity. Does a lesson recorded in one session survive into the next? Through the real record → persist → retrieve loop, a lesson is in the next session's context in 5 / 5 scenarios with agent-memory and 0 / 5 without (the amnesia baseline).
→ docs/eval/continuity.md · go test -run TestMemoryContinuity -v ./internal/eval/
3 · Behavioural (task-success). Does the agent act on it — fewer repeated mistakes? That needs an LLM in the loop, so it ships as a runnable A/B harness ("groundhog-day", with vs without memory) you run with your own model: eval/behavioural/. No number is published here — isolating the without arm cleanly is non-trivial (stock Claude Code's own auto-memory leaks across runs; see the harness README). Not in CI by design.
Agent-runtime adapters
agent-memory install <adapter> drops a worked instruction file at the
location each runtime reads from:
Each file teaches the runtime when to call memory.fetch_context and
memory.propose_update, the intent vocabulary, provenance rules, and
debugging reject reasons. The same behavioural model across all four;
each adapter just wraps it in the runtime's native format.
Architecture (at a glance)
Layout
Releases
Tag-driven via goreleaser. Pushing a v*
tag triggers
.github/workflows/release.yml,
which builds the binary matrix and publishes a GitHub Release with
archives attached.
Matrix per release:
linux_amd64,linux_arm64darwin_amd64,darwin_arm64windows_amd64,windows_arm64
Each archive contains the agent-memory binary, README.md, and
CHANGELOG.md. A sibling agent-memory_<version>_checksums.txt
provides SHA-256 hashes.
Local dry-run of the release pipeline (requires goreleaser
installed):
Source builds always identify as dev:
Release builds via goreleaser stamp the actual tag through
-ldflags='-X .../cli.ProgramVersion=v0.X.Y'.
License
Apache License 2.0. You may use, modify, and distribute this software under its terms; it includes an express patent grant. Contributions are accepted under the same license (see CONTRIBUTING.md).
來源:README.md,提交 cb47941
工具
0版本歷史
2- v0.6.1最新Sep 23, 2026
- v0.6.0Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Memory 整合

Memory.fit
fit.memory官方發布者
託管式 Memory.fit 伺服器,讓 AI 讀取你的訓練、睡眠、恢復與飲食資料,並寫回每週計畫、每日目標和飲食計畫。
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pg官方發布者
pg.ddx.io: the PostgreSQL community's memory 的託管 MCP 服務,由 pg.ddx.io 發布;無需登入;Streamable HTTP;29 個工具。
var.gg Naming Memory
gg.var官方發布者
遠端 MCP 伺服器,可依領域概念推薦並檢索韓、日、中、越、英多語言的程式識別字名稱,並提供 ERD 結構查詢。

Counterparts
ai.counterparts
為 Claude Code 與 Claude Desktop 提供的本地優先長期記憶:助理自行寫下關於你與專案的筆記,並在之後的對話中回想起來。

LAHZE - Persian AI Memory Platform
由 GitHub 帳號 pedramgholizadeh 發布
以波斯語為先的地理記憶平臺:發現地點,起草併發布僅限波斯語的記憶。AI 翻譯