Open Source Project #182: Graphify — Turn Your Entire Codebase into a Queryable Knowledge Graph for AI Coding Assistants

YC-backed open-source tool that uses tree-sitter AST to parse code locally and an optional LLM backend to process docs, PDFs, images, and video — building everything into one queryable knowledge graph. AI assistants traverse the graph instead of grepping. Every edge is tagged EXTRACTED/INFERRED/AMBIGUOUS. Incremental updates patch only changed files in ~0.8 seconds. Supports Claude Code, Cursor, Codex, and 15+ other AI tools via MCP. Optional Neo4j/FalkorDB backends. 101k Stars, Apache-2.0 + MIT.

·9 min read·AI Tools

Introduction

"AI coding assistants struggle to understand large codebases because they're grepping, not traversing. They find keywords, not relationships."

This is article #182 in the "One Open Source Project a Day" series. Today's project is Graphify — a Y Combinator-backed open-source tool that builds your entire project (code, docs, PDFs, images, video) into a queryable knowledge graph and serves it as a context layer for AI coding assistants.

Ask Claude Code or Cursor to explain how the auth module connects to the database, and you might get an accurate answer or you might get a plausible-sounding answer assembled from a handful of keyword-matched files that missed the critical middle layers. The root issue: AI assistants rely on keyword search and vector similarity to "understand" codebases. Neither approach captures actual structural relationships. Graphify replaces both: every function, class, module, and document becomes a node with explicit typed edges — and the AI traverses the graph to build context instead of guessing.

73,000 Stars in 2.5 months, 2.2M downloads, now at 101k Stars. Apache-2.0 + MIT.

What You'll Learn

  • The core difference between Graphify and RAG: graph traversal vs. vector similarity
  • tree-sitter AST local parsing: zero API calls for code analysis, nothing leaves your machine
  • Edge provenance: EXTRACTED / INFERRED / AMBIGUOUS tagging on every relationship
  • God Nodes: automatic high-impact node identification, blast radius visualization
  • Incremental updates: 3-file change patches in ~0.8 seconds, no full rebuild
  • One-command install and usage in Claude Code

Prerequisites

  • Experience with Claude Code, Cursor, or a similar AI coding tool
  • Basic familiarity with knowledge graph concepts (nodes, edges, relationships)
  • Basic Python environment comfort

Background: The "Project Blindness" Problem

A 500-file codebase. You ask Claude Code: "How does the auth module connect to the database?"

Its processing looks roughly like:

  1. Search context for "auth"-related files
  2. Pull several matching file contents into context
  3. Generate an answer from those fragments

The problem is step 1. The search runs on keywords or vector similarity — not on the actual structural relationships in the code. It might:

  • Find three files containing the string "auth" but miss the critical middleware layer
  • Locate auth.py and db.py but not trace the call chain connecting them
  • Return a different answer if you ask the same question again

This isn't a model capability problem. It's a context construction problem.

Graphify's approach: before you ask anything, parse the entire codebase into a graph. Every function, class, module, and document is a node. Call relationships, import chains, and inheritance are typed directed edges. The AI assistant queries this graph to build context instead of grepping.


Core Architecture: Local AST + Optional LLM

Graphify splits project content into two categories and handles each differently:

Code files
    → tree-sitter AST local parsing
    → Zero API calls, nothing leaves the machine
    → Extracts function/class/module nodes + calls/imports/inherits edges
 
Docs / PDFs / images / video
    → Configured LLM backend (Anthropic / OpenAI / Gemini / Ollama / etc.)
    → Extracts semantic nodes and relationships
 

    Unified knowledge graph
 
Output files:
├── graph.html       ← Interactive browser visualization
├── GRAPH_REPORT.md  ← Human-readable highlights and suggested questions
└── graph.json       ← Full queryable graph data

tree-sitter: Deterministic Code Parsing

tree-sitter is the industry-standard incremental AST parser used by Neovim, GitHub, and many other tools. Graphify uses it to parse code structure rather than asking an LLM to infer it.

The benefits:

  • Deterministic: same code always produces the same parse result
  • Zero API cost: code parsing is fully local, no LLM calls
  • Fast: AST parsing runs orders of magnitude faster than LLM inference
  • Private: code never leaves the machine

Supports 36+ programming languages: Python, TypeScript/JavaScript, Go, Rust, Java, C/C++, Ruby, C#, Kotlin, Swift, Scala, PHP, Lua, Zig, SQL, and more.


Edge Provenance

This is one of Graphify's most distinctive design decisions. Every edge in the graph carries a source tag:

TagMeaning
EXTRACTEDDerived directly from code structure, deterministic
INFERREDDerived from LLM reasoning, some uncertainty
AMBIGUOUSOrigin unclear, worth human verification

Why it matters: when an AI assistant traverses graph paths to answer a question, it knows which relationships are "hard facts from the code" versus "model inferences." That directly affects how confidently the answer should be stated.

User asks: "How does the login function trigger a database write?"
 
AI traverses the graph and finds the path:
login() --[EXTRACTED: calls]--> validate_user()
validate_user() --[EXTRACTED: calls]--> db.query()
db.query() --[INFERRED: writes_to]--> users_table
 
