blog.dopana

Back

AI coding assistants like Claude Code, Cursor, and Codex are powerful — but they have a fundamental limitation: they need to read raw source files to understand a codebase. For large projects, this burns through context windows and API credits at an alarming rate.

Graphify solves this problem by mapping your entire project — code, docs, PDFs, images, and more — into a structured, queryable knowledge graph that AI assistants can navigate instantly.

What is Graphify?#

Graphify is an open-source, local-first tool that parses a folder into a real node-and-edge graph, stored as graph.json. AI coding assistants query this graph instead of reading raw files, drastically reducing token usage while preserving structural accuracy.

It supports 36+ programming languages via tree-sitter AST parsing, handles multimodal content (PDFs, images, videos, spreadsheets), and produces three key artifacts in graphify-out/:

  • graph.html — Interactive, clickable graph visualization
  • GRAPH_REPORT.md — Architectural summary with key concepts and cross-file connections (Obsidian-compatible)
  • graph.json — Raw knowledge graph for programmatic querying

The project has rapidly gained traction, accumulating close to 100,000 GitHub stars within months of its launch.

How It Works#

Graphify uses a two-pass hybrid processing architecture:

Pass 1: Code (Deterministic AST Parsing)#

Local tree-sitter parsing across 36+ languages. Completely offline — zero LLM calls, nothing leaves your machine. Extracts:

  • Classes, functions, methods, interfaces
  • Import/export relationships
  • Call graphs and inheritance hierarchies
  • Variable references and type information

Pass 2: Docs & Media (Semantic Extraction)#

For non-code files — PDFs, images, audio, video, spreadsheets — Graphify uses your configured AI backend (Claude, OpenAI, Gemini, Ollama, Bedrock, etc.) to extract semantic concepts and link them to the code graph.

Edge Labeling#

Every relationship is explicitly tagged:

  • EXTRACTED — Explicitly present in the source (e.g., a function call)
  • INFERRED — Derived by Graphify’s resolution algorithms (e.g., conceptual similarity)

This lets developers and AI agents distinguish verified relationships from algorithmic inferences.

Community Detection#

Graphify applies Leiden clustering (LLM-free) to segment code into logical subsystems and identify “God nodes” — the most central, heavily-connected components in your codebase.

Supported Data Sources#

TypeFormats
CodePython, TypeScript, JavaScript, Go, Rust, Java, C/C++, C#, Ruby, Swift, Kotlin, Scala, PHP, Lua, Zig, SQL, Terraform/HCL, and more (36+ grammars)
DocumentationMarkdown, MDX, HTML, reStructuredText, YAML, JSON, Obsidian wikilinks
OfficeWord (.docx), Excel (.xlsx), Google Workspace
MediaPDFs, PNG/JPG/WebP/GIF, audio/video (.mp4, .mov, .mp3, .wav), YouTube URLs, arXiv papers

Installation#

# Prerequisites: Python 3.10+

# Install the CLI (package name: graphifyy)
uv tool install graphifyy
# or
pipx install graphifyy

# Register the AI skill
graphify install

# Run against a project
graphify .
bash

To scope the skill to a specific project:

graphify install --project
bash

Key Features#

Strict Mode#

Enforceable via Claude Code integration to block the first raw source file read and force the agent to consult the graph first.

Git Hook Integration#

Auto-rebuild code graphs on commit/checkout:

graphify hook install
bash

Query Engine#

AI agents run targeted subgraph queries instead of reading entire files:

graphify query "How does authentication work?"
graphify path "auth-service" "user-service"
bash

Token Optimization#

By feeding AI assistants precise subgraphs instead of raw files, Graphify drastically lowers token usage and API costs — especially valuable for large codebases.

Graphify vs. Alternatives#

FeatureGraphifyVector RAG (mem0, etc.)Grepping
Structural accuracy✅ AST-level precision❌ Similarity-based✅ Exact match
LLM credits to index❌ Zero (Pass 1 is local)⚠️ High embedding costs✅ Zero
Multimodal support✅ Code + docs + media✅ Text only❌ Text only
Relationship types✅ EXTRACTED vs INFERRED❌ Semantic similarity only❌ None
Interactive graph✅ graph.html❌ No❌ No
Zero-shot recall@10~0.497VariableN/A

Use Cases#

Onboarding to large codebases — New team members explore GRAPH_REPORT.md and query the graph instead of spending days reading files.

Code review impact analysis — Track how changes propagate across modules before making edits.

Multimodal project documentation — Merge codebase logic with architecture diagrams, meeting PDFs, and whiteboard photos into one unified knowledge graph.

Cost-efficient CI/CD — Feed AI code review agents precise subgraphs instead of entire repositories.

Summary#

Graphify transforms how AI coding assistants understand code. Instead of dumping raw files into context windows — expensive, wasteful, and imprecise — it builds a structured knowledge graph that agents can query with surgical precision.

With zero-cost code indexing (tree-sitter, local-only), broad multimodal support, and visual exploration tools, Graphify has rapidly become an essential tool in the AI-assisted development stack.

References#