Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

buddhi

buddhi turns a codebase into two things an AI coding agent actually needs: a code graph (files, directories, classes, functions/methods, and their containment/import/call relationships, via tree-sitter) and a scaffolded Google Antigravity agent harness that's grounded in that graph instead of generic advice.

The idea: point buddhi at a project, and it gives Antigravity a /plan workflow with domain specialist agents (frontend, backend, database, testing, security, deployment, git) plus a /document-codebase workflow that generates real per-symbol documentation — both reading from buddhi's graph and docs instead of re-deriving understanding from raw source every time.

Supported languages: Python, JavaScript, TypeScript/TSX, Go, Rust, C#, Java, Kotlin, Swift.

Install

uv sync

Usage

buddhi init — full setup (recommended)

uv run buddhi init [path]

Scans path (defaults to the current directory), builds the code graph, computes a documentation plan, and scaffolds the Antigravity agent harness. Writes:

  • .buddhi/graphs/tree-graph.json — the graph in Cytoscape.js elements format
  • .buddhi/graphs/tree-graph.db — a SQLite database (nodes/edges tables, indexed for recursive CTE traversal — ancestor/descendant lookups, call-graph walks)
  • .buddhi/graphs/tree-graph.html — an interactive Cytoscape.js visualization (loads Cytoscape.js from a CDN; open in a browser with internet access)
  • .buddhi/docs-plan.json — a bottom-up, staleness-aware plan of what needs documenting
  • .agents/ — the Antigravity agent harness (agents, workflows, rules, skills, memory index — see below). Idempotent: rerunning init never overwrites a harness file you've already edited under .agents/, it only fills in what's missing.

A .buddhi/.gitignore (ignoring graphs/ and docs/) is created on first run so generated artifacts don't get committed to your project's own repo.

Next step printed at the end: open the project in Antigravity and run /document-codebase, then /plan.

buddhi generate — graph only

uv run buddhi generate [path]

Scans path and writes just the three graph artifacts under .buddhi/graphs/, without touching .buddhi/docs-plan.json or .agents/. Useful for refreshing the graph on its own, or in contexts that don't need the Antigravity harness.

buddhi docs plan — refresh the doc plan only

uv run buddhi docs plan [path]

Recomputes .buddhi/docs-plan.json against the current source tree without touching .agents/. This is what the /document-codebase and /plan Antigravity workflows call before doing anything else, so the plan always reflects the current source.

The Antigravity agent harness

buddhi init scaffolds .agents/ with:

  • workflows//document-codebase (generate or refresh docs) and /plan (turn a request into an implementation plan grounded in the real codebase, without writing any code)
  • agents/ — read-only specialist subagents (backend-specialist, frontend-specialist, database-specialist, testing-specialist, security-specialist, deployment-specialist, git-specialist) dispatched in parallel by /plan, plus terminal-runner for delegated shell/build/test execution
  • rules/ — always-on conventions: consult .buddhi/docs/ and the code graph before raw source, require confirmation before destructive commands, read/append to the memory index for durable decisions
  • skills/okf-context (how to read the generated docs), repoagent-doc-generation (how to write them), and a slot for tech-stack-specific skills you drop in yourself (see .agents/skills/README.md)
  • memory/MEMORY.md — a durable, append-only index of project conventions and decisions discovered across /plan runs

Documentation format

Generated docs under .buddhi/docs/ follow the Open Knowledge Format (OKF): one concept file per module/class/function, each carrying frontmatter that names its source file and line range, a content hash for staleness detection, and a status. The bottom-up generation order — document a symbol only after everything it depends on is already documented — is inspired by the RepoAgent paper's approach to whole-repository, dependency-aware documentation.

Notes on accuracy

Import and call resolution is best-effort, not a full semantic analysis: same-project relative imports and same-file/self./this. calls are resolved to real nodes; everything else (external packages, ambiguous cross-file calls, ...) becomes an external placeholder node so the graph stays informative without producing false edges.

Development

uv run pytest
uv run ruff check src tests
uv run mypy src

Publishing

Releases to PyPI are handled by the publish.yml GitHub Actions workflow. It builds the package with uv build and publishes it using PyPI trusted publishing (OIDC), so no API token is stored in the repository.

The workflow triggers on any pushed tag matching v* (e.g. v0.1.0). To cut a release:

  1. Bump version in pyproject.toml.
  2. Commit the change and tag it to match, e.g.:
    git commit -am "Bump version to 0.1.1"
    git tag v0.1.1
    git push origin main v0.1.1
    
  3. The tag push triggers the workflow, which builds and publishes the package to PyPI automatically.

This requires a trusted publisher to be configured once on PyPI for the buddhi project, pointing at this repository, the publish.yml workflow file, and the pypi environment.

Download files

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

Source Distribution

buddhi_ai-1.0.0b6.tar.gz (36.2 kB view details)

Uploaded Source

Built Distribution

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

buddhi_ai-1.0.0b6-py3-none-any.whl (58.0 kB view details)

Uploaded Python 3

File details

Details for the file buddhi_ai-1.0.0b6.tar.gz.

File metadata

  • Download URL: buddhi_ai-1.0.0b6.tar.gz
  • Upload date:
  • Size: 36.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for buddhi_ai-1.0.0b6.tar.gz
Algorithm Hash digest
SHA256 c2712d652ba83846a3ab47abe8914f9ef78c376853cf6f9f0a1dc5cdf6811d21
MD5 c18ed9ad9af9bdfdfc24a4d8ed0df107
BLAKE2b-256 0a406865f55db09bfabec1de6a134c6b00c6d765b6c7fcc9d9e9766b5c93b53b

See more details on using hashes here.

Provenance

The following attestation bundles were made for buddhi_ai-1.0.0b6.tar.gz:

Publisher: publish.yml on Buddhilive/buddhi-cli

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

File details

Details for the file buddhi_ai-1.0.0b6-py3-none-any.whl.

File metadata

  • Download URL: buddhi_ai-1.0.0b6-py3-none-any.whl
  • Upload date:
  • Size: 58.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for buddhi_ai-1.0.0b6-py3-none-any.whl
Algorithm Hash digest
SHA256 6e9349ae851955f4a8ed6431cb9f511497a93a8d9e038536cc01e969c3eef497
MD5 7fad8694ea080bc19b6bb662f8871ab6
BLAKE2b-256 f7dd4e63007c43ab322bb526c3058050590b459ae3fc95c3156dc826ab59f37b

See more details on using hashes here.

Provenance

The following attestation bundles were made for buddhi_ai-1.0.0b6-py3-none-any.whl:

Publisher: publish.yml on Buddhilive/buddhi-cli

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 Sentry Error logging StatusPage Status page