Roarpeng/GraphFlow ↗★ 14

@roarpeng/graphflow

为编程智能体提供本地优先的记忆与上下文管理 适合使用 AI 辅助编程,需要本地 AST 索引和图压缩来管理上下文的用户。

包名
@roarpeng/graphflow
兼容性
待验证
版本
2.0.0
许可证
Apache-2.0
最近更新
2026年9月30日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Roarpeng/GraphFlow

Configuration

Three-layer merge: global ~/.graphflow.config.json → project graphflow.config.json → project .graphflow/config.json. Copy graphflow.config.example.json to get started.

Key options:

OptionDescription
graphPolicy.transportfile / memory / sqlite / auto (recommended: sqlite-first, falls back to file) / mcp-http
graphPolicy.maxContextTokensContext budget (default 1500)
graphPolicy.autoIndexOnSaveAuto incremental index on save (default true)
embeddingPolicy.providertransformers (local default) / openai / hash
embeddingPolicy.dtypeLocal model precision: q8 (default, ~98MB) / fp16 / q4 / fp32 (~400MB); env GRAPHFLOW_EMBEDDING_DTYPE wins
skillPolicy.enableSkillFlywheelLearning flywheel switch
reconcilePolicy.verifyCommandCommand whose exit code closes pending episodes (graphflow reconcile outcomes --apply); unset means report-only — a commit is never treated as a pass

Switching agents on one project

Cursor, ZCode, Cline, Claude Code and DSH working on the same project share one graph and memory: every host reads and writes graphflow-out/graphflow-graph.sqlite and its incremental index manifest (.graphflow-cache/index-state.sqlite.json), so switching tools never rebuilds the graph and dialogue turns, workbench topics, episodes and skills carry over.

  • Runtime deps on demand. The VSIX / shared MCP runtime does not bundle better-sqlite3 or @huggingface/transformers; they are installed in the background into ~/.graphflow/optional-deps on first start (better-sqlite3 per node / Electron ABI). Manual: graphflow deps status, graphflow deps install [--with-model]. Opt out: GRAPHFLOW_OPTIONAL_DEPS_AUTO=0 or the extension setting graphflow.downloadRuntimeDeps.
  • Legacy JSON stores are merged. Older hosts without better-sqlite3 fell back to graphflow-graph.json, splitting memory across two stores. When the SQLite store opens next to a JSON store, its memory is merged in (newer updatedAt wins; colliding dialogue turn ids are renumbered), the JSON is renamed to *.merged-bak, and stats land in *.merge-log.json and in graphflow diagnose → graphStore.
  • Embedding fingerprints. Each vector records its model (Xenova/bge-base-zh-v1.5@q8, fnv1a-384, …). Recall only compares vectors from the active model; index runs re-embed stale vectors in batches, and a transient fallback to hash never overwrites semantic vectors. The model is cached once in ~/.graphflow/models for all hosts.
  • graph index --full keeps memory. The memory subgraph is captured before the store is cleared and restored after re-indexing.