The answer can explicitly note: the first two hops are code-confirmed;
the final hop is inferred.

God Nodes: Identifying High-Risk Points

Graphify automatically computes betweenness centrality across the graph to identify "God Nodes" — the files or functions that sit on the most paths between other nodes.

In a real codebase, God Nodes are typically:

  • A utility function imported by 20 different modules
  • The API layer file that bridges frontend and backend
  • A single service class holding all database connection logic

These nodes share one property: a bug in them has the widest blast radius. Graphify's visualization highlights God Nodes prominently. When reviewing AI-generated code changes, you see immediately whether the changed file is one of these high-centrality nodes.


Community Detection: Discovering Hidden Subsystem Boundaries

Graphify runs the Leiden algorithm on the graph to automatically cluster the codebase into functional subsystems — independent of directory structure.

Why this matters:

  • A utils/ folder might contain code that actually belongs to three different subsystems
  • Leiden clusters from actual call and import relationships, surfacing which files genuinely work together
  • Results appear in graph.html with distinct color coding per community

This is particularly useful for architecture understanding and refactoring planning in large codebases.


Incremental Updates: No Full Rebuild

A common pain with traditional RAG: when code changes, you re-embed the entire index. Hundreds of files might take minutes.

Graphify patches only the changed files, leaving every other node intact.

Official numbers: 500,000-node graph, 3 files changed, patch time: 0.8 seconds.


Query Interface

# Natural language query
graphify query "how does the login form connect to the users table?"
# → Returns the full path from UI through API layers to DB, with edge provenance tags
 
# Shortest path between two nodes
graphify path auth.login db.users
 
# Ask AI to explain a function using the graph as context
graphify explain src/auth/handler.py:validate_token

Supported Data Sources

Graphify ingests the full project, not just code:

Code (local AST, zero LLM)

  • 36+ languages: Python, TS/JS, Go, Rust, Java, C/C++, Ruby, Kotlin, Swift, and more

Documents

  • Markdown, HTML, RST, YAML, TXT
  • .docx, .xlsx (optional extra)
  • PDF (optional extra)

Media

  • Images: PNG, JPG, WebP, GIF (vision extraction)
  • Video/audio: MP4, MOV, MP3, WAV (local transcription via faster-whisper)

Special formats

  • MCP configuration files
  • Package manifests: pyproject.toml, go.mod, pom.xml
  • Google Workspace: Docs, Sheets, Slides (via gws CLI)
  • YouTube URLs

Installation and Quick Start

Install

# Install CLI (uv recommended)
uv tool install graphifyy   # Note: PyPI package name is graphifyy (double y)
 
# Register skill with your AI assistant
graphify install

Use in Claude Code

# In Claude Code, run:
/graphify .              # Build graph for current directory
 
# Then ask project questions naturally —
# the AI traverses the graph instead of grepping

Output Files

graphify-out/
├── graph.html       ← Open in browser for interactive visualization
├── GRAPH_REPORT.md  ← Highlights, surprising connections, suggested questions
└── graph.json       ← Full graph data for programmatic queries

MCP Server Mode

# Start as MCP server
graphify mcp --transport stdio   # stdio transport
graphify mcp --transport http    # HTTP mode

Any MCP-compatible AI tool can then call into your code graph directly via tool calls.

Optional Graph Database Backends

# Push to Neo4j
graphify push --backend neo4j --uri bolt://localhost:7687
 
# FalkorDB
graphify push --backend falkordb

Benchmark Data

From the official BENCHMARKS.md, compared against popular memory/RAG systems:

BenchmarkMetricGraphifymem0supermemory
LOCOMO (n=300)recall@100.4970.0480.149
LOCOMO (n=300)QA accuracy45.3%27.3%49.7%
LongMemEval-S (n=50)QA accuracy76%
Graph buildLLM credits0 (code)per-tokenper-token

On LongMemEval-S, Graphify ties dense RAG at 76% accuracy — with zero LLM cost for the code portion of the graph.


Supported AI Assistants

One command registers the skill across all:

Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot, Aider, Kilo Code, OpenCode, Factory Droid, Trae, Amp, Kiro, Devin CLI, and any other skill-compatible tool.


Resources


Summary

Graphify's core insight: context quality determines answer quality more than model capability does.

The same Claude Sonnet given a handful of grep-matched file fragments versus a traced path through actual code relationships produces noticeably different answers in depth and accuracy. Graphify builds the latter: tree-sitter extracts precise code structure, Leiden identifies subsystem boundaries, betweenness centrality surfaces risk nodes, and all of it assembles into an auditable knowledge graph where every edge carries a provenance tag.

The edge provenance design (EXTRACTED vs INFERRED) deserves particular attention. In a large codebase, "is this relationship code-confirmed or model-inferred" is a question that changes what you do next. Being able to trace an AI answer back to graph paths — and knowing the confidence level of each hop — makes the difference between a useful tool and one you have to second-guess.

73,000 Stars in 2.5 months is a signal that this pain point is real. The grep-and-hope approach to codebase context has been the default long enough.


Explore PrimeSkills — A marketplace for handpicked AI Agents and skills. Each is validated in real enterprise workflows, stripping away hype and keeping only what truly works.

Welcome to my Homepage for more useful insights and interesting products.