Roarpeng/GraphFlow

Local-first code knowledge graph and context harness for coding agents. MCP + DeepSeek Harness (dsh) plugin.

Project Overview项目介绍

GraphFlow is a local-first memory and context harness for coding agents that builds an AST-based code knowledge graph and offers bounded context compression and a cross-session learning flywheel. It is exposed to agents through the Model Context Protocol (MCP), and works with over 15 different coding agent platforms including DeepSeek Harness, Cursor, Claude Code, and Kimi Code CLI. It ships as a portable npm package that can be installed via npm install @roarpeng/graphflow, and also includes a standalone CLI and an official VS Code extension. It can run fully offline with no external API key required to work.

GraphFlow solves key problems with existing memory solutions for long-lived coding projects that change over time. Static rule injection wastes tokens every session and grows until it is ignored entirely, while plain RAG never accumulates task experience from past work. GraphFlow uses layered L0-L3 compression to fit within a fixed token budget, only pulling the exact context needed for the current task. It automatically captures outcomes from agent runs and writes learned skills and experience back to memory, so it improves over repeated use on the same project. It also includes built-in memory poisoning protection that treats externally imported skills as unproven until validation.

The project is fully open source under the permissive Apache-2.0 license, and includes a complete, reproducible benchmark suite with all results pinned to specific code commits. It requires Node.js 20 or higher and npm 10 or higher to run locally, and includes 961 passing tests to confirm core functionality works as expected. Users can install it via the npm command npm install @roarpeng/graphflow, and run the proof of concept learning flywheel with npm run proof:flywheel. All benchmarks can be re-run independently by public third parties to verify the published results.

GraphFlow 是一个面向编程代理的本地优先记忆与上下文引擎,核心功能是为项目构建支持12种语言的AST代码知识图谱,实现分层上下文压缩,提供带自动验证的技能学习飞轮。它通过MCP协议对外暴露能力,支持包括DeepSeek Harness、Cursor、Claude Code在内的15种以上代理平台,同时提供独立命令行工具和VS Code扩展。

开发者在长期迭代的项目中使用GraphFlow,可以避免静态规则注入或普通RAG方案带来的token浪费和无经验积累问题。它会自动捕获代理执行结果,把学到的技能、经验自动写回存储,每次请求仅检索当前任务需要的内容,在固定token预算内提供最相关的上下文,帮助代理随着项目推进持续提升表现。

它使用纯TypeScript/Node开发,要求Node.js版本不低于20,npm不低于10,完全离线运行,不需要外部API密钥。项目遵循Apache-2.0开源协议,包含完整可复现的基准测试,所有结果都绑定到具体代码提交,支持第三方独立复现验证。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 15 stars - an early-stage project星标 15,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add @roarpeng/graphflow

把 Roarpeng/GraphFlow 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

GraphFlow

English | 中文

npm version DeepSeek Harness MCP

The memory & context harness for coding agents. Local-first code knowledge graph · bounded context compression (truly bounded responses: the package plus history echoes, which ship as short previews only; 95.6% fewer tokens than reading the top-10 files in full — a token ratio, not an answer-quality measure, see both baseline arms) · cross-session learning flywheel.

The community is converging on an "agent harness" vocabulary: memory + hooks + skills are the harness primitives that turn a stateless model into a reliable long-running agent. GraphFlow implements all three for coding agents and ships them through a portable MCP surface (Cursor, Claude Code, 15+ agents):

Harness primitive GraphFlow implementation
Memory Code graph (10 tree-sitter grammar languages incl. C/C++; TypeScript/JavaScript via the TypeScript compiler — optional dependency, falls back to regex extraction with reduced symbol detail when absent; plus regex-based Markdown) + Episodic / Skill / Decision nodes — project knowledge and project experience persist across sessions
Hooks Outcome auto-capture (on by default) + Claude Code SessionEnd / Stop and DeepSeek Harness agent/disposed glue close the learning loop automatically — no manual outcome reporting required
Skills A four-class flywheel (proven / correctable / anti-pattern / noise) with canary validation — skills are promoted by evidence, not by assertion

Pure TypeScript/Node. CLI + MCP + VS Code extension. Local-first: indexing, compression and recall need no API key; the default semantic-embedding backend downloads its model from huggingface.co once (on failure it degrades to a fully offline hash backend; set embeddingProvider: "fnv" to never touch the network).

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev govard 下一个 Next dsh-memory-eternal →