商业产业 Hacker News Agent 2026-10-14T15:00 正文 ok 1863 words

Show HN:Graphicle——为编程 Agent 提供记忆的 Graphify Rust 移植版

英文标题:🔶 Show HN: Graphicle, a Rust port of Graphify with memory for coding agents

Graphicle 是一个用 Rust 编写的本地工具,可将代码仓库构建为代码图谱,并保存项目文档、决策记录和历史 Agent 会话,为 Claude Code、Cursor、Codex 等编程 Agent 提供带文件与行号引用的上下文。它无需 API key、账号或遥测,可通过单个 SQLite 数据库、一个 MCP server、命令行和 Web 应用完成图谱检索、记忆管理与会话捕获。项目称,在约 3.1 万文件的 Kubernetes 仓库测试中,Graphicle 0.1.0 的纯代码抽取耗时 3 分 18 秒,而 Graphify 0.9.88 为 26 分 38 秒。对开发者而言,Graphicle 的核心价值在于减少 Agent 重复阅读代码的成本,并让检索结果、项目记忆和变更影响分析均可追溯与本地运行。
打开原文相关 6 · 机会 1
media4.3 KB media6.8 KB media6.8 KB media1.3 KB media1.3 KB media1.3 KB media3.1 KB media7.1 MB media30.9 KB media30.9 KB media119.7 KB media119.7 KB media78.8 KB

中文

Graphicle

将代码图谱与记忆整合到一个 Rust 程序中,服务你的编程 Agent。

许可证:Apache-2.0 最新版本 平台:macOS 和 Linux 在 Discord 上聊天

Graphicle 会将你的仓库映射为代码图谱,记住项目文档、决策和过去的 Agent 会话,并向编程 Agent 提供两类内容中带引用的摘录:精确到文件及行号。它在你的本机运行:无需 API key、无需账号、没有遥测。
适用于 Claude Code · Cursor · Codex · VS Code · Claude Desktop · 任意 MCP 客户端

快速开始 · 工作原理 · 基准测试 · 文档 · 从 Graphify 迁移? · 讨论区

四步完成终端操作。graphicle setup 同步一个小型仓库,构建其代码图谱,发现五个 Agent 客户端,连接它们并列出其修改的所有文件。graphicle ask 返回四段带引用的摘录,第一段为 shop/pricing.py 第 1 至 7 行,price_with_tax()。完成编辑后,graphicle context 会在回答前同步变更文件。graphicle doctor 显示 18 项检查通过,并给出一项警告:未设置回答模型。

brew install graphicle-ai/tap/graphicle
cd your-repo
graphicle setup

没有 Homebrew?curl -fsSL <https://github.com/graphicle-ai/graphicle/releases/latest/download/install.sh> | sh · 发行归档 · 其他安装方式
Windows:暂时没有原生构建版本;在 WSL2 下,Linux 安装方式应可运行(尚未测试)。原生 Windows 支持已在规划中。

graphicle setup 会索引仓库、构建代码图谱,并连接发现的编程 Agent。它还会启用会话捕获,让 Claude Code 的搜索优先使用代码图谱,在 AGENTS.md 中添加一个简短章节,并安装用于保持项目最新状态的 Git hooks。它会列出所修改的每一个文件,并先为每个文件创建备份;graphicle disconnect 可撤销全部操作。

随后,让你的 Agent “使用 graphicle 查找失败请求在哪里重试”,或直接在终端中提问:

$ graphicle ask "where is tax added to prices?"
Evidence for "where is tax added to prices?"
4 excerpts · 598 of 3,000 tokens

[1] shop/pricing.py:1-7  price_with_tax()
    """Prices and tax."""
    TAX_RATE = 0.2


    def price_with_tax(price):
        """A price with the sales tax added."""
        return round(price * (1 + TAX_RATE), 2)

真实输出,已在第一段摘录后截断。未配置模型时,ask 会显示证据;graphicle config set model anthropic(或 openai、ollama)可加入书面回答。

让你的编程 Agent 安装它

将以下内容粘贴到 Claude Code、Codex 或 Cursor:

Install Graphicle with `brew install graphicle-ai/tap/graphicle` (or, without Homebrew,
`curl -fsSL https://github.com/graphicle-ai/graphicle/releases/latest/download/install.sh | sh`),
then run `graphicle setup --yes` in this repository and list every file it changed.
你想要做的事 运行命令
为编程 Agent 提供代码图谱和项目记忆 在仓库中运行 graphicle setup
从终端提问 graphicle ask "how are failed requests retried?"
浏览图谱、源内容和记忆 graphicle open
查看对某个符号的变更会影响什么 graphicle graph extract . --code-only,然后执行 graphicle graph affected "retry()"
检查一切是否正常 graphicle doctor
撤销 setup 所做的一切 graphicle disconnect
从 Graphify 迁移,或为团队运行服务器 从 Graphify 迁移 · 团队服务器
  • 原生且快速。 一个 Rust 程序。在 Kubernetes(3.1 万个文件)上,0.1.0 引擎完成纯代码抽取耗时 3 分 18 秒,而 Graphify 0.9.88 耗时 26 分 38 秒;两者构建的是同一个图谱(各进行一次探索性运行,使用同一台 Linux 主机、相同的 16 个 CPU 和 8 个 worker)。
  • 提供上下文,而非重复阅读。 Agent 向 Graphicle 发问,即可在 token 预算内获得相关代码、文档和决策的带引用摘录。
  • 答案可核查。 每段摘录都会标出其文件和行号。Agent 提出的记忆需要等待你的批准。
  • 一个程序,而非一套技术栈。 代码图谱、记忆、一个 MCP server、Web 应用和命令行工具均通过一次安装提供,使用一个 SQLite 文件。无需 Python、Docker 或数据库服务器。
  • 本地且私密。 无需账号,也没有遥测。除非你主动要求,否则不会有任何内容离开你的机器。

Kubernetes,约 31,000 个文件。越短越快。纯代码抽取:Graphicle 0.1.0 为 3 分 18 秒;Graphify 0.9.88 为 26 分 38 秒。各运行一次,Linux,相同的 16 个 CPU、8 个 worker。两者均构建了同一个图谱:256,329 个节点和 1,400,392 条边。

  • 代码图谱。 文件、函数、类、调用和导入均通过 tree-sitter 解析,不使用模型。graphicle graph 可搜索图谱、解释符号、追踪路径,并导出交互式 HTML 图谱。执行 graphicle graph extract . --code-only 后,graphicle graph affected "retry()" 会列出依赖某个符号的内容。
  • 项目记忆。 文档(Markdown、PDF、Office、HTML)、经审查的决策和流程,以及过去的 Claude Code 和 Codex 会话,均可与代码一起搜索。
  • 在预算内提供带引用上下文。 graphicle context 和 MCP 工具在不调用模型的情况下,会在 token 预算内返回带来源的摘录。
  • 一个 MCP server。 graphicle mcp 提供代码图谱工具,使用 Graphify 的工具名称,例如 query_graph、get_neighbors 和 shortest_path,同时提供记忆工具。
  • 与代码关联的记忆。 经审查的记忆会关联到其所描述的函数:当对应代码变更时,记忆会过期;而文件其他位置的编辑通常不会使其过期(精确规则)。文档中对代码的提及会关联到其命名的定义(graphicle call graph.doc_links 可列出它们)。
  • 跨仓库。 记忆检索可跨越工作区中的多个仓库:使用 graphicle context --workspace,或使用工作区 MCP endpoint。
  • 始终保持最新。 每次回答前,Graphicle 会同步你改动的少量文件;Git hooks 会在每次 commit、merge 和 checkout 后同步。
  • 无需重复说明。 会话捕获会保存每个已完成的轮次;每次新会话均从你审查过的记忆和最新轮次开始。
  • 一个应用。 graphicle open 会在浏览器中显示图谱、源内容和记忆。你也可在其中批准记忆。

graphicle setup 会通过 MCP 连接其发现的所有客户端。每个文件都会备份一次为 <file>.graphicle-bak,而 graphicle disconnect 会移除它添加的内容。

