Graphify: One-Command Knowledge Graphs for AI Coding Assistants (120k Stars)

Graphify builds queryable knowledge graphs from codebases using local tree-sitter parsing for code and LLMs for docs, enabling AI assistants to traverse real code relationships via query, path, and explain commands, with benchmark results showing 0.497 recall@10 on LOCOMO versus 0.048 for mem0.

Linyb Geek Road
Linyb Geek Road
Linyb Geek Road
Graphify: One-Command Knowledge Graphs for AI Coding Assistants (120k Stars)

AI coding assistants struggle with large projects because they must read dozens of files via grep and keyword matching, consuming tokens while missing cross-file call relationships. Graphify addresses this by scanning the entire repository — code, docs, PDFs, media — and generating a persistent knowledge graph that the assistant can query instead of re-reading files.

Core workflow

Running /graphify . in the assistant triggers a scan and creates a graphify-out directory with three files. The graph represents concepts as nodes (color-coded by automatically detected subsystem) and relationships as labeled edges. Code parsing uses tree-sitter (supporting 40+ languages) entirely locally with zero API cost; only non-code content (Markdown, PDF, images, audio/video, SQL, Terraform) invokes the assistant's model or a user-provided API key.

Edge provenance

Every edge carries a source tag: EXTRACTED for relationships explicitly present in source code, INFERRED for tool-derived links, and AMBIGUOUS for uncertain edges. This lets developers instantly distinguish verified from inferred connections.

Query interface

Three commands operate on the built graph: query — natural-language question returns a relevant subgraph. path — shows how two entities connect. explain — details a concept and its immediate neighborhood.

Example: asking about APIRouter in the FastAPI graph returns its origin at routing.py:2210, 47 connected nodes, and provenance tags on each edge.

Benchmarks

On the LOCOMO dataset, Graphify achieves recall@10 of 0.497, compared to 0.048 for mem0 and 0.149 for supermemory. QA accuracy is 45.3%, higher than mem0 but below supermemory's 49.7%.

Automatic architecture insights

During graph construction, Graphify identifies god nodes (highest-degree concepts that define the project's core) and runs the Leiden community-detection algorithm to partition the graph into named subsystems, navigable in the generated graph.html.

Beyond code

Markdown, PDF, images, audio/video, SQL schemas, and Terraform configs can be ingested (Word, Excel, video need extra extensions). Notably, comments starting with NOTE or WHY and architecture decision records become separate nodes attached to the relevant code, preserving rationale alongside implementation.

Incremental updates & team sharing

The graph updates incrementally on changed files. A git hook can trigger rebuilds on commit or branch switch. Graph files are commit-friendly, so teammates cloning the repo get immediate access. The graph can also be exposed as an MCP or HTTP service for shared team use, and a PR dashboard highlights which subsystems a pull request touches and where merge-order conflicts may arise.

Quick start

uv tool install graphifyy
graphify install

Then run /graphify . in the assistant. Parameters exist for code-only mode, re-clustering, disabling visualization, etc.

Caveats

PyPI package is graphifyy (two y's); the CLI command remains graphify.

On Windows PowerShell, use graphify . without a leading slash (slash is interpreted as a path).

If command not found appears, run uv tool update-shell and restart the terminal.

For Chinese-heavy queries, install graphifyy[chinese] to include jieba tokenization.

When to adopt

The author suggests Graphify shines for repositories of 500–5,000 files where onboarding and architecture sharing are pain points. Smaller projects (dozens of files) are faster served by direct file reading. Non-code content consumes API quota during graph build; code parsing remains free and local.

Open-source repository: https://github.com/Graphify-Labs/graphify

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

code analysisknowledge graphdeveloper toolstree-sitterincremental updatesAI coding assistantGraphifyLOCOMO benchmark
Linyb Geek Road
Written by

Linyb Geek Road

Tech notes

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.