Graphify Solves Claude Code's Biggest Limitation: Turning a Codebase into an AI-Queryable Knowledge Graph

An introduction to safishamsi/graphify: a knowledge graph tool for AI coding assistants such as Claude Code, Codex, Cursor, Gemini CLI, and Antigravity. It turns code, database schemas, docs, PDFs, images, video, and audio into a queryable graph.

safishamsi/graphify is a knowledge graph tool for AI coding assistants. Its goal is direct: take the code, docs, SQL schemas, scripts, papers, images, video, and audio inside a project folder, turn them into a queryable knowledge graph, and stop AI assistants from relying only on grep, full-file reading, or ad hoc search to understand a project.

Project link: safishamsi/graphify

At the time of writing, the GitHub page shows about 50.2k stars and 5.4k forks, with an MIT license. The README describes it like this: type /graphify inside your AI coding assistant, and it maps the entire project into a queryable knowledge graph.

The Core Problem It Solves

AI coding assistants are becoming stronger, but in real codebases they still frequently run into several problems:

  • They do not know how key modules connect.
  • They read many files but do not form an overall architecture map.
  • Search finds text, but not upstream and downstream dependencies.
  • Code, database schemas, docs, and infrastructure configuration are scattered across different places.
  • In team collaboration, each person may have a different mental model of the project structure.

Graphify tries to add a “memory layer” to the project. It connects code entities, documentation concepts, database tables, configuration, design notes, and cross-file relationships so the AI assistant can query the graph instead of scanning files from scratch every time.

Minimal Usage

Graphify’s minimal workflow is simple. After installation, type this inside your AI coding assistant:

1
/graphify .

In PowerShell, the leading / is treated as a path separator, so on Windows PowerShell use:

1
graphify .

After running, it generates a graphify-out/ directory with three core files:

1
2
3
4
graphify-out/
├── graph.html
├── GRAPH_REPORT.md
└── graph.json

These files serve different purposes:

  • graph.html: an interactive graph you can open in a browser, with clickable nodes, filters, and search.
  • GRAPH_REPORT.md: highlights, key concepts, surprising connections, and suggested questions.
  • graph.json: the full graph, which can be queried later without rereading all files.

To generate a more readable architecture page with Mermaid call-flow diagrams, run:

1
graphify export callflow-html

Installation and Platform Support

Graphify’s PyPI package name is graphifyy, with a double y. The README specifically warns that other graphify* packages on PyPI are not affiliated with the project, although the CLI command is still graphify.

The recommended installation method is:

1
uv tool install graphifyy

Alternatives:

1
2
pipx install graphifyy
pip install graphifyy

Then register it with your AI assistant:

1
graphify install

The project supports many platforms, including Claude Code, Codex, OpenCode, GitHub Copilot CLI, VS Code Copilot Chat, Aider, Cursor, Gemini CLI, Kimi Code, Kiro, and Google Antigravity. Different platforms can use different install commands, for example:

1
2
3
4
graphify install --platform codex
graphify install --platform gemini
graphify cursor install
graphify antigravity install

Codex users also need to add this under [features] in ~/.codex/config.toml:

1
multi_agent = true

The README also notes that Codex uses $graphify, not /graphify.

What Files It Handles

Graphify supports a wide range of input types.

For code, it supports 31 languages, including Python, TypeScript, JavaScript, Go, Rust, Java, C/C++, Ruby, C#, Kotlin, Scala, PHP, Swift, Lua, Zig, PowerShell, SQL, Shell, JSON, and more.

For documents, it supports:

  • .md
  • .mdx
  • .qmd
  • .html
  • .txt
  • .rst
  • .yaml
  • .yml

Optional dependencies extend it further:

1
2
3
4
5
6
7
pip install "graphifyy[pdf]"
pip install "graphifyy[office]"
pip install "graphifyy[video]"
pip install "graphifyy[mcp]"
pip install "graphifyy[neo4j]"
pip install "graphifyy[sql]"
pip install "graphifyy[all]"

Here, pdf is for PDF extraction, office for .docx and .xlsx, video for video and audio transcription, mcp for an MCP stdio server, neo4j for pushing to Neo4j, and sql for SQL schema extraction.

Why the Report Matters

GRAPH_REPORT.md is not a normal summary. It extracts relationships inside the project that are especially useful for AI assistants.