客户端 setup 的连接位置 会话捕获
Claude Code 仓库中的 .mcp.json .claude/settings.local.json 中的 hooks
Codex ~/.codex/config.toml ~/.codex/hooks.json 中的 hooks(Codex 会要求你信任它们)
Cursor ~/.cursor/mcp.json
VS Code 仓库中的 .vscode/mcp.json
Claude Desktop Claude 设置文件夹中的 claude_desktop_config.json
其他任意 MCP 客户端 一个简短的 JSON 条目(MCP)

Graphicle 的工作方式:你的代码、文档和 Agent 会话会同步至一个程序,该程序维护代码图谱和记忆。编程 Agent 通过 MCP 使用它;你则通过 graphicle ask 和 graphicle open 使用它。每次回答前都会同步变更文件。无需账号、没有遥测;除非你主动要求,否则不会有任何内容离开你的机器。

  1. 同步。 Graphicle 读取文件夹(遵守 .gitignore 并跳过敏感信息),保存每份源代码的版本化副本,并构建代码图谱。
  2. 检索。 当 Agent 调用工具时,Graphicle 会同步变更内容,从代码、文档、会话和经审查的记忆中对摘录进行排序,并附带引用返回。工具本身不会调用模型;Agent 自己的模型会阅读这些摘录。
  3. 记忆。 被捕获的会话会成为来源。Agent 提出的记忆需要在应用中等待你的批准。

Graphicle,或者“代码图谱工具加记忆服务器”

| 代码图谱工具 + 记忆服务器 | Graphicle
---|---|---
安装 | 两个工具,通常使用不同的运行时,且往往需要数据库服务器 | 一次安装
连接 Agent | 在每个 Agent 中分别配置每个工具 | graphicle setup 会连接其发现的 Agent;graphicle disconnect 可撤销操作
Agent 中的 MCP servers | 两个,分别配置 | 一个,同时提供图谱和记忆工具
存储 | 图谱文件加记忆服务器的数据库 | 一个数据文件夹中的一个 SQLite 文件
代码结构:调用、导入、影响分析 | 图谱工具 | graphicle graph
文档、决策、过去的会话 | 记忆服务器 | 内置
引用与审查 | 各不相同 | 每段摘录均提供文件和行号;Agent 记忆需等待批准

速度。 上图展示的是:Kubernetes(3.1 万个文件)上,0.1.0 引擎(一个基于发布版源代码构建的 Linux 测试版本)与 Graphify 0.9.88 的对比;各进行一次探索性运行,两者均构建同一个图谱(Kubernetes 测试)。更早之前,在 Django 上,一个预发布版本完成纯代码抽取耗时 7.5 秒,而 Graphify 0.9.77 为 72.8 秒(五轮交替运行的中位数,使用同一台 Linux 主机和 8 个 worker),两者同样构建了相同图谱(10 月 8 日记录)。

记忆。 在与七个记忆系统的比较中,所有系统的结果评分前即完成注册,并使用同一个开放模型作为各系统的读取器和评审器;Graphicle 的预发布版本在三个开发数据集上不落后于任何系统。所有得分、方法及注意事项。

  • 一个数据文件夹。 你的来源、记忆和 setup 构建的代码图谱均存放在一个 SQLite 存储中:macOS 路径为 ~/Library/Application Support/Graphicle,Linux 路径为 ~/.local/share/graphicle。graphicle graph extract 会将其图谱文件写入项目中的 .graphicle/。
  • 默认仅回环访问。 应用及其 HTTP 和 MCP endpoints 均监听 127.0.0.1。
  • 无遥测、无需账号。 Graphicle 仅在你主动要求时连接网络:包括你配置的模型或连接器、完整的 graphicle graph extract(它会将文档和图片发送至其找到 API key 的 LLM)、供 graphicle graph add、clone 及图谱服务器 pull request 工具使用的 GitHub CLI,以及使用你指定 feed 的 graphicle update。从源代码构建时,也会一次性下载解析器源代码。详细说明
  • 谨慎同步。 sync 会遵守 .gitignore,并跳过 .env 文件、密钥和凭据。会话捕获会丢弃 <private>…</private> 范围内的内容,并对凭据进行脱敏。
  • 可追溯的遗忘。 删除一条记忆或一个捕获的会话,也会删除从中派生的内容,并且你会收到一份哈希链式删除凭证。

