79. Graphify
Understand how Graphify turns a codebase into a queryable knowledge graph so AI coding assistants can answer architecture questions cheaply and accurately.
By Jacques Botte, founder of Toptronic®. Last updated 12 September 2026.
The lesson
Graphify (graphify.net, github.com/Graphify-Labs/graphify) is an open-source, MIT-licensed tool that turns any codebase — together with its docs, SQL schemas, configs, PDFs, images, and even video or audio — into a queryable knowledge graph. It is distributed as a `skill` for AI coding assistants such as Claude Code, Cursor, Codex, Gemini CLI, and Hermes. The goal is to give an assistant a structural map of a project so it can answer "what connects to what" questions without re-reading hundreds of files. The PyPI package is named `graphifyy` (double y), but the command is `graphify`.
You install it with `uv tool install graphifyy` (or `pipx install graphifyy`), then run `graphify install` to register the skill with your assistant. Inside the assistant you type `/graphify .` on a project folder. Graphify produces three files in a `graphify-out` directory: graph.html (an interactive, clickable force-directed graph you open in any browser), GRAPH_REPORT.md (highlights such as key concepts, surprising connections, and suggested questions), and graph.json (the full graph that you query any time without re-reading the source).
The engine is local and deterministic for code. It parses about 36-40 languages with tree-sitter ASTs — Python, TypeScript/JavaScript, Go, Rust, Java, C/C++, C#, Kotlin, Ruby, PHP, Swift, Lua, Zig, PowerShell, and more — with no LLM call and nothing leaving your machine. Edges are labelled calls, imports, inherits, mixes_in, references, and depends_on, and every edge carries a confidence tag: EXTRACTED (explicit in the source), INFERRED (derived by resolution), or AMBIGUOUS, so you always know what was read directly versus guessed. Docs, PDFs, office files, images, and media are mapped into the same graph; only that optional semantic pass uses a model backend you configure, and it sends semantic descriptions, never raw source code.
Once the graph exists you query it. `graphify query "what connects auth to the database?"` returns a scoped subgraph for a plain-language question; `graphify explain "RateLimiter"` shows one concept with its community and connections; `graphify path "UserService" "DatabasePool"` traces the shortest hop chain between two things. Because the assistant reads a few-thousand-token subgraph instead of hundreds of thousands of tokens of raw files, answers are dramatically cheaper — the project's own worked example shows about a 71x token reduction on a mixed code-and-paper corpus.
The report surfaces the architecture for you. "God nodes" are the most-connected concepts everything flows through; "communities" are subsystems found by Leiden clustering on the graph topology alone (no embeddings, no vector store); "surprising connections" rank links between things that live in different modules; and inline rationale such as `# NOTE:`, `# WHY:`, and `# HACK:` comments plus ADR/RFC references become first-class nodes linked to the code they explain. This is why a structural graph beats plain vector RAG for code understanding.
Graphify is deliberately safe to run on private code. It is MIT-licensed, performs no telemetry, and its core dependencies (NetworkX, tree-sitter) are permissively licensed. The only outbound network call is the optional semantic-extraction step, which uses your own configured model API key and only sends descriptions. Optional extras add PDF, Office, video transcription, SQL, Neo4j/FalkorDB push, SVG export, and local-Ollama or cloud backends.
How this relates to TPEE: Graphify is one half of the project's standard documentation tandem. After any significant code change, you refresh the project graph from your own project folder with `graphify extract . --out graphify` and `graphify cluster-only graphify`, then export it for browsing (see lesson 80). This keeps an up-to-date, queryable map of your whole codebase so future sessions can ask architecture questions instead of re-reading the whole monolith. Like OmniRoute and LM Studio, Graphify is an external tool — tpee.exe itself stays fully offline, makes no network calls, and runs no MCP server; you simply use the graph files it produces.
Check yourself
Question 1: What does Graphify build from a codebase?
- A compiled binary of the project
- A queryable knowledge graph (graph.json) of code, docs, and media with confidence-tagged edges — correct
- A word-processing document
- A virtual machine image
Answer: A queryable knowledge graph (graph.json) of code, docs, and media with confidence-tagged edges
Graphify extracts a knowledge graph (nodes, edges, communities) from a project folder into graphify-out/graph.json, so an AI assistant can answer architecture questions without re-reading every file.
Question 2: Does Graphify parse source code with an LLM or send raw source files to a third party?
- Yes, it uploads all source to a cloud model
- No — code is parsed locally and deterministically with tree-sitter ASTs; only optional semantic descriptions of docs/media call a model you configure — correct
- Yes, but only on Windows
- It cannot parse code at all
Answer: No — code is parsed locally and deterministically with tree-sitter ASTs; only optional semantic descriptions of docs/media call a model you configure
Graphify's code extraction is local, deterministic tree-sitter parsing with zero LLM calls and nothing leaving the machine; only the optional semantic pass over docs/media uses a configured backend, and never raw source.
Question 3: Which command queries a built Graphify graph with a plain-language question?
- graphify compile
- graphify query "<question>" — correct
- graphify delete
- graphify serve --cloud
Answer: graphify query "<question>"
graphify query returns a scoped subgraph for a question; graphify explain and graphify path inspect single concepts and connections.
← Previous lesson · All 83 lessons · Next lesson →
The full course — 83 lessons and 249 quiz questions — ships inside the app. Get TPEE to study it offline.