Repo Memory

io.github.yubinkim444由 GitHub 帳號 yubinkim444 發布v0.2.1更新於 Oct 24, 2026

Shared, git-tracked working memory for AI agents on the same codebase.

發布方自己的服務:Memory.fit

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

概覽

AI 產生的概覽

一個本機 MCP 伺服器,為助手在儲存庫的 .ai-memory/ 目錄中提供受 git 追蹤的共享記憶,讓事實、決策與注意事項得以留存。

可以做什麼
在任務開始時讀取儲存庫中既有的記憶,吸收先前的脈絡與慣例。附加經過驗證的事實,並附上檔案、行號範圍與所用工具等證據。依標籤或來源檔案列出並篩選事實。把非平凡的決策記錄為說明理由的 Markdown 檔案。加入關於踩坑經驗的一行注意事項。初始化記憶目錄,並可選擇性地向 CLAUDE.md 或 AGENTS.md 附加探索提示。
適用情境
當多個 AI 工作階段或工具在同一個程式碼庫上工作、反覆重新發現相同的慣例、檔案位置與過往決策時適用。也適合希望這些知識透過一般 git 提交被審閱與共享、而不依賴託管服務的團隊。
執行需求
以本機 Python 套件形式執行(Python 3.10 以上),可透過 uvx 或 pip 安裝,唯一相依套件是官方 mcp SDK。需要目標儲存庫路徑,透過 --repo 參數或 REPO_MEMORY_ROOT 環境變數提供,後者預設使用目前工作目錄。不需帳號、API 金鑰或網路存取。
安裝前請注意
此伺服器會寫入儲存庫:在 .ai-memory/ 下建立並附加檔案,而且除非選擇退出,還會向 CLAUDE.md 或 AGENTS.md 附加一段內容。記憶項目為只附加,過時或錯誤的事實會一直保留,直到有人編輯或刪除。提交該目錄會把內容分享給所有能讀取該儲存庫的人,因此推送前應審閱項目。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

repo-memory

Shared, git-tracked working memory for AI agents that share a codebase. What one Claude / Cursor / Cline learns about your repo, the next one picks up automatically. No database. No SaaS. Just files in your repo.

[PyPI] [Python] [MCP] [License: MIT]


The problem

Every AI session that touches your repo starts from zero. It re-greps the same files. It re-discovers the same conventions. It re-asks the same questions you already answered three sessions ago. Multi-user / multi-tool makes it worse: your teammate's Cursor and your Claude Code learn the same codebase independently.

There is CLAUDE.md / .cursorrules for rules the human writes. But there is nothing for facts an agent verified — "the auth middleware lives at src/auth/middleware.py:42", "PR #387 chose httpx over requests because of HTTP/2", "don't run migrations during peak hours".

repo-memory is that nothing. A .ai-memory/ directory you commit to your repo. Every AI tool reads from it, writes to it. Git is the database.


Layout

your-repo/├── .ai-memory/│   ├── README.md           # explains the convention│   ├── facts.jsonl         # append-only structured facts with evidence│   ├── decisions/          # one markdown per non-trivial decision│   │   └── 2026-05-19-pick-httpx.md│   └── gotchas.md          # one-line "watch out for X" notes├── src/└── README.md

Pure files. Sync over git. No daemon, no DB, no auth. Works offline.


Install

bash
pip install repo-memory-mcp# oruvx repo-memory-mcp --help

Python ≥3.10. Depends only on the official mcp SDK (for the MCP server).


Quick start

bash
cd your-reporepo-memory init                              # creates .ai-memory/ + adds CLAUDE.md hintrepo-memory add-fact "Auth middleware lives in src/auth/middleware.py" \                     --file src/auth/middleware.py --lines 42-180 --tool greprepo-memory add-decision "Use httpx not requests" \                         --body "HTTP/2 + async support; we already use anyio."repo-memory add-gotcha "Don't run migrations during 9-11am UTC peak"
repo-memory show                              # render everything as Markdownrepo-memory list-facts --tag auth

Then commit .ai-memory/ like any other file:

bash
git add .ai-memory/git commit -m "memory: record auth middleware location + httpx decision"git push

