
ContextLib
io.github.willykeenan由 GitHub 帳號 willykeenan 發布v0.1.0更新於 Oct 25, 2026
A project's long-term memory as plain Markdown files, with an append-only, tamper-evident log.
概覽
ContextLib 讓助理以純 Markdown 檔案保存專案長期記憶,並附有僅可追加、可防竄改的日誌。
- 可以做什麼
- 讀取專案簡報,搜尋、取得並以帶前置資料與內文雜湊的 Markdown 記錄寫入決策、需求、事實、經驗、術語、來源與回傳成果。取代、審閱、接受或拒絕記錄,並列出到期需複審的記錄。把結果檔擷取為回傳記錄並附上建議經驗,匯入或匯出專案包。回報函式庫狀態與健康檢查。
- 適用情境
- 當專案需要能跨助理工作階段保留、且以檔案形式可讀、可比對、可攜帶的長期脈絡,而不是只存在於對話紀錄或僅模型能解析的儲存中時使用。適合希望人與多個助理共用可稽核決策與經驗記錄的團隊。
- 執行需求
- 以 ctxlib 命令列(Python 3.9+,僅標準函式庫)或已發佈的 Docker 映像在本機執行,函式庫掛載於 /library。函式庫路徑來自 --library、環境變數 CONTEXTLIB_ROOT 或 ~/ContextLib。啟動時以 --identity 固定身分。同步時 Git 為選用。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 ContextLib,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
ContextLib
A project library that outlives every agent session.
Real screenshot of the sample library (an invented project).
Each project's knowledge — decisions, requirements, facts, lessons, glossary, sources and returned work — is stored as plain Markdown files with a small front-matter block, in one folder per project. The folders can sit on an external SSD. A person can understand a project from Finder alone. Agents read and write the same files through a CLI (ctxlib) and an MCP server (context_* tools). Any database is a search index rebuilt from the files, never the source of truth.
It is the open core of the context plugin of AgentBrain.
The Python package is agentbrain_contextlib. The CLI is ctxlib. Python 3.9+, standard library only. Git is optional.
Why
Agent sessions end. Chat logs drift. A store that only a model can parse is a dead end the first time you open Finder on an airplane.
ContextLib keeps the durable layer as files you can read, diff, copy, and take to another Mac. The search index is disposable. The Markdown is the product.
60-second quickstart
The library path is --library PATH, else env CONTEXTLIB_ROOT, else ~/ContextLib.
A finished sample you can open in Finder without installing anything lives at examples/sample-library/. Start at that README, then the project BRIEF, then decisions/INDEX.md.
Full walkthrough: docs/QUICKSTART.md.
CLI (ctxlib)
Types: decision, requirement, fact, lesson, glossary, source, return, brief-note.
MCP (context_* tools)
ctxlib mcp --identity ID is a stdio JSON-RPC server. Protocol versions: 2024-11-05, 2025-03-26, 2025-06-18.
Tools: context_brief, context_search, context_get, context_record, context_supersede, context_review_due, context_review, context_capture, context_export, context_import, context_status.
The identity is fixed at start. Tools cannot write as another identity. Errors come back as isError results.
Claude Code
Codex
Cursor
In .cursor/mcp.json (project) or ~/.cursor/mcp.json (user):
Details: docs/MCP.md.
Record format
A record is UTF-8 Markdown. It starts with a YAML-like front-matter block (scalars, quoted strings, lists of scalars, lists of flat maps) and a Markdown body. The body hash is stored in the front-matter; bodies are not rewritten.
Evidence refs are project:<relative path>, ssd:<relative path>, room:<name>#<seq>, url:<https url>, or note:<text>. Absolute home paths and secrets are refused at write time.
Ids: <prefix>-<YYYYMMDD>-<4 hex> with prefixes dec, req, fact, les, glo, src, ret, note.
Files: <YYYY-MM-DD>_<title-slug>_<id-suffix>.md. Superseded records move to superseded/ with the body hash still valid.
Library layout
Keeping the library on an SSD, using it unplugged, and moving it between Macs: docs/SSD.md.
Develop
Python 3.9+, standard library only. See CONTRIBUTING.md and CHANGELOG.md.
Apache-2.0, copyright KE Studios. SECURITY.md for reports.
ContextLib is the open library layer of AgentBrain (agentrooms.io).
Run with Docker
The image is published at ghcr.io/willykeenan/agentbrain-contextlib for Apple silicon and Intel. Mount your library at /library:
來源:README.md,提交 f373be1
工具
0版本歷史
1- v0.1.0最新Sep 27, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
