Dependency Graph as a Tool - LLM-annotated code dependency analysis
Project description
DGAT
Dependency Graph as a Tool
Point it at a codebase. Get a fully-described, LLM-annotated dependency graph — instantly.
What is this?
DGAT scans any codebase, uses a locally-hosted LLM to write natural-language descriptions for every file and every import relationship, then serves it all through an interactive three-panel UI. Think of it as a self-generating architectural map — no config files, no annotations, no manual work.
Architecture
flowchart TD
subgraph CLI ["dgat (C++17 backend)"]
A[Walk directory tree] --> B[Fingerprint files\nXXH3-128]
B --> C[Parse imports\ntree-sitter + regex fallback]
C --> D[Describe files & edges\nvLLM HTTP API]
D --> E[Build dependency graph\nDepNode + DepEdge]
E --> F[Synthesise blueprint\ndgat_blueprint.md]
F --> G[Persist state\nfile_tree.json · dep_graph.json]
end
subgraph Server ["--backend mode"]
G --> H[HTTP server :8090\ncpp-httplib]
H --> |GET /api/tree| I[File tree JSON]
H --> |GET /api/dep-graph| J[Dep graph JSON]
H --> |GET /api/blueprint| K[Blueprint markdown]
end
subgraph UI ["Next.js frontend"]
I --> L[Explorer panel\nfile tree]
K --> M[Blueprint tab\nrendered markdown]
J --> N[Graph tab\nSigma.js WebGL]
L & M & N --> O[Inspector panel\nnode · edge · dep details]
end
subgraph LLM ["Local vLLM"]
D <--> P[Qwen/Qwen3.5-2B\nor any OpenAI-compat endpoint]
end
Demo
1. Start the vLLM server
Before running DGAT, bring up a local vLLM instance. DGAT uses it to generate descriptions for every file and dependency edge.
2. Run the scan
Point DGAT at your project. It walks the file tree, fingerprints every file, sends them to vLLM, and builds the dependency graph.
Dependency extraction runs in parallel — here's the tail end where import relationships are resolved and edges are formed:
3. Open the UI
Start the backend server and the frontend. Three panels: file explorer on the left, blueprint/graph in the middle, inspector on the right.
Blueprint tab — a synthesised architectural overview of the whole project, generated bottom-up from individual file descriptions:
File inspector — click any file in the explorer to see its description, dependencies, and metadata:
Select a file like dep_graph.json to see its role in the project explained inline:
4. Explore the dependency graph
Switch to the Graph tab for an interactive WebGL view of all import relationships. Node size reflects connectivity.
Single node selected — click any node to see a full LLM-generated analysis of that file, plus its outgoing/incoming edges at the bottom:
Two nodes selected — click a second node to inspect the direct edge between them: the import statement, and a plain-English explanation of why one depends on the other:
Features
- Multi-language import extraction — TypeScript, JavaScript, Python, C/C++, Go, Java, Rust, C#, Ruby, PHP, Bash, and more. Tree-sitter grammars for precision, regex fallback for everything else.
- LLM-annotated graph — every file node and every dependency edge gets a concise description generated by a local model. No cloud, no API keys.
- Project blueprint — a synthesised
dgat_blueprint.mdbuilt bottom-up from all file descriptions. - Incremental updates —
dgat updatere-describes only files whose XXH3 fingerprint changed. - Static export — embed the entire graph into a single self-contained HTML file. Share with anyone, no server required.
- Live UI — auto-refreshes every 30 s. Three-panel layout with file explorer, blueprint/graph tabs, and an inspector.
Getting started
Prerequisites
- C++17 compiler (GCC 11+ / Clang 14+)
- CMake 3.16+
- A running vLLM instance (or any OpenAI-compatible endpoint) on
localhost - Node.js 18+ / Bun (for the frontend)
Build & install
git clone https://github.com/yourname/dgat
cd dgat
cmake -B build && cmake --build build -j$(nproc)
# or use the install script
bash install.sh
Run
# full scan — builds tree, descriptions, dep graph, blueprint
./build/dgat /path/to/your/project
# start the API server (no re-scan)
./build/dgat --backend
# start the frontend
cd frontend && bun dev
# open http://localhost:3000
CLI reference
| Command | Description |
|---|---|
dgat [path] |
Full scan of the target directory |
dgat --backend |
Load saved state, start API server |
dgat update |
Incremental re-scan (changed files only) |
--port <n> |
Override API server port (default: 8090) |
Tech stack
| Layer | Tech |
|---|---|
| Backend | C++17 · cpp-httplib · nlohmann/json · inja · xxHash |
| Parsing | tree-sitter (C, C++, Python, TS, Go, Java, Rust, …) |
| LLM | vLLM · Qwen3.5-2B (any OpenAI-compat endpoint) |
| Frontend | Next.js 14 · TypeScript · Tailwind CSS · Sigma.js · shadcn/ui |
Example output
The examples/dgat-self/ folder contains the output DGAT produced when pointed at its own source tree — a blueprint, file tree, and dependency graph all generated by Qwen3.5-2B running locally via vLLM. Browse it to get a feel for the output format without running a scan yourself.
.dgatignore
DGAT respects a .dgatignore file in the root of the scanned project. It works like .gitignore — one glob pattern per line — and tells DGAT which files and directories to skip during description and graph-building passes (files that match are still shown in the tree but their LLM descriptions and dependency edges are suppressed).
# .dgatignore example
node_modules/
*.lock
vendor/
Files already covered by .gitignore are automatically excluded from LLM processing regardless.
Docs
- Overview — how DGAT works end to end
- File Tree — TreeNode structure, fields, and why each one exists
- Dependency Graph — DepNode, DepEdge, DepGraph, and how the graph is built
- Incremental Updates — how the diff mode works with XXH3 fingerprints
- Import Extraction — tree-sitter parsing, regex fallbacks, and path resolution
gonna scavenge some popular repos, and see how my thing behaves with it, and use my populated context for something useful.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dgat-1.0.0.tar.gz.
File metadata
- Download URL: dgat-1.0.0.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f9581fbe10da1e1e613c245dbf2ad552e157fafa68f0aa474c38aecbf02c720
|
|
| MD5 |
cdde40af7267dffc1e08db02d1afad85
|
|
| BLAKE2b-256 |
d76444ee5aecb02cf7639fedcce82e16b35b3607f8bd1dd936550716dcc4c771
|
Provenance
The following attestation bundles were made for dgat-1.0.0.tar.gz:
Publisher:
release.yml on HyperKuvid-Labs/DGAT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dgat-1.0.0.tar.gz -
Subject digest:
4f9581fbe10da1e1e613c245dbf2ad552e157fafa68f0aa474c38aecbf02c720 - Sigstore transparency entry: 1247071670
- Sigstore integration time:
-
Permalink:
HyperKuvid-Labs/DGAT@32805844bdd6ea49a9d049ed1d866cb761c916d9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HyperKuvid-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@32805844bdd6ea49a9d049ed1d866cb761c916d9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dgat-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dgat-1.0.0-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
355f3450cb536b5cdba9c8255190407d7acc5a549c955c69a73cde0315faf508
|
|
| MD5 |
a6eb8d8fb741ca8c5512696de9e1f558
|
|
| BLAKE2b-256 |
a4b634e49ccccc42590ca7497204b2a10b38500a2c239ea0aea019c3022d70b4
|
Provenance
The following attestation bundles were made for dgat-1.0.0-py3-none-any.whl:
Publisher:
release.yml on HyperKuvid-Labs/DGAT
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dgat-1.0.0-py3-none-any.whl -
Subject digest:
355f3450cb536b5cdba9c8255190407d7acc5a549c955c69a73cde0315faf508 - Sigstore transparency entry: 1247071870
- Sigstore integration time:
-
Permalink:
HyperKuvid-Labs/DGAT@32805844bdd6ea49a9d049ed1d866cb761c916d9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/HyperKuvid-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@32805844bdd6ea49a9d049ed1d866cb761c916d9 -
Trigger Event:
push
-
Statement type: