[<-] Back

Belisarius

Rust, SCIP, fastembed, tantivy, MCP · 2026 · 1 min read

A code-intelligence engine that walks a repo, indexes its symbols, and computes structural quality metrics — exposed natively as an MCP server for agents. Hybrid semantic (fastembed) + BM25 (tantivy) search fused via Reciprocal Rank Fusion, SCIP symbol graphs across Rust / TS / Python / Go (callers, callees, impact, flow), AST-level complexity, and a Preact web UI with Cytoscape graphs, treemap, DSM, and hotspots. Single Rust binary, no Docker.

Pipeline

flowchart LR
    repo[("Repo on disk")]
    scan["Scan<br/>walker · gitignore<br/>regex imports"]
    ast["AST metrics<br/>tree-sitter<br/>(Rust / TS / Py / Go)"]
    scip["SCIP indexers<br/>rust-analyzer<br/>scip-typescript<br/>scip-python · scip-go"]
    search["Hybrid search<br/>fastembed + tantivy<br/>RRF fusion"]
    ctx["Context registry<br/>schemas · runbooks"]
    out{{"MCP server (stdio)<br/>HTTP API + Web UI"}}

    repo --> scan --> ast --> search
    repo --> scip --> search
    ctx --> search
    search --> out
    ast --> out
    scip --> out

Crates

  • belisarius-core — shared types (Scan, Graph, FunctionInfo, Quality, AnalysisReport)
  • belisarius-scan — walker, regex imports, tree-sitter AST, Tarjan cycles, depth, quality
  • belisarius-symbols — SCIP reader + indexer orchestration + impact / flow / 360° symbol view
  • belisarius-search — chunker, fastembed embedder, tantivy BM25, RRF fusion
  • belisarius-context — non-code knowledge registry (schemas, runbooks, API specs)
  • belisarius-clibelisarius binary (scan / index / symbols / quality / mcp / serve / search / impact / flow / context)

Code-quality score

Composite 0–100 over four axes:

Axis Signal
Complexity Average cyclomatic + cognitive per function
Acyclicity Proportion of files outside any import cycle
Dead code Unreferenced symbols vs. total
Fan balance Healthy fan-in / fan-out distribution