Context Oracle + Doc Sync Engine for AI-assisted development
Project description
Beadloom
From documentation bedlam to structured knowledge.
Beadloom is a local developer tool that turns scattered documentation, code, and architectural knowledge into a queryable context layer for humans and AI agents.
It solves two problems of AI-assisted development on large codebases:
-
Context window waste. Agents spend most of their tokens searching and reading docs/code before doing actual work. Beadloom provides a ready-made, compact context bundle for any feature/domain/service — zero search tokens.
-
Documentation rot. After code changes, related docs go stale silently. Beadloom tracks doc↔code links and flags outdated documentation on every commit.
Install
uv tool install beadloom # recommended
pipx install beadloom # alternative
Quick start
# 1. Bootstrap: scan code and generate an initial knowledge graph
beadloom init --bootstrap
# 2. Review and edit the generated graph YAML files
# (nodes = features, services, entities; edges = relationships)
vi .beadloom/_graph/bootstrap.yml
# 3. Build the SQLite index from graph + docs + code
beadloom reindex
# 4. Check project status
beadloom status
# 5. Get a context bundle for a feature or domain
beadloom ctx AUTH-001 # human-readable Markdown
beadloom ctx AUTH-001 --json # machine-readable JSON
# 6. Check documentation freshness
beadloom sync-check
# 7. Set up MCP for AI agents
beadloom setup-mcp
Agents connect via MCP (Model Context Protocol) -- no HTTP daemon, no extra setup:
{
"mcpServers": {
"beadloom": {
"command": "beadloom",
"args": ["mcp-serve"]
}
}
}
Key features
- Context Oracle — deterministic graph traversal → compact JSON bundle in <20ms
- Doc Sync Engine — tracks code changes, detects stale documentation, integrates with git hooks
- Onboarding — bootstrap graph from code (no docs needed), import existing docs, incremental coverage
- MCP server — native integration with Claude Code, Cursor, and other MCP-compatible agents
- Local-first — single CLI binary + single SQLite file, no Docker, no cloud dependencies
How it works
Beadloom maintains a knowledge graph that maps your project's architecture. The graph is
defined in YAML files under .beadloom/_graph/ and consists of nodes (features, services,
domains, entities, ADRs) connected by edges (part_of, uses, depends_on, etc.).
The indexing pipeline reads three sources and merges them into a single SQLite database:
- Graph YAML -- nodes and edges that describe the project structure.
- Documentation -- Markdown files linked to graph nodes, split into searchable chunks.
- Code -- source files parsed with tree-sitter to extract symbols (functions, classes) and
# beadloom:key=valueannotations that link code to graph nodes.
When an agent (or human) requests context for a node, the Context Oracle runs a breadth-first traversal from that node, collects the relevant subgraph, documentation chunks, and code symbols, then returns a compact JSON bundle -- typically in under 20ms.
The Doc Sync Engine tracks which documentation files correspond to which code files. On every commit (via a git hook), it detects stale docs and either warns or blocks the commit.
Documentation structure
Beadloom uses a domain-first layout — features are grouped under their domain, not in a flat list:
docs/
architecture.md
decisions/
ADR-001-cache-strategy.md
domains/
routing/
README.md # domain overview, invariants
features/
PROJ-123/
SPEC.md
API.md
billing/
README.md
features/
PROJ-456/
SPEC.md
_imported/ # unclassified docs from import
Beads integration
A context loom for your beads.
Beadloom complements Beads by providing structured context to planner/coder/reviewer agents. Beads workers call get_context(feature_id) via MCP and receive a ready-made bundle instead of searching the codebase from scratch.
Beadloom works independently of Beads — the integration is optional.
CLI commands
| Command | Description |
|---|---|
init --bootstrap |
Scan code and generate an initial knowledge graph |
init --import DIR |
Import and classify existing documentation |
reindex |
Drop and rebuild the SQLite index from graph, docs, and code |
ctx REF_ID |
Get a context bundle (graph + docs + code symbols) |
graph [REF_ID] |
Show the knowledge graph as Mermaid or JSON |
status |
Show project index statistics and doc coverage |
doctor |
Run validation checks on the knowledge graph |
sync-check |
Check doc-code synchronization status |
sync-update REF_ID |
Show stale docs and update them (supports --auto) |
install-hooks |
Install or remove the beadloom pre-commit hook |
setup-mcp |
Create or update .mcp.json for the MCP server |
mcp-serve |
Run the MCP server (stdio transport) |
All commands accept --project PATH to specify a project root other than the current directory.
MCP tools
AI agents connect via MCP and can call these tools:
| Tool | Description |
|---|---|
get_context |
Get a context bundle for a ref_id (graph + docs + code symbols) |
get_graph |
Get a subgraph around a node (nodes and edges as JSON) |
list_nodes |
List all graph nodes, optionally filtered by kind |
sync_check |
Check if documentation is up-to-date with code |
get_status |
Get project documentation coverage and index statistics |
Configuration
Beadloom stores all project data under .beadloom/ in your repository root:
.beadloom/config.yml-- project settings:scan_paths,languages, sync engine options..beadloom/_graph/*.yml-- knowledge graph definition (nodes and edges in YAML)..beadloom/beadloom.db-- SQLite index (auto-generated byreindex, add to.gitignore).
Code annotations link source files to graph nodes:
# beadloom:feature=AUTH-001
# beadloom:service=user-service
def authenticate(user_id: str) -> bool:
...
Development
# Install with dev dependencies
uv sync --dev
# Run tests
uv run pytest
# Lint and format
uv run ruff check src/
uv run ruff format src/
# Type checking
uv run mypy
Documentation
| Document | Description |
|---|---|
| docs/architecture.md | System design and component overview |
| docs/getting-started.md | Quick start guide |
| docs/context-oracle.md | BFS algorithm and context assembly |
| docs/cli-reference.md | CLI commands reference |
| docs/mcp-server.md | MCP integration guide |
| docs/sync-engine.md | Doc sync engine details |
| docs/graph-format.md | YAML graph format specification |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beadloom-0.2.0.tar.gz.
File metadata
- Download URL: beadloom-0.2.0.tar.gz
- Upload date:
- Size: 210.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35dcbdf6ee533680a359b78d769bc075a39735932d02a22676406e7a9f5eb9f8
|
|
| MD5 |
35baaee247ad8c210271eb986eacc0ce
|
|
| BLAKE2b-256 |
b0527a4fa81ca14606210e249d3908053ab0f1ae0735de717db7e616ab72c0d0
|
Provenance
The following attestation bundles were made for beadloom-0.2.0.tar.gz:
Publisher:
pypi-publish.yml on zoologov/beadloom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beadloom-0.2.0.tar.gz -
Subject digest:
35dcbdf6ee533680a359b78d769bc075a39735932d02a22676406e7a9f5eb9f8 - Sigstore transparency entry: 928541572
- Sigstore integration time:
-
Permalink:
zoologov/beadloom@4243880e2a2b9251e0545f84042a3268e5895fc6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/zoologov
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4243880e2a2b9251e0545f84042a3268e5895fc6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file beadloom-0.2.0-py3-none-any.whl.
File metadata
- Download URL: beadloom-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c23b6704540808bcc06ab7698ea2bee60e7634030de6208dfdd29bf208831ab5
|
|
| MD5 |
c460c9e94f9c282756a5de932b00c193
|
|
| BLAKE2b-256 |
90461b7e97fe7cbff57304fac1f96c22cac69323f7c702152432fd9f389e0cf8
|
Provenance
The following attestation bundles were made for beadloom-0.2.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on zoologov/beadloom
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beadloom-0.2.0-py3-none-any.whl -
Subject digest:
c23b6704540808bcc06ab7698ea2bee60e7634030de6208dfdd29bf208831ab5 - Sigstore transparency entry: 928541591
- Sigstore integration time:
-
Permalink:
zoologov/beadloom@4243880e2a2b9251e0545f84042a3268e5895fc6 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/zoologov
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@4243880e2a2b9251e0545f84042a3268e5895fc6 -
Trigger Event:
push
-
Statement type: