Skip to content
Concepts

For code, the parser should build the graph, not the model.

GraphRAG for code retrieves by walking calls, imports and definitions, not similar chunks. Why a parser-built graph beats an LLM-built one, with sources.

Graphify concepts

What is GraphRAG for code?

GraphRAG for code retrieves context by walking typed edges (calls, imports, inherits) instead of fetching nearest-neighbour chunks. Ask “what breaks if I change this function?” and the retriever starts at that function, follows its callers outward, and returns the path. Every hop is a real relationship in a real file.

The name comes from Microsoft's GraphRAG (Edge et al., 2024, arXiv 2404.16130). That approach uses a model to extract entities and relationships from text, then groups them into Leiden communities so it can answer questions about a whole corpus. It was built for prose. Code is different: its relationships are already written down in the syntax, so a parser can read them exactly.

Why the parser should build the graph

A model reading code guesses at structure. A parser reads it. Graphify's code graph is built by tree-sitter, with no model and no embeddings, and served from a plain graph.json. SQL and Terraform are parsed too, not read by a model. Because nothing is sampled, the same commit produces the same graph every time.

Independent research points the same way. These are their results, not ours:

  • arXiv 2601.08773 (January 2026) compared graph and vector retrieval on Java repositories, 15 queries each. The parser-built graph was built in seconds and gave the most correct answers. The model-built graph skipped 377 files on Shopizer. Vector-only retrieval was worst on multi-hop questions.
  • A NeurIPS 2025 workshop paper on Verilog code went from 31% top-1 recall with a semantic baseline to 55–79% with GraphRAG.

What Graphify adds on top of the graph

  • Communities. Graphify detects Leiden communities, so the graph splits into the subsystems your code actually has.
  • Provenance on every edge. Each edge is tagged EXTRACTED, INFERRED, or AMBIGUOUS, so you and your assistant can see what was read from source and what was resolved.
  • Ten local MCP tools. Any MCP client can query the graph, including Claude Code.

New to the terms? Start with code graph and RAG.

GraphRAG vs RAG for code: which is better?

It depends on the question. Structural questions (who calls this, what breaks, how does A reach B) are graph walks, and similarity search tends to miss the hops between files. Grep stays better for an exact string. Embeddings stay better for fuzzy questions over prose. Most teams use all three. The full comparison is on Graphify vs RAG.

Can I use GraphRAG with Claude Code?

Yes. Build the graph locally and connect Claude Code to it:

pip install graphifyy
graphify claude install
/graphify .

In Codex the command is $graphify instead of /graphify.

Is Graphify a RAG?

No. Graphify builds a code graph with a parser and lets your assistant traverse it. There are no embeddings and no similarity search over chunks. If you want the label, it does what GraphRAG for code describes, with the graph built by a parser.

Do I need Neo4j or a vector database for GraphRAG on code?

No. The graph lives in a plain graph.json file next to your code. There is no graph database to run and no vector database to keep in sync.

Try Graphify now.

Try for free