Roarpeng/GraphFlow
Local-first code knowledge graph and context harness for coding agents. MCP + DeepSeek Harness (dsh) plugin.
This is a DeepSeek Harness (DSH) plugin. Review its GitHub README, installation information, maintenance status, and public security signals here.
GraphFlow
English | 中文
给编程 Agent 用的记忆与上下文 harness。 本地优先的代码知识图谱 · 有界上下文压缩(约 98% token 节省) · 跨会话学习飞轮。
GraphFlow 把 记忆 + hooks + skills 做成可移植的 MCP 表面(Cursor、Claude Code、DeepSeek Harness、15+ Agent),让无状态模型变成可长期工作的编码助手。纯 TypeScript/Node,CLI + MCP + VS Code 扩展,完全离线,无需 API Key。
快速开始
npx @roarpeng/graphflow graph index .
npx @roarpeng/graphflow context preview "orchestrator" --json
npx @roarpeng/graphflow install # 自动接入已检测到的 Agent(含 dsh)
MCP 入口:
{
"mcpServers": {
"graphflow": {
"command": "npx",
"args": ["-y", "--package=@roarpeng/graphflow", "graphflow-mcp"]
}
}
}
Agent 应先调 graphflow_context 拿压缩上下文,再视需要调用 graphflow_plan。没有 LLM API Key 时会桥接到宿主 Agent(agent-delegated)。
工作台脉络(v1.9.14)
日常 Chat 仍是单线。复杂任务用 graphflow_plan 播种功能主题容器(画布上是计划步骤,不是一轮一节点)。点击节点,把 topicId 传给 graphflow_context 即可在该功能上继续或回到主线。问法跑偏会 Fork 孤立旁支,主线不被刷脏。答完再调 graphflow_context({ assistantReply }) 回填原文。树上的标题只用于显示;下一轮必读是 Goal + 祖先标题 + 该节点原文 Q/A。
按需唤醒(仍是 10 个 MCP 工具,不新增):
graphflow workbench tree --json
# VS Code / Cursor:GraphFlow: Workbench Tree(活动栏默认收起)或 Chat /tree
# MCP:graphflow_diagnose → graph.workbenchOutline
graphflow context preview --topic-id "<topic:...>" "在此节点继续"
graphflow context preview --reply "助手原文回答"
DeepSeek Harness 插件
GraphFlow 本身就是一个 dsh 插件包(topic:dsh-plugin)。package.json 声明 dsh.bundle,根目录 cordis.patch.yml 把 GraphFlow MCP 插入 Harness 的插件树。
能力
| 能力 | 说明 | dsh 工具名 |
|---|---|---|
| 压缩上下文 | 查询 → 锚点 + 摘要;按 anchorId 展开 | mcp__graphflow__graphflow_context |
| 任务规划 | simple / insight;无 LLM 时桥接宿主 | mcp__graphflow__graphflow_plan |
| 桥接执行包 | 规划 + 压缩上下文,不代跑代码 | mcp__graphflow__graphflow_run |
| 结果回填 | 关闭技能飞轮 | mcp__graphflow__graphflow_report_outcome |
| ATP Insight | submit / merge | mcp__graphflow__graphflow_insight |
| 建图 | 增量 / 单文件 / 全量重建 | mcp__graphflow__graphflow_index |
| 技能洞察 | 历史任务沉淀的 skill | mcp__graphflow__graphflow_skill_insights |
| 诊断 | 图谱、路由、token 节省、飞轮健康 | mcp__graphflow__graphflow_diagnose |
| 产物 | 图谱 import / export | mcp__graphflow__graphflow_artifact |
| 技能指南 | 给已连接 Agent 的用法说明 | mcp__graphflow__graphflow_skill_guide |
核心价值:本地 AST 知识图谱、L1–L3 分层压缩(实测约 98% token 节省)、跨会话 Episodic / Skill 飞轮。GraphFlow 不执行代码,只给宿主 Agent 压缩上下文和计划。
安装
方式 A:装进某个 profile(推荐)
dsh plugin --profile web add @roarpeng/graphflow
dsh --profile web
方式 B:home 级 overlay(所有 profile 生效)
先有 $DSH_HOME(默认 ~/.dsh),再执行:
npx @roarpeng/graphflow install
会写入:
| 路径 | 作用 |
|---|---|
$DSH_HOME/cordis.patch.yml | 插入 mcp-graphflow 行(stdio 拉起 graphflow-mcp) |
$DSH_HOME/skills/graphflow/SKILL.md | Skill 目录,教模型何时、如何调用上述工具 |
开发态也可:
dsh plugin --profile web add /absolute/path/to/GraphFlow
用法
- 任何读代码、改代码、排错之前,先调
mcp__graphflow__graphflow_context,并传入当前仓库绝对路径rootDir。 - 用返回的
summary/anchors/tokenBudget当第一上下文;不够再按anchorId展开。 - 跨多文件或范围不清时,再调
graphflow_plan;结果里的workbench.topics是功能节点。之后可用topicId细化,或graphflow_diagnose.graph.workbenchOutline/graphflow workbench tree唤醒脉络树。 - 改完文件后调
graphflow_index(单文件可传filePath)。 - 若走了
graphflow_run,结束后必须graphflow_report_outcome(episodeId+success)。 - 回答用户后应再调
graphflow_context({ assistantReply })回填原文。 - 中文问题请同时传
englishQuery(英文文件名 / 符号名),不要只用泛化中文词检索。
不要在 cordis.patch.yml 里写死 GRAPHFLOW_WORKSPACE_ROOT。
卸载
npx @roarpeng/graphflow uninstall
# 若只从某个 profile 移除 bundle:
dsh plugin --profile web remove @roarpeng/graphflow
其它安装路径
| 路径 | 适用 |
|---|---|
Agent Plugins 1.0(plugin.json + mcp.json + skills/) | Cursor 等支持插件清单的宿主 |
npx @roarpeng/graphflow install | Rules / 多 Agent / 非插件宿主(含 dsh overlay) |
| VS Code / Cursor 扩展 | Open VSX:roarpeng.graphflow |
更多
Security & install evidence
This score is based solely on public repository metadata and the install evidence registered here — it is not a code security audit.
From a public plugin catalog, linked to a public GitHub repository.
No license detected in GitHub metadata.
Code updates within the last 180 days.
No verifiable install metadata registered yet — please review the repository instructions manually.
Detected postinstall, prepare — review the scripts before installing.
missing-licenselifecycle-scripts