Preface¶
When writing code with large models, the context window has always been an unavoidable bottleneck. For agents like Claude Code, Cursor, and Codex, every new session often requires re-scanning the entire repository: grepping files, reading READMEs, flipping through SQL migration scripts. Tokens burn at a rapid pace, and the understanding is not always consistent.
Vector RAG is a common solution, but embedding retrieval is not good at structured relationships such as “who called whom” and “how modules are connected together”. In early August 2026, the open source project Graphify (Graphify-Labs/graphify) which quickly went viral on GitHub Trending took a different approach: deterministically parse local materials such as code, documents, schemas, and PDFs into traversable knowledge graphs, and then hand them over to agents for querying via the /graphify Skill —— no vector database is built, and no embedding is used to guess similarity.
According to the findarepo.com rankings on 2026-08-01, Graphify ranked 14th on the daily Trending list with about 100,000 Stars and a growth rate of +4,300 in 7 days; Trending8 also included Graphify-Labs/graphify in its “Daily Growth” list on the same day. The following content verifies the functional details based on the official repository README and documentation, and provides reproducible onboarding steps.
What is Graphify¶
Graphify is an Agent Skill for AI programming assistants, and its core promise can be summarized in three sentences:
- Local code parsing: Use tree-sitter for AST static analysis to extract relationships such as functions, calls, imports, and inheritance. The process is deterministic, no LLM is called, and the source code never leaves the local machine.
- Multimodal integration into the same graph: Markdown, PDF, SQL Schema, configuration files, and images/audio/video (requires additional dependencies) are semantically extracted and merged into the same NetworkX graph along with code nodes.
- Queryable and interpretable: Generate
graph.jsonto persist the knowledge graph, supporting natural language queries, two-point path tracing, and single-node explanation; each edge is marked withEXTRACTED(explicit in source code) orINFERRED(inferred by tools) for easy auditing.
The project was created on approximately 2026-04-03 on GitHub, maintained by Graphify-Labs led by Safi Shamsi; the PyPI package name is graphifyy (double y, the official emphasizes that other graphify* packages are not related), and the CLI command is still graphify. The license is Apache-2.0 as per the repository metadata.
Why It’s Popular Now: A New Option for Context Engineering¶
With the popularization of agent programming tools, “context engineering” has become a hot topic: how to fit enough accurate project memory within limited tokens? Common pain points include:
- Repeated full-text retrieval of large repositories with high latency and high cost;
- Pure RAG returns fragments without cross-file call chains;
- Documents, schemas, and code come from different sources, making it difficult for agents to establish a unified mental model.
Graphify is positioned as a complement to RAG rather than a simple replacement: it does not build embedding indexes, but constructs explicit graph structures, uses the Leiden algorithm for community partitioning, and marks “god nodes” (high-degree hubs) and unexpected cross-module connections. The official README states that on Karpathy’s mixed corpus (code + papers + graphs), graph queries average about 1.7k tokens, compared to naive full-text retrieval which uses about 123k tokens —— the specific figures vary by project, but the idea is clear: index once, query multiple times.
This is in line with what Andrej Karpathy once proposed: “build a structured knowledge base for LLMs, let the model query instead of re-reading the original text”; there are also practical articles on DEV Community where developers verified the query/path/explain workflow using real repositories such as FastAPI.
Core Principles: AST + Graph, Not Vectors¶
Code Layer: Deterministic Extraction with tree-sitter¶
Graphify runs a tree-sitter pipeline on source code, and the official claims to support cross-file edges such as calls/imports/inherits/mixes_in for about 40 programming languages. References like # NOTE:, # WHY: in comments and ADR/RFC citations will be promoted to nodes and associated with design rationales —— this is very helpful for “understanding why the code is written this way before modifying it”.
Key point: Zero LLM calls and zero external requests during the code parsing phase.
Documents and Schemas: Optional Semantic Channels¶
For content that cannot be parsed purely syntactically such as PDFs, Office documents, and images, Graphify will use semantic extraction; at this time, the model API you have configured in assistants such as Claude Code / Cursor / Codex is used, and the official instructions state that only the semantic description of the document is sent, not the original source code. SQL Schema can be accessed via extras such as graphifyy[sql] or graphifyy[postgres].
Graph Construction and Clustering¶
After nodes and edges are produced in each stage, they are merged into a NetworkX graph, and Leiden is used for community detection (no vector embedding required). The final output includes three components:
graphify-out/
├── graph.html # Interactive browser visualization
├── GRAPH_REPORT.md # Core concepts, unexpected connections, suggested questions
└── graph.json # Full graph for programmable queries
Installation and Skill Registration¶
Environment requirements: Python 3.10+, it is recommended to use uv for isolated installation.
1. Install the CLI
uv tool install graphifyy
# Or: pipx install graphifyy
If the command is not found, run uv tool update-shell and restart the terminal.
2. Register the Skill with the AI assistant
graphify install # Default: Claude Code
graphify cursor install # Cursor
graphify install --platform codex
graphify install --platform gemini
graphify install --project # Write to the current repository for team sharing
The official supports more than 20 platforms including Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot, etc.; Codex users need to enable multi_agent = true in ~/.codex/config.toml to enable parallel extraction.
3. Build the knowledge graph in the assistant chat
In environments that support Slash Command such as Claude Code / Cursor:
/graphify .
Do not include the leading / in PowerShell, use graphify . instead.
After the first run is completed, graphify-out/ will appear in the project root directory. You can use --update for incremental updates to avoid full reconstruction.
Query the Knowledge Graph: Replace Repeated Grepping¶
After the knowledge graph is built, you can use the terminal or let the agent call the CLI, without re-reading the entire repository. The official FastAPI example output is as follows (extracted from the README):
$ graphify explain "APIRouter"
Node: APIRouter
Source: routing.py L2210
Community: 2
Degree: 47
Connections (47):
--> RequestValidationError [uses] [INFERRED]
--> .get() [method] [EXTRACTED]
<-- __init__.py [imports] [EXTRACTED]
$ graphify path "FastAPI" "ModelField"
Shortest path (3 hops):
FastAPI --uses--> DefaultPlaceholder <--references-- get_request_handler() --references--> ModelField
Common commands:
| Command | Function |
|---|---|
graphify query "What is the authentication flow?" |
Retrieve the subgraph and answer in natural language |
graphify path "AdminPanel" "Database" |
Shortest path between two concepts |
graphify explain "RateLimiter" |
Explain a single node and its neighborhood |
Install graphifyy[chinese] to enable jieba word segmentation for Chinese queries. If you want the agent to prioritize querying the graph before reading files, you can run graphify install --project --strict for Claude Code, which will redirect the first reading of source code to graph queries (intercept once per session to avoid freezing).
Integration with Claude Code and Cursor¶
Graphify is embedded into the workflow as a Skill: after installation, trigger construction with /graphify in the chat, and the agent can call commands such as graphify query to pull context in subsequent tasks. For Cursor, run graphify cursor install to write to the corresponding Skill directory.
This is in contrast to “mentioning the entire folder each time” or “letting the model glob the entire repository by itself”: the former is a static snapshot + structured retrieval, while the latter is repeated IO. For monorepos and full-stack projects with a large number of PDFs/Schemas, putting application code + database schemas + infrastructure configurations into the same graph can reduce the probability of agents “getting lost” between layers.
Optional capabilities include: graphifyy[mcp] to expose MCP services; graphifyy[neo4j]/[falkordb] to push to external graph databases; graphify hook install to automatically incrementally update the knowledge graph after git commit.
How to Choose Between Graphify and Vector RAG¶
| Dimension | Vector RAG | Graphify Knowledge Graph |
|---|---|---|
| Indexing Method | Embedding similarity | AST + explicit edges + optional semantic nodes |
| Strengths | Fuzzy semantics, long document fragment recall | Call chains, module boundaries, cross-file dependencies |
| Storage | Vector database | Local graph.json, no embedding required |
| Cost Structure | Tokens consumed during both indexing and retrieval | Zero LLM usage for code parsing; document semantic extraction billed according to the configured model |
| Interpretability | Similarity scores | Edge type + EXTRACTED/INFERRED labels |
In practice, the two can coexist: RAG handles long-tail document Q&A, while Graphify handles topological questions such as “what layers does the entry point go through to reach the database”. The official BENCHMARKS.md provides a comparison table with mem0, supermemory, etc., under settings such as LOCOMO and LongMemEval-S. Interested readers can reproduce the experiments in the repository, and should not blindly copy the scores without considering specific corpora.
Usage Notes¶
- The package name is
graphifyy,pip install graphifymay install an unrelated project. - Document/multimedia semantic extraction depends on the configured model key; pure code graphs can be completed completely offline.
- The first build of a very large repository takes time linear to the number of files; make good use of
cache/and--update. - Graphify-Labs also operates the graphify.com platform (continuously updating the knowledge graph in the background). The open source CLI Skill and cloud service are two product lines, and this article only discusses the open source Skill path.
Summary¶
Graphify advances “code understanding” from repeated full-text scanning to one-time graph construction, multiple traversals: local AST via tree-sitter, Leiden communities, interpretable EXTRACTED/INFERRED edges, and the deeply integrated /graphify Skill with Claude Code, Cursor, Codex, etc. —— this perfectly hits the hot spot in the 2026 developer toolchain where “agents need a project map”.
If you are maintaining a repository of tens of thousands of lines, or have documents and schemas scattered in multiple places, you might spend half a minute installing graphifyy, run /graphify . once at the project root, open graphify-out/graph.html to see the community coloring and god nodes, and then use graphify path to ask a question that would normally require flipping through a dozen files to answer —— this is more indicative of whether it is worth adding to your toolbox than the star count.