Skip to main content

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:

  1. 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.

  2. 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:

  1. Graph YAML -- nodes and edges that describe the project structure.
  2. Documentation -- Markdown files linked to graph nodes, split into searchable chunks.
  3. Code -- source files parsed with tree-sitter to extract symbols (functions, classes) and # beadloom:key=value annotations 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 by reindex, 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beadloom-0.2.0.tar.gz (210.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beadloom-0.2.0-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

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

Hashes for beadloom-0.2.0.tar.gz
Algorithm Hash digest
SHA256 35dcbdf6ee533680a359b78d769bc075a39735932d02a22676406e7a9f5eb9f8
MD5 35baaee247ad8c210271eb986eacc0ce
BLAKE2b-256 b0527a4fa81ca14606210e249d3908053ab0f1ae0735de717db7e616ab72c0d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for beadloom-0.2.0.tar.gz:

Publisher: pypi-publish.yml on zoologov/beadloom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for beadloom-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c23b6704540808bcc06ab7698ea2bee60e7634030de6208dfdd29bf208831ab5
MD5 c460c9e94f9c282756a5de932b00c193
BLAKE2b-256 90461b7e97fe7cbff57304fac1f96c22cac69323f7c702152432fd9f389e0cf8

See more details on using hashes here.

Provenance

The following attestation bundles were made for beadloom-0.2.0-py3-none-any.whl:

Publisher: pypi-publish.yml on zoologov/beadloom

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page