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 集成