Graphify-Labs / graphify
Graphify-Labs / graphify
Type /graphify in your AI coding assistant and it maps your entire project (code, docs, PDFs, images, videos) into a knowledge graph you can query instead of grepping through files.
在你的 AI 编程助手中输入 /graphify,它会将你的整个项目(代码、文档、PDF、图像、视频)映射为一个知识图谱。你可以直接查询该图谱,而无需通过 grep 在文件中进行搜索。
Code maps for free, fully local. Code is parsed with tree-sitter AST: deterministic, no LLM, nothing leaves your machine. (Docs, PDFs, images and video use your assistant’s model, or a configured API key, for a semantic pass.) 代码映射是免费且完全本地化的。代码通过 tree-sitter AST 进行解析:过程是确定性的,无需 LLM,没有任何数据会离开你的机器。(文档、PDF、图像和视频则会使用你助手中配置的模型或 API 密钥进行语义分析。)
Every edge is explained. Each connection is tagged EXTRACTED (explicit in the source) or INFERRED (resolved by graphify), so you can tell what was read directly from what was inferred. 每一条边都有解释。每个连接都被标记为 EXTRACTED(源码中明确的)或 INFERRED(由 graphify 推断出的),因此你可以区分哪些是直接读取的,哪些是推断出来的。
Not a vector index. No embeddings, no vector store: a real graph you traverse. Ask a question, trace the path between two things, or explain one concept. 这不是向量索引。没有嵌入(embeddings),没有向量数据库:这是一个你可以遍历的真实图谱。你可以提出问题、追踪两个事物之间的路径,或解释某个概念。
The FastAPI codebase mapped by graphify. Every node is a concept, colors are detected communities, and the whole thing is clickable in graph.html.
这是由 graphify 映射的 FastAPI 代码库。每个节点都是一个概念,颜色代表检测到的社区,整个图谱在 graph.html 中均可点击。
Get started (30 seconds) / 快速上手(30秒)
uv tool install graphifyy # install the CLI (or: pipx install graphifyy)
graphify install # register the skill with your AI assistant
Then, in your AI assistant: /graphify. That’s it.
然后在你的 AI 助手中输入:/graphify。这就完成了。
You get three files: 你将获得三个文件:
graphify-out/graph.html: open in any browser — click nodes, filter, searchgraph.html:在任何浏览器中打开——点击节点、过滤、搜索GRAPH_REPORT.md: the highlights: key concepts, surprising connections, suggested questionsGRAPH_REPORT.md:重点摘要:关键概念、令人惊讶的连接、建议的问题graph.json: the full graph — query it anytime without re-reading your filesgraph.json:完整图谱——随时查询,无需重新读取文件
Works in Claude Code, Cursor, Codex, Gemini CLI, GitHub Copilot, and 15+ more — pick your platform. 适用于 Claude Code、Cursor、Codex、Gemini CLI、GitHub Copilot 等 15 种以上的平台——选择你使用的工具即可。
See it in action / 实际演示
Once the graph is built you query it instead of reading files. Real output, graphify run on the FastAPI codebase shown above: 图谱构建完成后,你只需查询它,而无需阅读文件。以下是在上述 FastAPI 代码库上运行 graphify 的实际输出:
$ graphify explain "APIRouter"
Node: APIRouter
Source: routing.py L2210
Community: 2
Degree: 47
Connections (47):
--> RequestValidationError [uses] [INFERRED]
--> Dependant [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
Every edge carries a confidence tag (EXTRACTED = explicit in the source, INFERRED = derived by resolution), so you can tell what was read directly from what was inferred. 每一条边都带有置信度标签(EXTRACTED = 源码中明确的,INFERRED = 通过解析得出的),因此你可以区分哪些是直接读取的,哪些是推断出来的。
graphify query "<question>" returns a scoped subgraph for a plain-language question, and graphify path A B traces how any two things connect.
graphify query "<question>" 会针对自然语言问题返回一个范围内的子图,而 graphify path A B 则会追踪两个事物是如何连接的。
What it does / 功能概览
| Capability | What you get |
|---|---|
| God nodes | The most-connected concepts, so you see what everything flows through |
| 上帝节点 | 连接最紧密的概念,让你看到所有事物的流向 |
| Communities | The graph split into subsystems (Leiden), with LLM-free labels |
| 社区 | 将图谱拆分为子系统(Leiden 算法),并带有无需 LLM 的标签 |
| Cross-file links | calls / imports / inherits / mixes_in resolved across ~40 languages via tree-sitter AST |
| 跨文件链接 | 通过 tree-sitter AST 在约 40 种语言中解析调用/导入/继承/混入关系 |
| Query, path, explain | Ask a question, trace the path between two things, or explain one concept, all against graph.json |
| 查询、路径、解释 | 针对 graph.json 提出问题、追踪路径或解释概念 |
| Rationale + doc refs | # NOTE: / # WHY: comments and ADR/RFC citations become first-class nodes linked to the code |
| 原理 + 文档引用 | # NOTE: / # WHY: 注释和 ADR/RFC 引用成为链接到代码的一等节点 |
| Beyond code | Docs, PDFs, images, and video/audio all map into the same graph |
| 超越代码 | 文档、PDF、图像和视频/音频全部映射到同一个图谱中 |
| Local-first | Code is parsed locally with tree-sitter (no LLM, nothing leaves your machine); only the semantic pass over docs/media calls a backend, and only if you configure one |
| 本地优先 | 代码通过 tree-sitter 在本地解析(无需 LLM,数据不出本地);仅在对文档/媒体进行语义分析时才会调用后端,且仅在你配置了后端的情况下才会触发 |
Prerequisites / 前置要求
- Python 3.10+
- uv (recommended / 推荐)
- pipx (alternative / 替代方案)
Install / 安装
Official package: The PyPI package is graphifyy (double-y). Other graphify* packages on PyPI are not affiliated. The CLI command is still graphify.
官方包:PyPI 包名为 graphifyy(双 y)。PyPI 上的其他 graphify* 包均与本项目无关。CLI 命令依然是 graphify。
Step 1 — install the package: 第一步 — 安装包:
# Recommended (isolated env; if 'graphify' isn't found after, run: uv tool update-shell):
# 推荐(隔离环境;如果安装后找不到 'graphify',请运行:uv tool update-shell):
uv tool install graphifyy
# Alternatives:
# 替代方案:
pipx install graphifyy
pip install graphifyy # may need PATH setup — see note below / 可能需要配置 PATH — 见下文说明
Step 2 — register the skill with your AI assistant: 第二步 — 将技能注册到你的 AI 助手:
graphify install
That’s it. Open your AI assistant and type /graphify.
这就完成了。打开你的 AI 助手并输入 /graphify。