Skip to content
CapsaicinBunny edited this page Jun 20, 2026 · 2 revisions

PolyGraph

Explore, audit, enforce, and compare software architecture across 26 languages — entirely on your machine.

Drop in a project folder and PolyGraph builds an interactive node graph of its modules, classes, interfaces, structs, traits, functions, and components — and the relationships between them: imports, calls, inheritance, instantiation, composition, dependency injection, and JSX component usage. Then go further: trace impact, enforce architecture rules in CI, diff two revisions, query the graph, export it, and jump straight to the source. Nothing is uploaded.

New here? Start with InstallationGetting Started. Hacking on it? Start with Architecture Overview.


The core loop

The fastest way to understand PolyGraph is the loop it's built around:

  1. Scan a folder → an interactive graph of the codebase.
  2. Select a node → see its incoming/outgoing relationships and metadata.
  3. Blast radius → everything transitively affected by a change to it.
  4. Edge evidence → click an edge to see exactly where (file · line · column) the relationship was observed.
  5. Open in editor → jump to the precise line in VS Code or a JetBrains IDE.

Everything else — layouts, filters, the query language, CI rules, diffing, exports — hangs off that loop.

What you can do

🔎 Explore Interactive graph, smart layout, search, filters, focus mode
🧭 Analyze impact Dependencies, dependents, shortest path, blast radius, architectural insights
🛡️ Enforce Architecture rules in CI (polygraph check) with SARIF output
🔀 Compare Diff two revisions / the working tree (polygraph diff)
🗂️ Abstract Collapse to package- and workspace-level graphs from manifests
🧮 Query A small query language for selecting and isolating subgraphs
📤 Export DOT, GraphML, Mermaid, JSON, SVG, standalone HTML report
✏️ Open in editor Inline source preview + jump to the exact line

How it's built (the 60-second version)

PolyGraph is a local-only pipeline:

folder ─▶ Bun sidecar (reads disk) ─▶ language kernel ─▶ providers ─▶ GraphModel
                                                                │
        aggregate (collapse/expand + edge evidence) ─▶ scene ─▶ layout (Web Worker)
                                                                │
                                       Vello WebGPU canvas (Rust → WASM vectors)
  • Analysis is a plugin system: TypeScript/JavaScript gets a precise ts-morph-backed provider (real type-checker call resolution); 25 other languages are declarative tree-sitter packs run by a native Rust core.
  • Rendering is a GPU vector canvas (Vello, compiled Rust → WASM, WebGPU) that stays smooth at thousands of nodes.
  • Layout runs off the main thread in a Web Worker, with a shape-aware engine picker and budget guards.

The full picture is in Architecture Overview.

Two ways to run it

Stack at a glance

Concern Choice
App Next.js (App Router, static export) + Chakra UI v3
Desktop Tauri v2
Analysis Bun sidecar over loopback
Runtime / package manager Bun
Graph render Vello (Rust → WASM, WebGPU)
Layout dagre (layered/tree) + custom engines, in a worker
Code analysis ts-morph (TS/JS) + native tree-sitter core (Rust, napi-rs)
Lint / format oxlint / oxfmt

This wiki is written against the current main. Where the in-repo docs/ and this wiki disagree on layout/rendering details, trust the wiki — it documents the engines and budget system added in recent work.

Clone this wiki locally