
ContextLib
io.github.willykeenanPublished by GitHub account willykeenanv0.1.0Updated Oct 25, 2026
A project's long-term memory as plain Markdown files, with an append-only, tamper-evident log.
Overview
ContextLib gives an assistant a project's long-term memory stored as plain Markdown files, with an append-only, tamper-evident log.
- What you can do
- Read the project brief and search, fetch and record decisions, requirements, facts, lessons, glossary entries, sources and returned work as Markdown records with front matter and body hashes. Supersede, review, accept or reject records, and list records whose review date is due. Capture a result file into a return record with proposed lessons, and import or export projects as bundles. Report library status and health checks.
- When to use it
- Use it when a project needs durable context that survives agent sessions and stays readable, diffable and portable as files, rather than living only in chat logs or a model-only store. Suited to teams that want an auditable record of decisions and lessons shared between people and several agents.
- Requirements
- A local process started with the ctxlib CLI (Python 3.9+, standard library only) or the published Docker image, with the library mounted at /library. The library path comes from --library, the CONTEXTLIB_ROOT environment variable, or ~/ContextLib. An identity is fixed at startup with --identity. Git is optional for sync.
Installation
In SourceWeft
- Open ContextLib in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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:
Source: README.md at commit f373be1
Tools
0Version history
1- v0.1.0LatestSep 27, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts