一个拥有 135K 星标的 GitHub 仓库,围绕着一个显而易见到令人无奈的想法构建: 你的编程智能体应该一次性绘制代码库的结构图,而不是永无止境地 grep 搜索。 Graphify 将整个项目转化为持久、可查询的知识图谱,AI 编程智能体可以用它来理解系统各部分之间的连接方式。 函数、类、文件、SQL 模式、基础设施配置、文档、PDF、图像和视频,都可以成为相互连接的节点,而不再是智能体必须重新发现的孤立上下文片段。 因此,不必再这样: → 搜索身份验证 → 打开十二个文件 → 沿着导入关系和函数调用追踪 → 随着上下文被填满而丢失线索 智能体可以问: > 身份验证与数据库之间通过什么连接? > 追踪从 UserService 到 DatabasePool 的路径。 > 解释 RateLimiter。 > 哪些组件在这个架构中处于核心位置? Graphify 返回的是相关的图谱关系和路径,而不是又一堆关键词匹配结果。 对于源代码,它的实现方式尤其有意思。 它使用 tree-sitter 在本地解析大约 40 种编程语言,提取函数、类、导入、调用、继承和跨文件关系。 构建代码图谱不需要嵌入、向量数据库或 LLM 调用。 文档和媒体的处理方式则不同。PDF、图像及其他非代码内容,可以使用配置好的模型,经过一个可选的语义提取步骤。 每个关系都带有一个置信度标签: → EXTRACTED:源材料中明确存在 → INFERRED:通过分析或解析推导得出 → AMBIGUOUS:存在不确定性,已标记为需要审查 Graphify 还使用社区检测来识别相关子系统,并突出显示那些连接度高、可能对整体架构很重要的节点。 但真正让它对编程智能体有用的,是图谱构建完成之后发生的事情。 Graphify 可与 Claude Code、Codex、Cursor、Gemini CLI、GitHub Copilot 以及另外超过 20 种助手集成。 根据平台不同,它会安装钩子或持久化指令,引导智能体先查询现有图谱,而不是反复搜索和读取源文件。 图谱可以提交到 Git,随着文件变化进行增量更新,并通过 MCP 对外提供。 它还支持结合图谱检查拉取请求,包括识别那些涉及相关图谱社区、可能需要更仔细审查的 PR。 这个本地工具会生成三项实用产物:交互式 HTML 图谱、Markdown 架构报告,以及可复用的 graph.json。 长上下文窗口能帮助编程智能体阅读更多代码。 持久化知识图谱则让它们能够在已经分析过的内容中导航。 随着编程智能体在大型仓库中工作的时间越来越长,避免反复摸索同一套架构也变得越来越有用。 GitHub 仓库在这里:https://github.com/Graphify-Labs/graphify
看原文
A 135K-star GitHub repo is built around one painfully obvious idea: Your coding agent should map the codebase once, not grep it forever. Graphify turns an entire project into a persistent, queryable knowledge graph that AI coding agents can use to understand how different parts of the system connect. Functions, classes, files, SQL schemas, infrastructure configurations, documentation, PDFs, images and videos can become connected nodes instead of isolated pieces of context the agent has to rediscover. So instead of: → Search for authentication → Open twelve files → Follow imports and function calls → Lose the trail as the context fills up The agent can ask: > What connects authentication to the database? > Trace the path from UserService to DatabasePool. > Explain RateLimiter. > Which components are central to this architecture? Graphify returns relevant graph relationships and paths, rather than another collection of keyword matches. For source code, the implementation is particularly interesting. It uses tree-sitter to parse approximately 40 programming languages locally, extracting functions, classes, imports, calls, inheritance and cross-file relationships. No embeddings, vector database or LLM calls are needed to construct the code graph. Document and media processing works differently. PDFs, images and other non-code content can go through an optional semantic extraction step using a configured model. Every relationship carries a confidence label: → EXTRACTED: Explicitly present in the source → INFERRED: Derived through analysis or resolution → AMBIGUOUS: Uncertain and flagged for review Graphify also uses community detection to identify related subsystems and highlights highly connected nodes that may be important to the overall architecture. But the part that makes this useful for coding agents is what happens after the graph is built. Graphify integrates with Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and more than 20 other assistants. Depending on the platform, it installs hooks or persistent instructions that encourage the agent to query the existing graph before repeatedly searching and reading source files. The graph can be committed to Git, updated incrementally as files change, and exposed through MCP. There's also support for examining pull requests against the graph, including identifying PRs that touch related graph communities and may need closer review. The local tool produces three useful artifacts: an interactive HTML graph, a Markdown architecture report and a reusable graph.json. Long context windows help coding agents read more code. A persistent knowledge graph gives them a way to navigate what they've already analyzed. And as coding agents spend more time working inside large repositories, avoiding repeated discovery of the same architecture becomes increasingly useful. Here's the GitHub Repo: https://github.com/Graphify-Labs/graphify