@roarpeng/graphflow
Local-first memory & context harness for coding agents 适合使用 AI 辅助编程,需要本地 AST 索引和图压缩来管理上下文的用户。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Roarpeng/GraphFlowConfiguration
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:
| Option | Description |
|---|---|
graphPolicy.transport | file / memory / sqlite / auto (recommended: sqlite-first, falls back to file) / mcp-http |
graphPolicy.maxContextTokens | Context budget (default 1500) |
graphPolicy.autoIndexOnSave | Auto incremental index on save (default true) |
embeddingPolicy.provider | transformers (local default) / openai / hash |
embeddingPolicy.dtype | Local model precision: q8 (default, ~98MB) / fp16 / q4 / fp32 (~400MB); env GRAPHFLOW_EMBEDDING_DTYPE wins |
skillPolicy.enableSkillFlywheel | Learning flywheel switch |
reconcilePolicy.verifyCommand | Command 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-sqlite3or@huggingface/transformers; they are installed in the background into~/.graphflow/optional-depson first start (better-sqlite3 per node / Electron ABI). Manual:graphflow deps status,graphflow deps install [--with-model]. Opt out:GRAPHFLOW_OPTIONAL_DEPS_AUTO=0or the extension settinggraphflow.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 (newerupdatedAtwins; colliding dialogue turn ids are renumbered), the JSON is renamed to*.merged-bak, and stats land in*.merge-log.jsonand ingraphflow 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/modelsfor all hosts. graph index --fullkeeps memory. The memory subgraph is captured before the store is cleared and restored after re-indexing.