Skip to main content

Batho Documentation

Batho (Bidirectional AST Traversal & Hypergraph Orchestrator) is a deterministic, production-grade code intelligence engine that transforms raw codebases into queryable, time-aware structured hypergraphs.

What Batho Does

CapabilityDescription
AST ExtractionParse 40+ languages via tree-sitter into structured entities and relationships
Code GraphBuild in-memory hypergraphs with cross-file symbol resolution
BSG CompressionCompress code intelligence into token-budgeted formats for LLM injection
Time MachineSnapshot, diff, and incrementally patch code intelligence over time
Git HooksEnterprise-grade client-side hook automation with YAML configuration
DashboardInteractive web UI for exploring hypergraphs, files, metrics, and snapshots
Artifact BridgeREST API + MCP server for IDE and tool integrations
  • Getting Started — Install and run Batho in 30 seconds
  • Whitepaper — Deep technical reference for every subsystem
  • CLI Reference — Complete command documentation
  • GitHub — Source code and issues
  • PyPI — Install from Python Package Index

Architecture at a Glance

Architecture diagram showing Batho's data flow: Source Inputs (Git Repository, batho.yaml, hooks.yaml) feed into Batho Core Engine (AST Extractor, InMemoryGraph, AST Cache, SymbolIndex, IncrementalGraphUpdater) which connects to Intelligence Layer (BSGMap, BSG Rule Plugins) and produces Output & Interfaces (Time Machine Snapshots, Web Dashboard, Artifact Bridge, batho CLI).

Status

MetricValue
Supported Languages40+ via tree-sitter
Context CompressionUp to 10x for LLM injection
Incremental Patch Speed10–100x faster than full re-index
Test Coverage859+ automated tests
Cache Hit Rate>95% on typical PR-sized changes
Snapshot Retention90 days default, configurable
Max Indexed Files200,000 per repository

Ready to dive in? Start with the Quick Start Guide.