开源 graphloom:离线把仓库织成编码智能体可查询的知识图谱
graphloom 将代码、SQL、文档与配置离线建成知识图谱,经 MCP 向 Claude Code、Cursor 等返回带 file:line 证据的短答案,减少智能体整文件翻找消耗的 token。
编码智能体回答「谁动了 invoices 表」时,常常靠反复 grep 打开几十个文件,既耗 token 又容易漏掉跨模块调用。开发者发布开源项目 graphloom(MIT):把仓库里的代码、SQL、文档、配置 离线 织成知识图谱,构建号称可在一秒内完成;智能体通过 path / query / explain 拿到带 file:line 证据的短结果,而不是整文件塞进上下文。对接面支持 Claude Code 与 Cursor 的 MCP。
仓库结构包含 src/graphloom、示例与测试;graphloom build 会遍历仓库并在 .graphloom/ 下写出版本化图(graphloom.graph/v1),边带 provenance。作者同时推广自家 API 网关 AtmoRouter,但图谱工具本身可单独使用。
对软件研发智能化,这是把「仓库地图」从临时检索变成可复用工件;图谱新鲜度、语言/框架覆盖与错误边仍是落地关键,需要与 CI 重建策略一起设计。
和临时 RAG 不同,图谱是仓库的结构化索引:边带 provenance,查询返回定位证据,更适合架构问答与影响分析。团队可将其挂到 CI,在主分支变更后重建 .graphloom/,避免智能体读到过期边。MCP 适配降低了接入 Claude Code、Cursor 的成本,但 SQL 方言、生成代码与大型 monorepo 的切分策略仍需按仓配置。作者捆绑的 API 网关是可选商业路径,不妨碍单独采用图谱组件。
graphloom offline knowledge graph for coding agents
Your AI coding agent just read 40 files to answer "what touches the invoices table?"
Grep, open, scroll, grep again. Thousands of tokens burned on context it throws away, and it still misses the function two modules over.
So I built graphloom, free and open source.
It turns your repo (code, SQL, docs, config) into a knowledge graph, offline, in under a second. Your agent asks path/query/explain and gets a few lines with file:line evidence instead of whole files. Works from Claude Code and Cursor over MCP. https://github.com/bayuh85/graphloom
Runs on AtmoRouter, a cheap AI API gateway and OpenRouter alternative: 150 models, one OpenAI/Anthropic-compatible key, pay per token, avg 91.2% below official prices. https://atmorouter.dev