The README mentions report contents such as:

  • God nodes: the most-connected core concepts in the project.
  • Surprising connections: unexpected links across files or modules.
  • The why: design rationale extracted from comments, docstrings, and design docs.
  • Suggested questions: questions the graph is particularly well suited to answer.
  • Confidence tags: relationships are labeled EXTRACTED, INFERRED, or AMBIGUOUS.

This is important. Normal search only tells you “where this word appears.” A graph can answer “which modules, configs, tables, and docs this concept is connected to.” For large codebases, that is closer to architecture understanding than simple full-text search.

Common Commands

Common Graphify commands include:

1
2
3
4
5
6
7
8
9
/graphify .
/graphify ./docs --update
/graphify . --cluster-only
/graphify . --no-viz
/graphify . --wiki
graphify export callflow-html
/graphify query "what connects auth to the database?"
/graphify path "UserService" "DatabasePool"
/graphify explain "RateLimiter"

You can also add a paper or video to the graph:

1
2
/graphify add https://arxiv.org/abs/1706.03762
/graphify add <youtube-url>

For PR-assisted analysis:

1
2
3
4
graphify prs
graphify prs 42
graphify prs --triage
graphify prs --conflicts

These commands fit code review scenarios: identify which graph communities a PR affects, whether it risks conflicts with other PRs, and which review queues deserve priority.

MCP, Neo4j, and CI

Graphify is not only an HTML graph generator. It can also expose the graph to AI assistants for repeated tool use.

For example, start an MCP server:

1
python -m graphify.serve graphify-out/graph.json

The MCP server provides capabilities such as query_graph, get_node, get_neighbors, shortest_path, list_prs, get_pr_impact, and triage_prs.

It also supports Neo4j export or push:

1
2
/graphify ./raw --neo4j
/graphify ./raw --neo4j-push bolt://localhost:7687

For team collaboration, the README suggests committing graphify-out/ so everyone on the team starts with the same project map. You can also run:

1
graphify hook install

This rebuilds the graph after each git commit and sets up a merge driver so graph.json does not get left with conflict markers when multiple people commit in parallel.

Privacy and Cost

Graphify’s README is fairly clear about privacy boundaries.

Code files are parsed locally through tree-sitter and do not trigger API calls. Video and audio can be transcribed locally with faster-whisper. Docs, PDFs, and images used for semantic extraction go through your AI assistant’s model API.

For headless graphify extract, you may need these environment variables:

1
2
3
4
5
6
7
ANTHROPIC_API_KEY
GEMINI_API_KEY
GOOGLE_API_KEY
OPENAI_API_KEY
DEEPSEEK_API_KEY
MOONSHOT_API_KEY
OLLAMA_BASE_URL

Local Ollama, AWS Bedrock, and Claude Code CLI can also be used as backends. The README also states that the project has no telemetry, usage tracking, or analytics.

In practice, remember that local code parsing does not mean everything stays offline. When docs, PDFs, images, or cloud models are involved, you still need to consider the backend, API keys, enterprise compliance, and data boundaries.

Suitable Scenarios

Graphify is suitable for several types of users:

  • Developers who want Claude Code, Codex, Cursor, and Gemini CLI to better understand project structure.
  • People who need to quickly understand a large unfamiliar codebase.
  • Teams that need to analyze code, SQL schemas, docs, and configuration together.
  • People doing architecture review, PR review, or refactor impact analysis.
  • Teams that want to expose project knowledge as an MCP tool for Agents.
  • Technical leads who want to keep a “project map” for the team.

It is not necessary for every project. For small scripts, one-off demos, or very simple repositories, normal search and README files may be enough. Graphify’s value shows up more clearly in projects with many modules, many docs, team collaboration, and frequent AI assistant involvement.

Summary

Graphify matters because it moves AI coding assistants from “temporarily reading files” toward “a long-lived, queryable project knowledge graph.”

For developers, it does not replace the IDE, search, or LSP. It adds a structured memory layer for AI assistants: which modules matter, which concepts are tightly connected, which docs explain design rationale, and which communities a PR may affect. As Codex, Claude Code, Gemini CLI, Antigravity, and similar Agent tools become more common, this kind of project graph layer will become increasingly useful.

References:

记录并分享
Built with Hugo
Theme Stack designed by Jimmy