Graphify Setup
Turn your entire codebase — code, docs, papers, images, and videos — into a queryable knowledge graph that makes every AI coding agent dramatically smarter. Your AI stops guessing and starts navigating.
What Is Graphify?
Graphify is a popular open-source AI coding agent skill (MIT license) that reads your files, builds a knowledge graph, and gives you back structure you didn't know was there. Instead of your AI agent grepping through hundreds of files to answer architecture questions, it navigates a pre-built map of your codebase's concepts, relationships, and design decisions.
The core insight: AI agents fail because they lack architectural context. They read files, guess conventions, and generate code that looks right but violates established patterns. Graphify eliminates this by giving your AI a structured map of your entire codebase — reducing token usage by up to 71.5× per query compared to reading raw files.
How It Works
Graphify runs in three passes:
- AST Pass (deterministic, no LLM needed): Extracts structure from code files — classes, functions, imports, call graphs, docstrings, and rationale comments — using tree-sitter. This is instant and free.
- Transcription Pass (local, no API calls): Video and audio files are transcribed locally with faster-whisper. Transcripts are cached for instant re-runs.
- Semantic Pass (LLM-powered): Claude/GPT subagents run in parallel over docs, papers, images, and transcripts to extract concepts, relationships, and design rationale.
Results are merged into a NetworkX graph, clustered with Leiden community detection, and exported as interactive HTML, queryable JSON, and a plain-language audit report.
What You Get
After running Graphify on this codebase, you'll find a graphify-out/ directory containing:
graphify-out/
├── graph.html ← Interactive graph visualization — open in any browser, click nodes, search, filter
├── GRAPH_REPORT.md ← God nodes, surprising connections, suggested questions
├── graph.json ← Persistent graph — query weeks later without re-reading files
└── cache/ ← SHA256 cache — re-runs only process changed filesKey Outputs Explained
| Output | Description |
|---|---|
| God Nodes | Highest-degree concepts — what everything connects through (e.g.,t(), captureError(), getUser()) |
| Surprising Connections | Cross-module relationships ranked by composite score, with plain-English explanations |
| Suggested Questions | 4–5 questions the graph is uniquely positioned to answer about your architecture |
| Confidence Scores | Every relationship tagged EXTRACTED (found in source), INFERRED (model-reasoned, with 0.0–1.0 confidence), or AMBIGUOUS (flagged for review) |
| Communities | Auto-detected clusters of related concepts (e.g., "Email Adapters", "Payment Providers", "Auth Flow") |
Setup Guide
To install and configure Graphify, please refer to the official Graphify GitHub repository for the complete, up-to-date setup instructions.
How It Helps You
1. Understand Architecture Instantly
Instead of spending hours reading through 600+ files, open GRAPH_REPORT.md and immediately see:
- Which functions are the most connected (god nodes) — these are your core abstractions
- Surprising cross-module connections you didn't know existed
- Community clusters showing how your code naturally groups itself
2. AI Agents Navigate, Not Grep
Without Graphify, your AI agent searches your entire codebase with grep or glob for every question — loading ~20,000 tokens of noise. With Graphify, it reads a compact graph (~1,000 tokens) and navigates directly to the relevant code. 25× less noise = dramatically fewer hallucinations.
3. Always-On Context
After running the install command, your AI agent automatically reads GRAPH_REPORT.md before answering architecture questions. No manual setup per conversation. The graph context is injected into every session:
| Platform | Always-On Mechanism |
|---|---|
| Google Antigravity | .agent/rules/graphify.md (always-on rules) |
| Cursor | .cursor/rules/graphify.mdc with alwaysApply: true |
| Claude Code | CLAUDE.md + PreToolUse hook |
| Gemini CLI | GEMINI.md + BeforeTool hook |
| VS Code Copilot Chat | .github/copilot-instructions.md |
| Kiro | .kiro/steering/graphify.md with inclusion: always |
| Codex | AGENTS.md + PreToolUse hook |
| Others (Aider, Trae, etc.) | AGENTS.md in project root |
4. Query the Graph Directly
Beyond the always-on context, you can query the graph for specific answers:
# Ask a natural language question
/graphify query "what connects authentication to the payment system?"
# Trace a specific path between two concepts
/graphify path "getUser" "createCheckout"
# Get a plain-language explanation of any node
/graphify explain "captureError"
# Deep-dive with DFS traversal
/graphify query "show the auth flow" --dfs5. MCP Server for Structured Access
If your IDE supports Model Context Protocol (MCP), Graphify can expose the graph as a live server:
python -m graphify.serve graphify-out/graph.jsonThis gives your AI agent tools like query_graph, get_node, get_neighbors, and shortest_path for structured, hop-by-hop graph navigation.
6. Interactive Browser Visualization
Open graphify-out/graph.html in any browser to explore:
- Click nodes to see details
- Search for specific functions or concepts
- Filter by community
- Zoom and pan through the architecture
Keeping the Graph Updated
The graph is a static snapshot — it does not auto-update when you change code. Here's how to keep it current:
After Code Changes (Free, No LLM)
python -m graphify update .This re-runs the AST extraction on changed files. No API calls, no token cost. Takes seconds.
After Doc/Paper/Image Changes (LLM Required)
/graphify --updateThis triggers the semantic extraction pass for non-code files, which requires LLM API calls.
Auto-Sync (Watch Mode)
/graphify . --watchRuns in the background and auto-rebuilds the graph when files change. Code changes trigger instant AST rebuilds (no LLM). Doc changes notify you to run --update.
Git Hooks (Recommended for Teams)
graphify hook installInstalls post-commit and post-checkout hooks so the graph rebuilds automatically after every commit and branch switch.
Team Workflows
The graphify-out/ directory is designed to be committed to git so every teammate starts with a fresh map.
Recommended .gitignore
This codebase already includes the recommended exclusion:
# graphify
graphify-out/cache/Commit the graph outputs (graph.json, GRAPH_REPORT.md, graph.html). Exclude the extraction cache (SHA256 hashes of processed files).
Shared Setup
- One person runs
/graphify .to build the initial graph and commitsgraphify-out/ - Everyone else pulls — their AI agent reads
GRAPH_REPORT.mdimmediately with no extra steps - Install git hooks (
graphify hook install) so the graph rebuilds automatically after code changes - For doc changes, whoever edits the files runs
/graphify --updateto refresh semantic nodes
Privacy & Security
| Concern | How Graphify Handles It |
|---|---|
| Code files | Processed locally via tree-sitter AST — no file contents leave your machine |
| Docs, papers, images | Sent to your AI agent's model API (Anthropic, OpenAI, etc.) for semantic extraction |
| Video / Audio | Transcribed locally with faster-whisper — audio never leaves your machine |
| Telemetry | None. No usage tracking, no analytics of any kind |
| Network calls | Only to your platform's model API during semantic extraction, using your own API key |
️ Supported Languages
Graphify supports 25 programming languages via tree-sitter AST:
| Category | Languages |
|---|---|
| Web | TypeScript, JavaScript, JSX, TSX, MJS, Vue, Svelte |
| Systems | Rust, C, C++, Zig, Objective-C |
| JVM | Java, Kotlin, Scala |
| Scripting | Python, Ruby, PHP, Lua, Elixir, PowerShell |
| Mobile | Swift, Dart |
| Scientific | Julia |
| Hardware | Verilog, SystemVerilog |
| Go | Go |
| C# | C# |
Supported File Types
| Type | Extensions | Extraction Method |
|---|---|---|
| Code | .py .ts .js .jsx .tsx .go .rs .java .c .cpp .rb .cs .kt .scala .php .swift .lua .zig .ps1 .ex .exs .m .mm .jl .vue .svelte | Tree-sitter AST (local) |
| Docs | .md .mdx .html .txt .rst | LLM semantic extraction |
| Office | .docx .xlsx | Converted to markdown, then LLM (pip install graphifyy[office]) |
| Papers | .pdf | Citation mining + concept extraction |
| Images | .png .jpg .webp .gif | Claude vision — screenshots, diagrams, any language |
| Video/Audio | .mp4 .mov .mkv .webm .avi .m4v .mp3 .wav .m4a .ogg | Local Whisper transcription (pip install graphifyy[video]) |
Frequently Asked Questions
General
Q: Is Graphify free? A: Yes. Graphify is open-source under the MIT license. The AST extraction (code files) is completely free and runs locally. The semantic extraction (docs, papers, images) uses your AI agent's API, which may have its own costs.
Q: Does Graphify modify my code?
A: No. Graphify is read-only. It scans your files and produces output in the graphify-out/ directory. It never modifies your source code.
Q: How long does the initial build take? A: For this codebase (~600 files), the AST-only extraction takes about 3–5 seconds. Full semantic extraction (including docs and images) depends on your LLM API speed but typically takes 2–5 minutes.
Q: Do I need to rebuild the graph every time I make a change?
A: No. The graph is persistent in graph.json. Only rebuild when you want to capture significant changes. For code-only changes, run python -m graphify update . (instant, no API cost). Consider installing git hooks (graphify hook install) for automatic rebuilds.
Setup & Compatibility
Q: Which AI coding agents does Graphify work with? A: Graphify supports 15+ platforms: Claude Code, Codex, OpenCode, Cursor, Gemini CLI, GitHub Copilot CLI, VS Code Copilot Chat, Aider, OpenClaw, Factory Droid, Trae, Hermes, Kiro, and Google Antigravity.
Q: I'm getting graphify: command not found on Windows. What do I do?
A: On Windows, pip installs user scripts to %APPDATA%\Python\PythonXY\Scripts. Either add that directory to your PATH, or use python -m graphify as an alternative.
Q: Can I use Graphify with multiple projects?
A: Yes. Each project gets its own graphify-out/ directory. Run /graphify . in each project root. The MCP server configuration may need to point to the specific project's graph.json file.
Q: Can I exclude certain files or directories?
A: Yes. Create a .graphifyignore file in your project root (same syntax as .gitignore):
# .graphifyignore
vendor/
node_modules/
dist/
*.generated.pyUnderstanding the Output
Q: What are "God Nodes"?
A: God nodes are the highest-degree concepts in your graph — the functions, classes, or modules that everything else connects through. They represent your core architectural abstractions. In this codebase, captureError() (error handling), t() (i18n translation), createClient(), getUser(), and json() are the top god nodes.
Q: What do EXTRACTED vs INFERRED relationships mean?
A: EXTRACTED means the relationship was found directly in source code (e.g., a function call, import statement). INFERRED means the model reasoned that a connection likely exists (e.g., two functions solving the same problem without calling each other). Every inferred edge has a confidence score (0.0–1.0).
Q: What are "Communities"? A: Communities are groups of closely-related nodes detected by the Leiden algorithm based on edge density. They represent natural architectural boundaries — like "Payment Adapters", "Auth Flow", or "Email System". The cohesion score (0.0–1.0) indicates how tightly connected a community is.
Q: Why do some communities have 0 nodes? A: Empty communities can result from the graph clustering algorithm when edge-only communities are detected. They're harmless and can be ignored.
Advanced Usage
Q: What is the MCP server and when should I use it?
A: The MCP (Model Context Protocol) server exposes your knowledge graph as a set of structured tools (query_graph, get_node, get_neighbors, shortest_path) that your AI agent can call directly. Use it when you want your AI to perform precise, hop-by-hop graph navigation rather than just reading the report summary.
Q: Can I export the graph to other tools? A: Yes. Graphify supports multiple export formats:
/graphify . --graphml # Export for Gephi, yEd
/graphify . --svg # SVG visualization
/graphify . --neo4j # Cypher script for Neo4j
/graphify . --neo4j-push bolt://localhost:7687 # Push directly to Neo4j
/graphify . --wiki # Wikipedia-style markdown articles
/graphify . --obsidian # Obsidian vaultQ: How does Graphify compare to just using grep or find?
A: grep finds text matches. Graphify understands relationships. It knows that createClient() connects authentication to every server action, that captureError() bridges 13 different communities, and that SignupPage() calls isWaitlistEnabled() across modules. This structural understanding is what grep cannot provide.
Q: Can I add external content (papers, videos, URLs) to the graph? A: Yes:
/graphify add https://arxiv.org/abs/1706.03762 # Fetch a paper
/graphify add https://x.com/karpathy/status/... # Fetch a tweet
/graphify add <video-url> # Download, transcribe, add
/graphify add https://... --author "Name" # Tag the original author️ Command Reference
| Command | Description |
|---|---|
/graphify . | Build graph for current directory |
/graphify ./src | Build graph for a specific folder |
/graphify . --update | Re-extract only changed files |
/graphify . --watch | Auto-sync graph as files change |
/graphify . --no-viz | Skip HTML, produce report + JSON only |
/graphify . --mode deep | More aggressive inferred edge extraction |
/graphify . --directed | Preserve edge direction (source → target) |
/graphify . --cluster-only | Rerun clustering without re-extraction |
python -m graphify update . | Re-extract code files (AST only, no LLM) |
/graphify query "..." | Natural language graph query |
/graphify path "A" "B" | Shortest path between two nodes |
/graphify explain "NodeName" | Plain-language node explanation |
graphify hook install | Install post-commit git hooks |
graphify hook uninstall | Remove git hooks |
graphify antigravity install | Install for Google Antigravity |
graphify antigravity uninstall | Uninstall from Google Antigravity |
Token Economics
| Metric | Without Graphify | With Graphify |
|---|---|---|
| Tokens per architecture query | ~20,000 | ~280 |
| Time to understand codebase | Hours | < 1 minute |
| Hallucination surface | Large (all files loaded) | Zero (graph-navigated) |
| Re-query cost | Full re-read | Zero (persistent graph) |
Token reduction scales with corpus size. At 52+ files (code + papers + images), Graphify achieves 71.5× fewer tokens per query. The first run builds the graph (this costs tokens for semantic extraction). Every subsequent query reads the compact graph — that's where savings compound.
Resources
- GitHub Repository: github.com/safishamsi/graphify
- PyPI Package: pypi.org/project/graphifyy
- License: MIT
- Version: v0.6.0 (latest as of 1st May 2026)
- Stars: High-growth public repository; verify the live GitHub count before quoting an exact number in sales copy.
- Supported Platforms: 15+ AI coding agents
Copyright © 2026 Vibe44. Built with ❤️ by Scale with Alap.