我需要 API key 或模型吗?

对于大多数功能,不需要。代码图谱(配合 --code-only)、同步、context、MCP server、会话捕获和应用均无需 API key 或模型。模型用于编写 graphicle ask 的回答、根据来源提出记忆建议,以及在完整 graphicle graph extract 中阅读文档和图片。可使用通过 Ollama 提供的本地模型,或任意 OpenAI 兼容服务器(配置)。

Graphicle 是 Graphify 的 fork 吗?

代码图谱引擎是 Graphify 的 Rust 移植版,会与 Graphify 的发行版本保持同步,并在其文件头和 NOTICE 中注明归属。一致性检查会标明其跟随的发布版本。记忆、记忆工具、应用和会话捕获均不是 Graphify 的组成部分。从 Graphify 迁移?graphicle setup 会提议切换仓库,备份每个文件,并且绝不会删除……

English / 原文

Graphicle

Code graph and memory for your coding agents, in one Rust program.

License: Apache-2.0 Latest release Platforms: macOS and Linux Chat on Discord

Graphicle maps your repository into a code graph, remembers your project's docs, decisions and past agent sessions, and gives your coding agent cited excerpts from both: the exact files and lines. It runs on your machine: no API key needed, no account, no telemetry.
Works with Claude Code · Cursor · Codex · VS Code · Claude Desktop · any MCP client

Quick start · How it works · Benchmarks · Docs · Coming from Graphify? · Discussions

A terminal in four steps. graphicle setup syncs a small repository, builds its code graph, finds five agent clients, connects them and lists every file it changed. graphicle ask returns four cited excerpts, the first shop/pricing.py lines 1 to 7, price_with_tax(). After an edit, graphicle context syncs the changed file before answering. graphicle doctor shows 18 checks passing and one warning: no answer model is set.

brew install graphicle-ai/tap/graphicle
cd your-repo
graphicle setup

No Homebrew? curl -fsSL <https://github.com/graphicle-ai/graphicle/releases/latest/download/install.sh> | sh · Release archives · Other ways to install
Windows: no native build yet; under WSL2 the Linux install should work (not yet tested). Native Windows support is planned.

graphicle setup indexes the repository, builds its code graph and connects the coding agents it finds. It also turns on session capture, points Claude Code's searches to the code graph first, adds a short section to AGENTS.md and installs Git hooks that keep the project current. It lists every file it changes and backs each one up first; graphicle disconnect undoes it all.

Then ask your agent to "use graphicle to find where failed requests are retried" , or ask from the terminal:

$ graphicle ask "where is tax added to prices?"
Evidence for "where is tax added to prices?"
4 excerpts · 598 of 3,000 tokens

[1] shop/pricing.py:1-7  price_with_tax()
    """Prices and tax."""
    TAX_RATE = 0.2


    def price_with_tax(price):
        """A price with the sales tax added."""
        return round(price * (1 + TAX_RATE), 2)

Real output, cut after the first excerpt. With no model configured, ask shows the evidence; graphicle config set model anthropic (or openai, ollama) adds written answers.

Let your coding agent install it

Paste this into Claude Code, Codex or Cursor:

Install Graphicle with `brew install graphicle-ai/tap/graphicle` (or, without Homebrew,
`curl -fsSL https://github.com/graphicle-ai/graphicle/releases/latest/download/install.sh | sh`),
then run `graphicle setup --yes` in this repository and list every file it changed.
You want to Run
Give your coding agent the code graph and your project's memory graphicle setup in the repository
Ask a question from the terminal graphicle ask "how are failed requests retried?"
Browse the graph, the sources and the memory graphicle open
See what a change to a symbol touches graphicle graph extract . --code-only, then graphicle graph affected "retry()"
Check that everything works graphicle doctor
Undo everything setup did graphicle disconnect
Move from Graphify, or run a server for a team Moving from Graphify · Team server
  • Native and fast. One Rust program. On Kubernetes (31k files), the 0.1.0 engine ran a code-only extract in 3 min 18 s, against 26 min 38 s for Graphify 0.9.88, and built the same graph (one exploratory run each, one Linux host, the same 16 CPUs, 8 workers).
  • Context, not re-reading. Your agent asks Graphicle and gets the relevant code, docs and decisions as cited excerpts, within a token budget.
  • Answers you can check. Every excerpt names its file and lines. Memories an agent proposes wait for your approval.
  • One program, not a stack. The code graph, the memory, one MCP server, the web app and the command line come in one install, with one SQLite file. No Python, Docker or database server.
  • Local and private. No account and no telemetry. Nothing leaves your machine unless you ask.

