Skip to main content

Buddhi AI - Intelligent Development Assistant

Project description

Buddhi AI

PyPI Version PyPI Downloads License MCP Compatible

BuddhiAI Logo

Buddhi AI is a local AI inference server, interactive web interface, and Model Context Protocol (MCP) server designed to supercharge developer workspaces.

The backend is powered by FastAPI and LiteRT-LM, providing an ultra-fast, OpenAI-compatible local API endpoint. The frontend is built with Streamlit. Additionally, Buddhi integrates a highly-optimized MCP server (CodeGraph) that compiles your codebase into an AST & call-graph SQLite database for token-saving workspace exploration and command execution.

Tech Stack

  • Backend: Python, FastAPI, LiteRT-LM, Uvicorn
  • Frontend: Streamlit
  • Code Graph & MCP: SQLite, FastMCP (StdIO transport)
  • Package Management: uv (Python)

Prerequisites

Before you begin, ensure you have the following installed:

  • Python 3.10+: Recommended to use uv for fast, reliable dependency management.

Setup & Quick Start

1. Backend Setup

Clone the repository and install all dependencies:

uv sync

2. Download the Model

Buddhi AI downloads models locally to the user's home directory (~/.buddhi/models/) to preserve space and enable shared reuse. Run the setup command:

# Downloads the gemma-4-E4B-it.litertlm model from HuggingFace
buddhi setup

3. Initialize the Workspace (MCP Server Integration)

Configure your active development environment (such as Cursor or Antigravity) to use the Buddhi MCP server by initializing the workspace:

buddhi init

This command will:

  • Add dynamic agent workspace instruction block to AGENTS.md.
  • Create or update .agent/mcp_config.json registering buddhi-mcp.
  • Re-index your codebase AST structures and call graph automatically into SQLite.

4. Start the Server and UI

To run both the backend server and Streamlit interface concurrently:

buddhi live
  • Inference API endpoint: http://127.0.0.1:58421/v1
  • Health check: http://127.0.0.1:58421/health
  • Streamlit UI: http://127.0.0.1:58422

CLI Reference

Buddhi provides a CLI command suite:

Command Description
buddhi setup Downloads the local edge inference model.
buddhi init Configures AGENTS.md and .agent/mcp_config.json and indexes the codebase.
buddhi update Explicitly scans the workspace and updates the CodeGraph database.
buddhi live Launches the FastAPI server and Streamlit chat UI concurrently.
buddhi server Launches the FastAPI backend server only (no Streamlit UI).
buddhi mcp Starts the FastMCP server over StdIO transport.

CodeGraph MCP Tools

The buddhi mcp server exposes highly optimized tools that save context tokens during AI agent interactions:

  1. get_codebase_summary

    • Retrieves all classes, files, and main modules grouped by functional community clusters.
    • Use case: Faster high-level codebase understanding upon startup.
  2. find_relevant_symbols

    • Performs exact semantic search (FTS5 SQLite search) over symbol names and AST docstrings.
    • Use case: Pinpoint specific functions/classes without messy, line-by-line grep output.
  3. get_symbol_implementation

    • Retrieves exact source code for a symbol with a built-in guardrail: if the implementation exceeds 150 lines, it returns only the signature, docstring, and method outlines to prevent context window blowout.
    • Use case: Safely inspect class or method implementations.
  4. trace_impact_radius

    • Recursively traces upstream call graph chains up to 3 levels deep starting at a specific symbol.
    • Use case: Identify the blast-radius before modifying/refactoring code.
  5. update_codegraph

    • Rebuilds and updates the SQLite symbol and call dependency database.
    • Use case: Call this tool immediately after every successful code change or implementation to keep the symbol graph fully up to date.
  6. index_codebase

    • Re-builds/syncs the SQLite symbol and call dependency database.
    • Use case: Run at startup or after major edits to ensure symbol synchronization.
  7. execute_command_optimized

    • Executes local terminal commands and utilizes local Gemma models to summarize and format stdout/stderr into token-saving JSON.
    • Use case: Compile, build, and test execution analysis.

Development Workflow

Backend & CLI

  • Main Server Entry: server/main.py
  • API Routes: server/api/routes/
  • CLI Entry: cli/main.py
  • MCP Server Entry: mcp/server.py

Frontend

  • Main App: ui/app.py

PyPI Publishing

To build and publish the buddhi CLI tool to PyPI:

  1. Build the package:

    uv build
    
  2. Publish to PyPI:

    uv publish
    

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

buddhi_ai-2.0.0b7.tar.gz (274.9 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-2.0.0b7-py3-none-any.whl (271.7 kB view details)

Uploaded Python 3

File details

Details for the file buddhi_ai-2.0.0b7.tar.gz.

File metadata

  • Download URL: buddhi_ai-2.0.0b7.tar.gz
  • Upload date:
  • Size: 274.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for buddhi_ai-2.0.0b7.tar.gz
Algorithm Hash digest
SHA256 1691f1052e7f47b5e153dbce2a2b1be8c612a2bfb0253ff27dd429e30bd3878d
MD5 50e172d04d56b0d8f1219eb8b46d9b20
BLAKE2b-256 63844fdf4fd68b06499bc1ca86e70aadad09f23abf6ac3c32dd1d2a8424dc6e0

See more details on using hashes here.

File details

Details for the file buddhi_ai-2.0.0b7-py3-none-any.whl.

File metadata

  • Download URL: buddhi_ai-2.0.0b7-py3-none-any.whl
  • Upload date:
  • Size: 271.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for buddhi_ai-2.0.0b7-py3-none-any.whl
Algorithm Hash digest
SHA256 7ae7b69cf41bd368a4076e05274200bbe0f38cc70a070ca1d3434e17b8f72ee4
MD5 57aff70a86b5e7e8d1113216393e32bc
BLAKE2b-256 494cf8ac37a9f1e43ec44e9bd85682c3ba847bf32d2caa23ff2fc193867d5813

See more details on using hashes here.

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