Graphify-Labs/graphify
Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local deterministic AST parsing, every edge explained, no vector store.
Graphify – turn a codebase into a searchable knowledge graph
What it is – Graphify is a Python‑based CLI that parses a project (source code, documentation, PDFs, images, video/audio) and builds a knowledge graph of the concepts it finds. The graph is stored as graph.json and visualised as an interactive graph.html. You can then ask an LLM‑powered coding assistant (Claude, Copilot, Cursor, Gemini, etc.) to answer questions, trace connections, or explain a symbol by querying that graph instead of grepping through files.
Key ideas
- LLM‑free code parsing – Uses Tree‑sitter ASTs for ~40 languages, so no embeddings or vector store are created and nothing leaves your machine.
- Explicit vs inferred edges – Every link is tagged
EXTRACTED(directly read from the source) orINFERRED(derived by Graphify’s resolver), giving you confidence about what is raw code and what is inferred. - Beyond code – Docs, PDFs, images and video/audio can be added; their semantic pass is performed by the LLM you configure (OpenAI, Anthropic, Gemini, Ollama, etc.).
- Local‑first – Only the optional semantic pass touches an external model; the heavy lifting (AST extraction, community detection, graph construction) runs entirely on your computer.
- Rich queries –
graphify query "<question>",graphify explain "<symbol>", andgraphify path A Blet you retrieve sub‑graphs, get a concise explanation of a node, or see the shortest connection between two concepts.
Quick start (≈30 seconds)
# install the CLI (recommended isolated tool)
uv tool install graphifyy # or: pipx install graphifyy
# register the skill with your coding assistant
graphify install
Now open any supported assistant and type:
/graphify .
Three files appear in graphify-out/:
graph.html– interactive visualisation you can open in a browser.GRAPH_REPORT.md– high‑level summary, key concepts and suggested questions.graph.json– the full machine‑readable graph for custom queries.
Main capabilities
| Capability | What you get |
|---|---|
| God nodes | The most‑connected concepts – the “hubs” of your codebase. |
| Communities | Automatic Leiden clustering that groups related subsystems, labelled without an LLM. |
| Cross‑file links | calls, imports, inherits, mixes_in resolved across many languages via Tree‑sitter. |
| Rationale nodes | # NOTE: / # WHY: comments and ADR/RFC citations become first‑class nodes linked to the code. |
| Multimedia | Docs, PDFs, images, video/audio are added to the same graph (requires the appropriate optional extras). |
| Local‑first parsing | No embeddings, no vector store; only optional LLM calls for non‑code assets. |
| Query language | Plain‑English questions (graphify query), path tracing (graphify path A B), or node explanation (graphify explain). |
Installation details
| Step | Command | Notes |
|---|---|---|
| Package | uv tool install graphifyy (or pipx install graphifyy) |
The PyPI name is graphifyy (double‑y). |
| Skill registration | graphify install [--platform <assistant>] [--project] |
Writes the tiny skill file that each assistant reads. Use --project to keep the skill scoped to the current repo. |
| Optional extras | uv tool install "graphifyy[pdf]", ... [neo4j], ... [all] etc. |
Add PDF extraction, Neo4j push, video transcription, language‑specific parsers, etc. |
| Prerequisites | Python 3.10+, uv (recommended) or pipx. |
macOS: brew install python@3.12 uv; Windows: winget install astral-sh.uv; Linux: install via apt or curl script. |
How it works under the hood
- AST extraction – Tree‑sitter parses each source file, producing a deterministic abstract syntax tree.
- Edge creation – Explicit relationships (imports, calls, inheritance) become
EXTRACTEDedges. Graphify then resolves additional connections (e.g., a function used by a class) and marks themINFERRED. - Community detection – (optional) Leiden algorithm groups nodes into subsystems.
- Semantic pass for non‑code – If you enable PDF, video, or office extras, the selected LLM processes those files and adds concept nodes linked to the surrounding code.
- Export – The full graph is saved as JSON; a D3‑based HTML viewer renders it interactively.
Benchmarks (as reported in the repo)
- Recall@10 on LOCOMO (300 queries): 0.497, far above mem0 (0.048) and supermemory (0.149).
- QA accuracy on LOCOMO: 45.3 % (supermemory 49.7 %, mem0 27.3 %).
- LongMemEval‑S (50 queries) QA accuracy: 76 % (tied with dense RAG approaches).
- LLM credits for graph build: 0 – the core graph construction never calls an LLM.
Ecosystem & integrations
- Supported assistants – Claude Code, Cursor, GitHub Copilot CLI, VS Code Copilot Chat, CodeBuddy, Kilo, Aider, OpenClaw, Factory Droid, Trae, Gemini CLI, Hermes, Kimi, Amp, Google Antigravity, and any framework that reads the generic
~/.agents/skills/location. - Back‑ends for semantic passes – OpenAI, Anthropic, Gemini, Azure OpenAI, Ollama, Bedrock, etc. (selected via
--backendand the appropriate extra). - Graph sinks – Push the graph to Neo4j or FalkorDB, or export as SVG.
- Hooks –
graphify hook installadds a Git post‑commit hook that records the interpreter path, ensuring the skill works in CI or GUI Git clients.
When you might not need it
- If you only need a simple keyword search (
grep) or a traditional vector‑store RAG pipeline, Graphify’s graph‑centric approach may be overkill. - The semantic pass for PDFs/images/video requires an external LLM API key; without it you’ll only get code‑only graphs.
TL;DR
Graphify lets you turn any project into a deterministic, locally‑generated knowledge graph that your AI coding assistant can query instead of scanning raw files. It’s fast, works offline for code, and integrates with most modern AI‑assisted development tools.
Related
- Project
- Project
- Project
- Project