Kubernetes, about 31,000 files. Shorter is faster. Code-only extract: Graphicle 0.1.0, 3 minutes 18 seconds; Graphify 0.9.88, 26 minutes 38 seconds. One run each, Linux, the same 16 CPUs, 8 workers. Both built the same graph: 256,329 nodes and 1,400,392 edges.

  • Code graph. Files, functions, classes, calls and imports, parsed with tree-sitter and no model. graphicle graph searches it, explains a symbol, traces a path and exports an interactive HTML graph. After graphicle graph extract . --code-only, graphicle graph affected "retry()" lists what depends on a symbol.
  • Project memory. Docs (Markdown, PDF, Office, HTML), reviewed decisions and procedures, and past Claude Code and Codex sessions, searchable alongside the code.
  • Cited context on a budget. graphicle context and the MCP tools return excerpts with their sources, within a token budget, without calling a model.
  • One MCP server. graphicle mcp serves the code-graph tools, under Graphify's tool names such as query_graph, get_neighbors and shortest_path, next to the memory tools.
  • Memory tied to your code. Reviewed memories are tied to the functions they are about: a memory goes stale when that code changes, and edits elsewhere in the file usually leave it current (the exact rule). Mentions of code in your docs are linked to the definitions they name (graphicle call graph.doc_links lists them).
  • Across repositories. Recall can span the repositories of a workspace: graphicle context --workspace, or the workspace MCP endpoint.
  • Always current. Before each answer Graphicle syncs the few files you changed; Git hooks sync after each commit, merge and checkout.
  • No re-explaining. Session capture keeps each finished turn, and each new session starts with your reviewed memories and the latest turns.
  • An app. graphicle open shows the graph, the sources and the memory in your browser. It is where you approve memories.

graphicle setup connects every client it finds over MCP. Each file is backed up once as <file>.graphicle-bak, and graphicle disconnect removes what it added.

Client Where setup connects it Session capture
Claude Code .mcp.json in the repository hooks in .claude/settings.local.json
Codex ~/.codex/config.toml hooks in ~/.codex/hooks.json (Codex asks you to trust them)
Cursor ~/.cursor/mcp.json
VS Code .vscode/mcp.json in the repository
Claude Desktop claude_desktop_config.json in Claude's settings folder
Any other MCP client a short JSON entry (MCP)

How Graphicle works: your code, documents and agent sessions sync into one program that keeps a code graph and a memory. Your coding agents use it over MCP; you use it with graphicle ask and graphicle open. Changed files sync before each answer. No account, no telemetry; nothing leaves your machine unless you ask.

  1. Sync. Graphicle reads the folder (it respects .gitignore and skips secrets), keeps a versioned copy of each source and builds the code graph.
  2. Recall. When your agent calls a tool, Graphicle syncs what changed, ranks excerpts from code, documents, sessions and reviewed memory, and returns them with citations. The tools call no model; your agent's own model reads the excerpts.
  3. Remember. Captured sessions become sources. Memories that agents propose wait for your approval in the app.

Graphicle, or a code-graph tool plus a memory server

| A code-graph tool + a memory server | Graphicle
---|---|---
Install | Two tools, often on different runtimes, and often a database server | One install
Connect your agents | Configure each tool in each agent | graphicle setup connects the agents it finds; graphicle disconnect undoes it
MCP servers in your agent | Two, configured separately | One, with the graph and the memory tools
Storage | Graph files plus the memory server's database | One SQLite file in one data folder
Code structure: calls, imports, impact | The graph tool | graphicle graph
Docs, decisions, past sessions | The memory server | Built in
Citations and review | Varies | A file and its lines on every excerpt; agent memories wait for approval

