Skip to main content

AI-powered codebase indexing and documentation generator.

Project description

Dragula

Dragula (D-RAG-ula) is a Python library that indexes a Python codebase and serves a local web UI for AI-generated object documentation over pluggable LLM providers.

Features

  • CLI commands: init, index, serve
  • AST-based symbol extraction (module/class/function/method)
  • SQLite storage for structured symbol data
  • ChromaDB storage for semantic chunk vectors
  • FastAPI web UI to browse symbols and request AI descriptions (also available via HTTP API)

Install

Requires Python 3.11+.

pip install dragula

Configuration

Dragula keeps its config and local databases under <project_root>/.dragula/ (fixed location, similar in spirit to an Alembic env directory).

Initialize once in the target project (creates .dragula/, a template config.ini, SQLite tables, and the Chroma data directory):

dragula init .

Edit .dragula/config.ini for your LLM providers.

Minimal Gemini config

[app]
top_k = 6

[chat]
provider = gemini
model = gemini-2.5-flash
api_key = ${GEMINI_API_KEY}
base_url =
timeout_seconds = 60

[embedding]
provider = gemini
model = gemini-embedding-001
api_key = ${GEMINI_API_KEY}
base_url =
timeout_seconds = 60

Mixed providers (chat remote, embedding local)

[app]
top_k = 6

[chat]
provider = gemini
model = gemini-2.5-flash
api_key = ${GEMINI_API_KEY}
base_url =
timeout_seconds = 60

[embedding]
provider = openai_compatible
model = text-embedding-3-small
base_url = http://localhost:11434/v1
api_key =
timeout_seconds = 60

Usage

Initialize (first time only):

dragula init .

Build index:

dragula index .

Run web UI (default http://127.0.0.1:8000):

dragula serve .

Optional server binding:

dragula serve . --host 0.0.0.0 --port 8080

HTTP API

Method Path Purpose
GET / Web UI
GET /api/symbols List symbols
GET /api/symbols/{symbol_id} Symbol details and chunks
POST /api/symbols/{symbol_id}/describe Generate AI description
DELETE /api/symbols/{symbol_id}/descriptions Clear cached descriptions for a symbol

Data layout

Under the project root:

  • .dragula/config.ini — configuration
  • .dragula/symbols.sqlite3 — structured symbol/chunk/description tables
  • .dragula/chroma/ — Chroma persistent vector store

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

dragula-0.0.1.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

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

dragula-0.0.1-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

Details for the file dragula-0.0.1.tar.gz.

File metadata

  • Download URL: dragula-0.0.1.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for dragula-0.0.1.tar.gz
Algorithm Hash digest
SHA256 adbe656ae0eaf56a23a70e4b01e3c798f1995173284b3a08365849efedd62ae5
MD5 a758cf235b20c8de15de1f6a9f48e433
BLAKE2b-256 51724ab333ef9609fcff566ab40b7b8238d5984ce939b868b6735989b995ba6b

See more details on using hashes here.

File details

Details for the file dragula-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dragula-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for dragula-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3b5987b483ebc3376728a840aab7d454386a54882136fad002d2cc1198d6798
MD5 3b3c203328613842f3cb9e9b05198e6b
BLAKE2b-256 f3342f441ccd1037d98507029d9b58d828907c55ec775b34d2ceaa9c9081cb13

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