Anyone else (human or AI) who pulls the repo now sees those facts/decisions immediately.


LLM & AI Agent Readable Specification

For agents discovering this repo through search or MCP indexing.

Identity

  • name: repo-memory
  • purpose: read/write a structured, git-tracked memory store about the current codebase so multiple AI agents (and humans) don't re-learn it.
  • transport: CLI (repo-memory) and MCP stdio (repo-memory-mcp).
  • storage: plain files under .ai-memory/ in the repo. Sync = git.

When to call which tool

ToolWhen
get_repo_memoryAt the start of any task on this repo.
add_factAfter you verify a non-obvious fact (location, behavior, convention). Include evidence so the next agent can re-verify cheaply.
add_decisionAfter a non-trivial choice (architecture, library, trade-off). Body should explain why, not just what.
add_gotchaAfter a surprise that wasted your time.
list_factsWhen you want only facts in a specific area (tag, source_file).

Recommended agent workflow

1. agent.call("get_repo_memory")            -> absorb prior context2. ...do task, run tools, verify things...3. agent.call("add_fact", claim, evidence)  -> for each new fact4. agent.call("add_decision", title, body)  -> if a choice was made5. session ends, human commits .ai-memory/   -> shared via git

MCP server install

Add to your client config (Claude Desktop / Cursor / Cline):

json
{  "mcpServers": {    "repo-memory": {      "command": "uvx",      "args": ["repo-memory-mcp", "--repo", "/abs/path/to/the/repo"]    }  }}

Or set REPO_MEMORY_ROOT env var instead of --repo.

Exposes 5 tools: get_repo_memory, add_fact, list_facts, add_decision, add_gotcha.


Why git, not a database

  • Zero infra. No service to host, no account to create, no API key to rotate.
  • Already authoritative. Git history is the single source of truth. git blame tells you which agent added which fact and when.
  • Works offline. Plane, train, conference WiFi — all fine.
  • PR review. Suspicious or wrong facts get filtered through normal code review.
  • Per-repo scope. A fact about repo A doesn't leak into repo B; the store is local to the repo.

Schema (for tooling authors)

facts.jsonl — one JSON object per line:

json
{  "id": "abc123def456",  "ts": "2026-05-19T18:00:00Z",  "claim": "Auth middleware lives in src/auth/middleware.py",  "evidence": {    "file": "src/auth/middleware.py",    "lines": "42-180",    "tool": "grep",    "command": "rg 'def authenticate' src/",    "verified_at": "2026-05-19T18:00:00Z"  },  "tags": ["auth"],  "added_by": "claude-opus-4.7"}

Append-only. Stale entries stay. Readers consult verified_at and re-verify if they want.


Automatic discovery hint

repo-memory init also appends a short discoverability section to your repo's CLAUDE.md (or AGENTS.md if you already have one) telling any AI agent that enters the repo to check .ai-memory/ first and to record new findings back into it. Idempotent — re-running won't duplicate.

Opt out with --no-claude-md.

The appended block is delimited by <!-- BEGIN: repo-memory --> and <!-- END: repo-memory -->, so you can hand-edit other parts of your CLAUDE.md freely.


CLI reference

CommandEffect
repo-memory init [--no-claude-md]Create .ai-memory/ skeleton + (default) update CLAUDE.md/AGENTS.md.
repo-memory show [--limit N]Print everything as one Markdown doc.
repo-memory add-fact "<claim>" [--file F --lines L --tool T --command C --tag T --by AGENT]Append a fact.
repo-memory list-facts [--tag T] [--source-file F] [--since ISO] [--limit N] [--json]List/filter facts.
repo-memory add-decision "<title>" [--body MD]Write a decision file.
repo-memory list-decisionsList decision file paths.
repo-memory add-gotcha "<note>"Append a one-line gotcha.

All commands take --root PATH if your CWD isn't the repo root.


About the author

Built by yubinkim444, who also makes Kay's Records — an app for iOS and Android.

If this project saved you time, giving the app a try is the nicest way to say thanks.

License

MIT © yubinkim444

來源:README.md,提交 167f6bd

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

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

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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

其他 Memory 整合