graph-memory: Knowledge Graph Memory Plugin for DeepSeek Harness
adoresever/graph-memory
Knowledge graph memory for DeepSeek Harness, enabling cross-session recall and context compression.
Provides cross-session knowledge graph memory for DeepSeek Harness, enabling AI agents to recall relevant past knowledge instead of replaying full conversations.
dsh plugin --profile web add github:adoresever/graph-memory- Category
- Memory & Context
- Platform
- DSH Plugin
- Author
- adoresever
- Distribution
- Plugin
graph-memory Key Features
graph-memory Repo Summary
Graph Memory is a knowledge graph memory plugin (DSH plugin) for DeepSeek Harness, maintained by adoresever under the MIT license, created in March 2026 and last updated in August 2026. It addresses the pain point of cross-session memory for AI agents: traditional compaction answers 'how much of this conversation still fits?' while Graph Memory answers 'which past knowledge is worth recalling now?' The plugin converts reusable conversation knowledge into typed nodes (e.g., TASK, SKILL, EVENT) and preserves relationships via typed edges such as USED_SKILL, SOLVED_BY, REQUIRES, PATCHES, and CONFLICTS_WITH, enabling retrieval of relevant local subgraphs instead of replaying complete history.
What core advantages does Graph Memory offer as a DSH plugin?
Graph Memory is loaded by the DSH/Cordis plugin lifecycle, not simulated through an MCP side channel, integrating Session, Tool, Agent Loop, Prompt Assembly, LLM, and Credentials seams. It disposes database, cache, and event listeners with its plugin fiber and does not fork or modify DeepSeek Harness core. It provides durable cross-session memory: knowledge from Session A can be recalled automatically in Session B, memory survives DSH restarts, and stable event IDs make resume and HMR ingestion idempotent. Source sessions and graph edges explain why a memory was recalled.
How does Graph Memory achieve smaller and cleaner context?
The plugin keeps the newest real user turns verbatim (freshTurnCount, default 5), uses the agent-scoped public DSH compaction service to replace the older model-facing prefix with one rolling checkpoint, while the durable source event log remains intact. It indexes each landed checkpoint and preserves exact source-message provenance for later dereferencing. Semantic vector retrieval with FTS5 lexical fallback, community detection, PageRank, personalized PageRank, and bounded graph traversal are used. Only a relevant cross-session subgraph enters the current prompt, within recallTokenBudget (default 4096). Automatic injection uses a high-precision semantic gate (autoRecallMinScore, default 0.6) and never falls back to query-independent community representatives; explicit gm_search remains broad. Recalled history is marked as untrusted reference material and cannot override current user instructions.
How local-first and observable is Graph Memory?
It uses SQLite by default, requiring no graph database deployment. Embeddings are optional; without them, recall falls back to FTS5. Data remains in the user's local profile by default. OpenAI-compatible embeddings support DashScope, OpenAI, and local providers. gm_status reports store path, graph counts, vector coverage, mode, and dimensions. Model or dimension changes trigger re-embedding, and vectors with different dimensions are never silently compared. Critical knowledge can be recorded deterministically with gm_record.
How does Graph Memory perform in benchmarks?
In the original OpenClaw adapter's seven-turn workflow (installing, authenticating, and querying bilibili-mcp), without Graph Memory R7 consumed 95,187 tokens, with Graph Memory it dropped to 23,977 tokens, an approximate 75% reduction. This is a scenario-level comparison, not a universal savings guarantee; the mechanism is replacing indiscriminate history replay.
Which DeepSeek Harness versions and platforms does Graph Memory support?
As a DSH plugin, Graph Memory is native to DeepSeek Harness, with the OpenClaw plugin entry retained. It is written in TypeScript, licensed under MIT, and has 573 stars and 82 forks on GitHub, with 11 open issues. It was invited to present at a Tsinghua University symposium in April 2026, and a technical report (Chinese) is available in the docs directory of the repository.
