Code graph
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. The open-source Graphify CLI parses code, SQL and Terraform on your machine (real AST extraction across about 40 languages, mostly with tree-sitter, no model call required). Hosted Graphify lists 63 grammars. Relationships written in the source are tagged EXTRACTED; ones Graphify resolves itself, such as a call matched to a definition no import proves, are tagged INFERRED with a confidence score. Docs, PDFs and images go through an optional model pass, which can also mark a link AMBIGUOUS when the evidence does not settle it. A call the parser cannot pin to one target is left out rather than 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 read from the source and what was worked out.
Go deeper
From the blog
- Trace one API across a frontend and backend repo: Trace one API across a frontend and backend repo by building each graph, merging them with the Graphify CLI, and querying a shared name.
- Find Java callers before a refactor: Find Java callers before a refactor with the Graphify CLI, using a real run on google/gson and Gson.fromJson as the example.
- How to give Codex context on a large codebase: Give Codex context on a large codebase with Graphify: install the plugin, sign in, then ask about structure, blast radius and pull requests.