返回目錄

graph-memory

編輯精選維護狀態: 活躍

adoresever/graph-memory

Deepseek Harness、Openclaw知識圖譜記憶外掛。2026年4月受邀釋出在清華大學討論會。Knowledge Graph + Memory;Knowledge Graph Context Engine for OpenClaw — extracts structured triples from conversations, compresses context 75%, enables cross-session experience reuse

前往 GitHub
$ git clone https://github.com/adoresever/graph-memory.git && cd graph-memory && npm install && npm test && npm run build && npm pack

592

星數

88

Fork

TypeScript

語言

MIT

授權條款

2026-03-10

建立於

2026-09-04

最近推送

MIT 授權、本機優先的 agent memory 核心,透過 Cordis 外掛生命週期原生載入 DeepSeek Harness:類型化知識圖譜、跨工作階段自動召回與 gm_* 工具,SQLite 儲存並可選向量檢索。

DSH 整合

原生執行環境

作者聲明

安全稽核

未稽核

最後核實

2026-08-21

授權條款

MIT

01它能幫你完成什麼?

  • Give DeepSeek Harness agents durable, traceable cross-session memory

    A typed knowledge graph (TASK / SKILL / EVENT nodes with typed edges) in local SQLite, with relevant memory automatically recalled in new sessions — even after DSH restarts

    DeepSeek Harness users who want their agent to remember past tasks, fixes and reusable skills across sessions

  • Shrink context by recalling only relevant memory instead of replaying full history

    A relevant local subgraph injected into the prompt during Prompt Assembly; the author's seven-turn benchmark measured an ~75% token reduction at turn R7

    DSH users hitting context limits or paying for redundant history replay in long workflows

  • Explicitly record and search long-term knowledge inside DSH

    gm_record persists TASK / SKILL / EVENT nodes deterministically; gm_search runs long-term graph search; gm_status and gm_stats expose store and graph state

    DSH users who need deterministic control over what critical knowledge is remembered and why a memory was recalled

02如何將外掛接入 DeepSeek Harness?

先決條件

  • Node.js `22.19+` or `24+`
  • DeepSeek Harness (dsh) with the web profile — the README uses `npx @deepseek-ai/dsh`; local acceptance was tested on DSH `0.1.0-rc.5`

安裝步驟

  1. 01

    Clone and build the tarball from source (the beta is not on npm yet): `git clone https://github.com/adoresever/graph-memory.git && cd graph-memory && npm install && npm test && npm run build && npm pack`

    $ git clone https://github.com/adoresever/graph-memory.git && cd graph-memory && npm install && npm test && npm run build && npm pack

  2. 02

    Install the generated tarball into the DSH web profile: `npx @deepseek-ai/dsh plugin --profile web add /absolute/path/to/graph-memory-1.6.0-beta.1.tgz`

    $ npx @deepseek-ai/dsh plugin --profile web add /absolute/path/to/graph-memory-1.6.0-beta.1.tgz

  3. 03

    Optionally dump the config to confirm registration: `npx @deepseek-ai/dsh --profile web --dump-config`

    $ npx @deepseek-ai/dsh --profile web --dump-config

  4. 04

    Start DSH web: `npx @deepseek-ai/dsh web`

    $ npx @deepseek-ai/dsh web

  5. 05

    Optional vector retrieval: export `GRAPH_MEMORY_EMBEDDING_API_KEY`, `GRAPH_MEMORY_EMBEDDING_BASE_URL`, `GRAPH_MEMORY_EMBEDDING_MODEL`, `GRAPH_MEMORY_EMBEDDING_DIMENSIONS` before `dsh web`

    $ dsh web

驗證整合成功

  • Confirm that `graph-memory/dsh` is enabled under Settings → Plugins → Plugin list
  • Use `gm_status` to check store path, graph counts, vector coverage, mode, and dimensions

03DSH 整合程度與能力邊界

DSH 整合原生執行環境

Native DSH plugin loaded by the Cordis plugin lifecycle via the cordis.patch.yml bundle entry — registers gm_* tools, auto-recall during Prompt Assembly, and DSH Credentials access

  • Typed knowledge-graph memory core

    DSH session conversation eventsTASK / SKILL / EVENT nodes with typed edges (USED_SKILL, SOLVED_BY, REQUIRES, PATCHES, CONFLICTS_WITH) plus episodic provenance, stored in local SQLite

    Writes a local SQLite database at $DSH_HOME/graph-memory/graph-memory.db (normally ~/.dsh/graph-memory/graph-memory.db)
  • Dual-path recall with graph ranking

    the current user query during Prompt Assemblya deduplicated relevant local subgraph (vector or FTS5 search + community expansion + Personalized PageRank) injected into the prompt

    Optional network calls to OpenAI-compatible embedding providers (DashScope, OpenAI, local) when vector retrieval is configured
  • gm_* tools for record, search and observability

    explicit agent or user tool calls inside DSHgm_record persists knowledge deterministically; gm_search runs long-term graph search; gm_status and gm_stats report store, extraction, recall, vector and community state

    gm_record writes new nodes into the local graph store
  • Safe, local-first context assembly

    recalled memory nodesrecalled history injected as untrusted reference material that cannot override current user instructions

    Memory data stays in the user's local profile by default; API keys come from host credentials or environment variables, never the database

