Code graph
Graphify glossary
A knowledge graph built from a codebase: functions, classes, config, and docs become nodes; calls, imports, and references become edges.
A code graph is a knowledge graph built specifically from a codebase. Functions, classes, modules, files, database tables, config values, and doc pages become nodes; calls, imports, definitions, and references become typed edges between them. The result is a machine-followable map of how the system actually fits together — not how the folder structure implies it does.
Graphify builds a code graph in two passes. Code is parsed locally with tree-sitter — real AST extraction across 36 languages, no model call required — so call and import edges come straight from the parser and are tagged EXTRACTED. Everything that isn't code — READMEs, PDFs, SQL, Postgres schemas, Terraform — is read into the graph by your model, and those connections are tagged INFERRED. Where evidence exists but can't be fully resolved (dynamic dispatch, imports built from strings), the edge is kept and tagged AMBIGUOUS rather than silently dropped or presented as fact.
Running /graphify . in a repo produces three local files: graph.html, an interactive map you can explore; GRAPH_REPORT.md, a written brief covering god nodes, communities, and surprising connections; and graph.json, the raw structure. From there, your assistant stops grepping and starts querying — graphify query answers questions over the structure, graphify path traces how two pieces connect, and graphify explain walks through why a node matters.
The practical difference from search is scope. Grep finds strings; a code graph answers structural questions — what calls this, what breaks if this changes, why does the billing service import the auth client — and its answers trace to real paths through real files.
Related terms
- Knowledge graph — A data structure that stores entities and typed relationships between them, so software can follow how things connect instead of searching flat text.
- Tree-sitter / AST — An AST is the parsed structure of source code; tree-sitter is the open-source parser library Graphify runs entirely locally to extract it.
- Confidence tags — Graphify's provenance labels — EXTRACTED, INFERRED, AMBIGUOUS — attached to every edge so you always know what was found versus what was guessed.