Skip to content
Back to search

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

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/adoresever--graph-memory/badge.svg)](/listings/adoresever--graph-memory)

HTML

<a href="/listings/adoresever--graph-memory"><img src="/api/listings/adoresever--graph-memory/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

`1.6.0-beta.17` fixes producer attribution on DSH 0.1.7+ / Session V4 (#113), extraction on models that cannot use `off` (#117), and configurable SQLite lock waiting. Context-window and recall policies remain unchanged. [Fix details and recovery instructions (Chinese) →](docs/DSH_COMPATIBILITY_20260930_CN.md)

Node.js `22.13+` · no DSH fork · until npm `1.6` is published, install the pinned GitHub release:

npx @deepseek-ai/dsh plugin --profile web add github:adoresever/graph-memory#v1.6.0-beta.17
npx @deepseek-ai/dsh --profile web --dump-config
npx @deepseek-ai/dsh web

The npm registry still serves the old `1.5.8`; do not use it to validate DSH. Switch to `npx @deepseek-ai/dsh plugin --profile web add graph-memory` only after `npm view graph-memory version` reports `1.6.0-beta.17` or newer.

Confirm that `graph-memory/dsh` is active under **Settings → Plugins**. The default database is `$DSH_HOME/graph-memory/graph-memory.db`, normally `~/.dsh/graph-memory/graph-memory.db`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 185 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Graph Memory
  2. <p align="center">
  3. <img src="docs/images/brand/graph-memory-hosts-banner.png" alt="Graph Memory for DeepSeek Harness, compatible with OpenClaw" width="100%">
  4. </p>
  5. <p align="center">
  6. <strong>Bound the context. Keep the memory.</strong><br>
  7. A native DeepSeek Harness memory plugin that keeps recent conversation turns, archives older history, and recalls exact source-backed knowledge when it matters.
  8. </p>
  9. <p align="center">
  10. <a href="README_CN.md">中文</a> ·
  11. <a href="https://www.dsh.so/artifact/graph-memory">dsh.so</a> ·
  12. <a href="benchmarks/dsh-context-takeover/README.md">20-turn benchmark</a> ·
  13. <a href="docs/TURN_MEMORY_NAVIGATION_UPGRADE_CN.md">Upgrade guide</a>
  14. </p>
  15. <p align="center">
  16. <a href="https://www.dsh.so/artifact/graph-memory"><img src="https://www.dsh.so/badge/graph-memory.svg" alt="dsh.so security badge"></a>
  17. <a href="https://www.dsh.so/artifact/graph-memory"><img src="https://www.dsh.so/badge/install/graph-memory.svg" alt="dsh.so install badge"></a>
  18. </p>
  19. ## The problem it solves
  20. <p align="center">
  21. <img src="docs/images/context-memory-illustration.webp" alt="Long agent history becomes graph navigation plus a compact recent-turn context" width="100%">
  22. </p>
  23. Graph Memory owns the **model-visible historical surface** without deleting DSH's event log. By default it keeps the newest five completed user turns, removes completed reasoning/tool traces from future requests, and recalls relevant older or cross-session source Q/A automatically.
  24. ## The 1.6 turn-memory navigation upgrade
  25. | Before | Now |
  26. |---|---|
  27. | Extract TASK / SKILL / EVENT directly from messages | Create one self-contained turn summary, then derive SPO from that same sentence |
  28. | Graph nodes could become the factual payload | Summary, SPO, and communities only navigate; original question and final answer remain the evidence |
  29. | Old memories from the active session could be filtered wholesale | Exclude only sources still visible in the fresh window; archived same-session and cross-session recall share one path |
  30. | Community expansion could pull a whole neighborhood | Local LPA narrows candidates, query-time PPR ranks them, and only matched Q/A is recovered |
  31. | DSH retained complete tool and reasoning traces | Completed turns retain question + final answer; older prefixes collapse to one fixed marker |
  32. Writing one completed turn costs exactly **one auxiliary LLM call**. Community detection and PPR are local. There are no hard-coded node/edge counts, semantic direction gates, or JSON repair that turns invalid output into accepted data. [Read the complete design, source map, and porting sequence →](docs/TURN_MEMORY_NAVIGATION_UPGRADE_CN.md)
  33. ## Measured first
  34. <p align="center">
  35. <img src="docs/images/dsh-context-takeover-chart.svg" alt="DSH 20-turn first-request context comparison" width="100%">
  36. </p>
  37. | Real 20-turn GLM-5.2 run | Historical native DSH baseline | Latest Graph Memory | Change |
  38. |---|---:|---:|---:|
  39. | T20 first request | 56,998 tokens | **11,008 tokens** | **−80.69%** |
  40. | T20 model-visible messages | 171 | **21** | **−87.72%** |
  41. | T01–T20 first-request context | 532,451 tokens | **165,896 tokens** | **−68.84%** |
  42. | All measured tokens¹ | 2,487,776 | **2,327,728** | **−6.43%** |
  43. <sub>¹ The latest candidate includes 166 main-agent requests, 20 turn extractions, and 41 embedding requests; the historical baseline made 77 main requests. DSH commits and nondeterministic tool loops differ, so this is not a simultaneous strict A/B. First-request context is the direct takeover metric; the full bill remains visible.</sub>
  44. **20/20** scenario turns passed · **20/20** structured extractions succeeded · **0** quarantined · **20** turn summaries · **92** SPO triples · **30** communities · **20** summary vectors. T11, T19, and T20 automatically recalled out-of-window memory with exact source question and final answer.
  45. [Read the Markdown benchmark, per-turn data, method, and limits →](benchmarks/dsh-context-takeover/README.md)
  46. ## Memory survives the context window
  47. <p align="center">
  48. <img src="docs/images/dsh/plugin-inventory-active.png" alt="Graph Memory active in DSH" width="48%">
  49. <img src="docs/images/dsh/vector-cross-session-recall.png" alt="Cross-session recall in a fresh DSH session" width="48%">
  50. </p>
  51. The graph is a **navigation layer**, not a replacement for evidence. `TASK`, `SKILL`, and `EVENT` nodes point back to the original user question and final visible answer; recalled context includes those exact source messages.
  52. ## Install on DeepSeek Harness
  53. `1.6.0-beta.17` fixes producer attribution on DSH 0.1.7+ / Session V4 (#113), extraction on models that cannot use `off` (#117), and configurable SQLite lock waiting. Context-window and recall policies remain unchanged. [Fix details and recovery instructions (Chinese) →](docs/DSH_COMPATIBILITY_20260930_CN.md)
  54. Node.js `22.13+` · no DSH fork · until npm `1.6` is published, install the pinned GitHub release:
  55. ```bash
  56. npx @deepseek-ai/dsh plugin --profile web add github:adoresever/graph-memory#v1.6.0-beta.17
  57. npx @deepseek-ai/dsh --profile web --dump-config
  58. npx @deepseek-ai/dsh web
  59. ```
  60. The npm registry still serves the old `1.5.8`; do not use it to validate DSH. Switch to `npx @deepseek-ai/dsh plugin --profile web add graph-memory` only after `npm view graph-memory version` reports `1.6.0-beta.17` or newer.
  61. Confirm that `graph-memory/dsh` is active under **Settings → Plugins**. The default database is `$DSH_HOME/graph-memory/graph-memory.db`, normally `~/.dsh/graph-memory/graph-memory.db`.
  62. ## What ships
  63. | Capability | Implementation |
  64. |---|---|
  65. | Context takeover | Configurable newest-N completed turns; one archive marker replaces the older model surface |
  66. | Lightweight extraction | Only the user question and final answer; strict structured tool contract; no reasoning/tool transcript ingestion |
  67. | Query-first recall | Vector Top-K with FTS5 fallback; exact source Q/A travels with graph hits |
  68. | Durable memory | Local SQLite, stable provenance, cross-session and cross-project recall |
  69. | Failure behavior | Invalid extraction is quarantined; foreground conversation continues; bad data is not repaired or persisted |
  70. | Host support | Native DSH/Cordis adapter; maintained OpenClaw Context Engine adapter |
  71. <details>
  72. <summary><strong>Optional embeddings</strong></summary>
  73. Graph Memory supports OpenAI-compatible embedding endpoints. Without embeddings it falls back to FTS5 and does not block conversation.
  74. ```bash
  75. export GRAPH_MEMORY_EMBEDDING_API_KEY='replace-with-your-key'
  76. export GRAPH_MEMORY_EMBEDDING_BASE_URL='https://dashscope.aliyuncs.com/compatible-mode/v1'
  77. export GRAPH_MEMORY_EMBEDDING_MODEL='text-embedding-v4'
  78. export GRAPH_MEMORY_EMBEDDING_DIMENSIONS='1024'
  79. dsh web
  80. ```
  81. </details>
  82. <details>
  83. <summary><strong>DSH tools and extraction route</strong></summary>
  84. | Tool | Purpose |
  85. |---|---|
  86. | `gm_status` | Store, extraction, recall, vector, and retention state |
  87. | `gm_search` | Explicit graph-memory search |
  88. | `gm_record` | Deterministically persist a `TASK`, `SKILL`, or `EVENT` |
  89. | `gm_stats` | Graph and retention receipts |
  90. | `gm_maintain` | One bounded maintenance tick |
  91. | `gm_retry_extraction` | Explicitly retry pending or quarantined extraction |
  92. Automatic recall needs no tool call. Extraction may use a dedicated model via `GRAPH_MEMORY_LLM_PROVIDER` and `GRAPH_MEMORY_LLM_MODEL`; optional reasoning and output controls are `GRAPH_MEMORY_LLM_REASONING_EFFORT` and `GRAPH_MEMORY_LLM_MAX_TOKENS`.
  93. Without an explicit effort, extraction reads the exact model capability: prefer `off`, otherwise the host's first advertised effort, or omit the field on non-reasoning models. Route/provider failures keep source Q/A pending and report the cause in logs and `gm_status`. To recover old quarantined records, enable `assistantTools: all` and invoke `gm_retry_extraction`. Configure SQLite lock waiting with `GRAPH_MEMORY_DB_BUSY_TIMEOUT_MS` (default: 5000 milliseconds).
  94. </details>
  95. <details>
  96. <summary><strong>OpenClaw compatibility</strong></summary>
  97. ```bash
  98. openclaw plugins install graph-memory
  99. openclaw plugins enable graph-memory
  100. openclaw gateway restart
  101. ```
  102. Activate the Context Engine slot in `~/.openclaw/openclaw.json`:
  103. ```json
  104. {
  105. "plugins": {
  106. "slots": { "contextEngine": "graph-memory" },
  107. "entries": { "graph-memory": { "enabled": true } }
  108. }
  109. }
  110. ```
  111. <p align="center">
  112. <img src="docs/images/token-comparison.png" alt="Earlier OpenClaw seven-turn token comparison" width="76%">
  113. </p>
  114. </details>
  115. <details>
  116. <summary><strong>Graph Memory Pro</strong></summary>
  117. The repository also contains an experimental read-only DSH Pro Lite Host + Client plugin backed by Community SQLite. The 2D/3D graph workbench, split view, and controlled drag-to-context remain planned. See [`dsh-pro/README_CN.md`](dsh-pro/README_CN.md).
  118. </details>
  119. ## Verification and limits
  120. Current beta `1.6.0-beta.17` passes **149/149 automated tests**, including DSH `0.2.0-rc.2`'s official V4 validator and real SQLite write contention. The GLM-5.2 20-turn figures above come from the navigation-upgrade run on 2026-09-09; this compatibility patch did not rerun that paid experiment.
  121. - Structured extraction still depends on model contract compliance: the historical run succeeded 20/20 times. Contract failures stay quarantined; route/provider failures remain pending for explicit retry after configuration is corrected.
  122. - Recall is bounded by configurable Top-K. Focused probes succeeded; one broad multi-topic query can require a larger Top-K or separate questions.
  123. - The published run is an engineering workload, not a universal LoCoMo/LongMemEval score.
  124. - The design, source-code map, and porting sequence for the summary + SPO navigation + exact-Q/A upgrade are documented in the [Chinese upgrade guide](docs/TURN_MEMORY_NAVIGATION_UPGRADE_CN.md).
  125. Reproduce it from [`benchmarks/dsh-context-takeover/`](benchmarks/dsh-context-takeover/). Raw conversations, provider responses, local paths, and credentials are excluded.
  126. ## Development
  127. ```bash
  128. npm install
  129. npm test
  130. npm run build
  131. npm run verify:package
  132. ```
  133. [MIT](LICENSE) © 2026 adoresever · [Asset and trademark notes](docs/ATTRIBUTIONS.md)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.