memo-bank
Enables agents to query a git-native markdown corpus for the specs governing a file in about two reads, plus supports lexical topic search with expansion. Includes maintenance loops that surface uncovered code and stale governing docs to keep the corpus honest.
README
memo-bank
Your specs are contracts. This makes an agent read them before it edits your code — and tells you when they rot.
memo-bank is a read-only MCP server over a git-native markdown corpus, plus two maintenance loops that keep that corpus honest. Point it at a repo and an agent can answer "what rules govern this file?" in about two reads, instead of re-deriving the answer from forty files every time.
MIT licensed · Python ≥3.11 · three dependencies (mcp, python-frontmatter, PyYAML).
Why
Documentation rots in two distinct ways, and most tooling addresses neither:
- Missing — code exists that no doc governs. → the coverage loop surfaces uncovered code that is actually being edited as a ranked "spec-wanted" backlog.
- Stale — a doc exists but the code moved on. → the drift check flags any
governing doc whose governed files changed after its
last_reviewed.
Both run non-blocking on pre-commit. Neither invents content: they tell you what to write and when to revisit, and the corpus stays plain markdown in git.
Install
pip install -e '.[dev]' # from a clone; PyPI publishing not set up yet
memobank --help
Use
Adopting the memo-bank in a new project? See SCAFFOLDING.md.
memobank init --target ../my-project --island my-project --slice umbrella=.
memobank validate ../my-project --index docs/index.json
memobank serve --federation ../my-project/.island-slices.json # the MCP server
memobank coverage --mode staged # missing specs
memobank drift --registry .island-slices.json # stale specs
memobank benchmark --federation .island-slices.json # time-to-context
init writes only what the project owns — .island-slices.json, AGENTS.md,
the corpus skeleton, and the authoring templates. No engine code is copied,
so a project can never carry a forked engine that ages out of sync.
See it work
You're about to edit a file. Ask what governs it:
$ memobank serve … → docs.resolve_path("src/services/api.ts")
hmac-signing-client (matched glob: src/services/api.ts)
→ docs.get("hmac-signing-client") → the contract you must satisfy:
"NEVER log the server token, even partially."
"NEVER sign a path that differs from what the server receives."
Two reads, and the rule that would have bitten you is in hand. Ask about a topic instead, and expansion is what makes lexical search land:
docs.search_live("crawling reviews") → top hit, score 3.0
docs.search_live("refresh fetch ingest cache stale quota") → top hit, score 32.0
Same corpus, same intent — the second query uses the words the docs actually use.
Then the loops keep it honest:
$ memobank coverage --mode staged
⚠ 1 changed file(s) have no governing spec — added to the spec-wanted backlog:
- src/services/audio.ts
$ memobank drift --registry .island-slices.json
⚠ 1 governing doc(s) may be stale — governed code changed since their last_reviewed:
- review-ingestion-status (last_reviewed 2026-06-27) — 7 changed: …
The corpus model
Each slice (a repo, or a subproject within one) owns
docs/{specs,state,archive}/:
| kind | meaning | indexed |
|---|---|---|
spec |
a present-tense contract — "what must hold" | yes (hot) |
state |
a current snapshot — "what the situation is now" | yes (hot) |
archive |
cold history — "what we used to do and why it changed" | no |
Frontmatter is a validated schema; applies_to globs are the precedence surface
(closest glob wins), and cross-references are stable kind:id handles rather
than paths. Specs are written implementation-independent — five sections
(Problem · Contract · Restrictions · Open threads · Code references), with
concrete file references confined to the last one, so the contract survives
refactors.
The tools (MCP surface)
docs.list · docs.get · docs.get_section · docs.resolve_path ·
docs.search_live · docs.search_archive · docs.resolve_term ·
docs.compose_context
They form an incremental-load ladder: pointers → one section → one doc →
ranked search → a budget-bounded bundle. Retrieval is lexical (bag-of-words, no
embeddings, no vendor lock) — so expand a topic query with domain synonyms
before searching; docs.search_live's own description says so, and it roughly
10×'d top-hit scores in practice.
docs.resolve_term reads a term map from .haft/specs/term-map.md or the
docs-native docs/_terms/term-map.md; with neither it reports absent rather
than failing. There is no dependency on any other tool.
Configuration
One file, .island-slices.json, is the whole adoption contract:
{
"island": "my-project",
"slices": [{ "name": "umbrella", "root": "." },
{ "name": "api", "root": "services/api" }],
"source_globs": ["src/**"],
"schema": "docs/specs/schema-frontmatter-v1.md"
}
Only slices is required; everything else defaults. The engine carries no
project literals.
Status
Working software, used on real projects — not a polished product. Known rough
edges: the island/slices vocabulary is inherited from the first project that
used it; memobank init doesn't install the git hook (copy hooks/pre-commit
yourself); last_reviewed is date-granular, so same-day edits after a refresh
re-flag; mcp is pinned <2 (2.x changes the Server API — untested).
Contributions welcome — see CONTRIBUTING.md.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。