Speed. The chart above: Kubernetes (31k files), the 0.1.0 engine (a Linux test build of the release source) against Graphify 0.9.88, one exploratory run each, both building the same graph (Kubernetes run). Earlier, on Django, a pre-release build ran a code-only extract in 7.5 s against 72.8 s for Graphify 0.9.77 (medians of five alternating runs, one shared Linux host, 8 workers), both building the same graph (the 8 October record).

Memory. In a comparison with seven memory systems, registered before any answer was scored and run with one open model as every system's reader and judge, a pre-release build of Graphicle trails none on three development sets. Every score, with its method and caveats.

  • One data folder. Your sources, memories and the code graph that setup builds live in one SQLite store: ~/Library/Application Support/Graphicle on macOS, ~/.local/share/graphicle on Linux. graphicle graph extract writes its graph file to .graphicle/ in the project.
  • Loopback by default. The app and its HTTP and MCP endpoints listen on 127.0.0.1.
  • No telemetry, no account. Graphicle connects to the network only when you ask it to: a model or a connector you configure, a full graphicle graph extract (it sends documents and images to the LLM whose API key it finds), the GitHub CLI for graphicle graph add, clone and the graph server's pull-request tools, and graphicle update with a feed you name. A build from source also downloads the parser sources once. Details
  • Careful sync. sync respects .gitignore and skips .env files, keys and credentials. Session capture drops <private>…</private> spans and redacts credentials.
  • Forgetting with a receipt. Deleting a memory or a captured session also removes what was derived from it, and you get a hash-chained deletion receipt.

Do I need an API key or a model?

No, for most of it. The code graph (with --code-only), sync, context, the MCP server, session capture and the app work without one. A model writes the answers of graphicle ask, proposes memories from sources and reads documents and images in a full graphicle graph extract. Local models through Ollama or any OpenAI-compatible server work (configuration).

Is Graphicle a fork of Graphify?

The code-graph engine is a Rust port of Graphify, kept in step with Graphify's releases and credited in its file headers and in NOTICE. The parity checks name the release it follows. The memory, the memory tools, the app and session capture are not part of Graphify. Coming from Graphify? graphicle setup offers to switch a repository, backs up each file and never deletes graphify-out/ (Moving from Graphify).

Will it handle my large repository?

By default a project can hold up to 100,000 text files and 1 GiB of text; you can raise both (see Limits in docs/configuration.md). A very large file is analysed in part or kept as searchable text instead of stopping a sync.

Is there a version for teams?

Graphicle is free and open source under Apache-2.0, for individuals and teams alike. A commercial edition for teams is in private preview. To talk to us, start a discussion: https://github.com/graphicle-ai/graphicle/discussions, or chat with us on Discord.

What is the licence?

Graphicle is Apache-2.0: free to use, change and ship, commercially too. Third-party parts keep their own licences, listed in NOTICE.

More answers: FAQ · Troubleshooting · or run graphicle doctor.

Quick start · Agents · MCP · Install · Configuration · Team server · Moving from Graphify · Benchmarks · FAQ · Changelog

The code: crates/graphicle/ (the program: command line, app, HTTP and MCP server), crates/graphicle-graph/ (the code-graph engine), crates/graphicle-memory/ (the memory library), SDKs for Python and TypeScript, and a team server recipe in deploy/. Each crate builds on its own (building from source).

Contributions are welcome under the Apache License 2.0, with a Developer Certificate of Origin sign-off (git commit -s) and no CLA. See CONTRIBUTING.md. To report a security problem, follow SECURITY.md rather than opening a public issue.

Graphicle is licensed under the Apache License 2.0. Copyright 2026 KarLex AI, Inc.

The code-graph engine is a Rust port of Graphify by Safi Shamsi and the Graphify contributors, licensed under Apache-2.0, with portions that remain available under the MIT License. Thank you. NOTICE, NOTICE.md and the licenses/ folders hold the attributions and the licences of every adapted project and third-party component.

If Graphicle saves your agent a search, star the repository so other developers find it.
Try it · Report a bug · Contribute · Discord
Built by KarLex AI