04適合誰?何時不該用?

適合

  • DeepSeek Harness users who want their agent to remember past tasks, fixes and reusable skills across sessions
  • DSH users hitting context limits or paying for redundant history replay in long workflows
  • DSH users who need deterministic control over what critical knowledge is remembered and why a memory was recalled

不適合

  • The current build is 1.6.0-beta.1 and DeepSeek Harness is still in Developer Preview, which may introduce compatibility-breaking changes; local acceptance was tested on DSH 0.1.0-rc.5.
  • npm registry publication is pending, so installation requires cloning the repository and building the tarball from source instead of a one-command npm install.
  • Automatic extraction depends on auxiliary-model output stability, so critical knowledge should be persisted explicitly with gm_record; DSH does not yet expose gm_update and gm_maintain.

05相容性、維護與安全提醒

  • The current build is 1.6.0-beta.1 and DeepSeek Harness is still in Developer Preview, which may introduce compatibility-breaking changes; local acceptance was tested on DSH 0.1.0-rc.5.
  • npm registry publication is pending, so installation requires cloning the repository and building the tarball from source instead of a one-command npm install.
  • Automatic extraction depends on auxiliary-model output stability, so critical knowledge should be persisted explicitly with gm_record; DSH does not yet expose gm_update and gm_maintain.
2026-03-102026-08-14v1.5.5

MIT · actively maintained (last push 2026-08-14; current beta 1.6.0-beta.1)

06常見問題

Graph Memory 如何接入 DeepSeek Harness?原生還是 MCP?

原生接入。它透過 cordis.patch.yml 由 DSH/Cordis 外掛生命週期載入,整合 Session、Tool、Agent Loop、Prompt Assembly、LLM 與 Credentials 接縫,不是透過 MCP 旁路模擬,也不需要 fork DSH。

安裝前需要什麼?

Node.js 22.19+ 或 24+,以及 DeepSeek Harness。目前 beta 尚未發布到 npm,需要複製儲存庫執行 `npm install`、`npm test`、`npm run build`、`npm pack`,再用 `npx @deepseek-ai/dsh plugin --profile web add` 安裝產生的 tarball。

一定要設定 embedding API key 嗎?

不需要。Embedding 為選配,未設定時召回會自動退回 FTS5 詞彙檢索。若需要向量檢索,設定 GRAPH_MEMORY_EMBEDDING_* 環境變數即可接入任何 OpenAI 相容服務(DashScope、OpenAI 或本機 provider)。

記憶資料存在哪裡?

本機 SQLite 資料庫:$DSH_HOME/graph-memory/graph-memory.db(通常為 ~/.dsh/graph-memory/graph-memory.db)。資料預設保留在使用者本機 profile,API key 來自東道主憑證或環境變數,不會寫入資料庫。

目前有哪些限制?

目前版本為 1.6.0-beta.1,且 DeepSeek Harness 仍處於 Developer Preview,可能出現破壞相容性的變更;DSH 端暫未提供 gm_update 與 gm_maintain,Pro 視覺化圖譜工作台也尚未發布。

08資料與來源

  • 作者聲明github.com2c20ed9f3c16…

    Loaded by the DSH/Cordis plugin lifecycle, not simulated through an MCP side channel.

  • 作者聲明github.com2c20ed9f3c16…

    Integrates Session, Tool, Agent Loop, Prompt Assembly, LLM, and Credentials seams.

此頁面根據專案公開文件、儲存庫中繼資料與 DSH Plugins 的結構化解析所產生;最後核實於 2026-08-21。發現錯誤?提交更正。

🏆

最佳 DeepSeek Harness 外掛

從全目錄挑出的 12 個值得優先安裝的外掛,涵蓋各個分類。

DSH Plugins 是獨立的 DeepSeek Harness 外掛市集,與 DeepSeek 官方無關,也不代表官方背書。第三方外掛未經安全稽核,安裝前請審查原始碼。

每週取得最新的 DeepSeek Harness 外掛,絕不濫發。