Preface

Running agents in DeepSeek Harness (DSH), the context window gets quickly filled with historical messages as conversations lengthen. Common Compaction can answer “how much dialogue can still fit in the window,” but struggles with “which past experience is truly worth recalling right now.” Starting a new session often means recounting yesterday’s pitfalls and verified approaches from scratch.

If you want your agent to have a retrievable, traceable, and cross-session reusable long-term memory, the community plugin graph-memory (maintainer adoresever) is worth a look. It already has 573 stars and 82 forks on GitHub, categorized as a “memory” plugin; see the directory page at SkillHub, with source code hosted at adoresever/graph-memory.

Note: The DSH plugin repository (including the SkillHub plugin marketplace) is a community-maintained independent directory, with no official affiliation to DeepSeek or High-Flyer. Review the source code and MIT license before installation. The plugin runs with the current dsh process permissions and may include local compilation steps; ensure you trust the repository before installing.

What This Is

graph-memory is a knowledge graph memory plugin designed for AI agents, with native support for DeepSeek Harness while retaining an OpenClaw entry point. It extracts reusable information from conversations into structured triples, writes them to a local graph, and recalls relevant subgraphs semantically when needed, rather than stuffing the entire history into the prompt.

The README distinguishes the two capabilities in one sentence: Compaction handles “how much can still fit in the window,” while Graph Memory handles “which knowledge should be recalled at this moment.”

Maintainer adoresever introduced this plugin architecture at the CLAW program event held at Tsinghua Science Park on March 15, 2026 (see the project README and public event reports). The current project version is 1.6.0-beta.8, with DSH adaptation based on the Cordis plugin lifecycle, requiring no fork of the DSH core.

Core Features and Highlights

1. Typed Knowledge Graph

Conversation content is extracted into three types of nodes:

  • TASK: Goals, execution processes, and results;
  • SKILL: Verified, reusable methods;
  • EVENT: Errors, fixes, decisions, changes, and facts.

Edges between nodes preserve relationships such as USED_SKILL, SOLVED_BY, REQUIRES, PATCHES, and CONFLICTS_WITH. When new questions arise, the system retrieves relevant local subgraphs instead of replaying the entire history.

2. Native DSH Integration, Not an MCP Bypass

The plugin is loaded via the DSH/Cordis lifecycle, integrating with Session, Tool, Agent Loop, Prompt Assembly, LLM, and Credentials interfaces. The database, cache, and event listeners are released along with the plugin fiber, without modifying the DSH core.

3. Cross-Session Persistent Memory

Knowledge consolidated in Session A can be automatically recalled in Session B; memory persists after DSH restarts. Stable event IDs ensure idempotent writes in recovery and hot update scenarios. Recall results include the source session and graph edges, making it easy to explain “why this was recalled.”

4. Reduced Context Usage

By default, the most recent 5 rounds of actual user input (freshTurnCount) are preserved; earlier content is compressed into rolling checkpoints via the DSH public Compaction service. Combined with vector retrieval (optional) and FTS5 lexical fallback, community detection, PageRank/Personalized PageRank, and bounded graph traversal, only relevant cross-session subgraphs are injected into the current prompt. The default token budget is 4096 tokens (recallTokenBudget).

In a seven-round OpenClaw workflow benchmark, the seventh round’s context dropped from approximately 95,187 tokens to about 23,977 tokens, a reduction of around 75%—the README explicitly states this is a scenario-specific comparison and does not guarantee the same compression rate for all tasks.

5. Local-First, Lightweight Deployment

The community edition uses SQLite by default, with no need for a separate graph database deployment. Embedding is optional, falling back to FTS5 full-text search when not configured. Data is stored locally by default, supporting DashScope, OpenAI, and local embedding services compatible with the OpenAI protocol.

6. Observable and Manually Interventionable

Tools such as gm_status, gm_search, gm_record, and gm_stats are provided. Automatic recall is completed during the Prompt Assembly stage, eliminating the need to manually invoke gm_search each time. Recalled content is marked as untrusted reference material and cannot override current user instructions.

Installation and Enabling

Environment Requirements: Node.js 22.19+ or 24+. The current beta has not yet been published to npm; the README recommends building from source and installing via tarball. The directory site also provides direct GitHub installation commands, which you can choose based on your environment.

Method 1: Quick Install from Directory Page

Run in the DSH terminal (consistent with the deepseek-harness-plugin.com directory page):

dsh plugin add github:adoresever/graph-memory

For reproducible installation, pin the commit:

dsh plugin add github:adoresever/graph-memory#<commit-hash>

This plugin depends on native modules like @photostructure/sqlite. If you encounter compilation issues during direct installation, add the --allow-build parameter (as per your DSH version’s documentation).

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

Install the generated tarball to the Web profile:

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

If you are developing within the deepseek-harness source repository, you can also use:

pnpm dsh plugin --profile web add /absolute/path/to/graph-memory-1.6.0-beta.8.tgz
pnpm dsh web

After installation, confirm that graph-memory/dsh is enabled in Settings → Plugins → Plugin list.

Default database path:

$DSH_HOME/graph-memory/graph-memory.db

If DSH_HOME is not set, it is typically ~/.dsh/graph-memory/graph-memory.db.

Typical Usage Examples

Optional: Enable Vector Retrieval

Do not send keys in chat. DSH Credentials or environment variables handle the actual API keys. For DashScope, for example:

export GRAPH_MEMORY_EMBEDDING_API_KEY='replace-with-your-key'
export GRAPH_MEMORY_EMBEDDING_BASE_URL='https://dashscope.aliyuncs.com/compatible-mode/v1'
export GRAPH_MEMORY_EMBEDDING_MODEL='text-embedding-v4'
export GRAPH_MEMORY_EMBEDDING_DIMENSIONS='1024'
dsh web

If embedding is not configured, the plugin continues to use FTS5 without blocking conversations.

Common Tools

Tool Purpose
gm_status View plugin, storage, extraction, recall, and vector status
gm_search Explicitly search long-term graph memory
gm_record Manually write TASK / SKILL / EVENT
gm_stats View node, edge, type, and community statistics

Automatic recall triggers during prompt assembly; daily conversations do not require manual search each time. For key knowledge in the beta phase, the README recommends using gm_record for deterministic storage, as automatic extraction relies on the stability of auxiliary model outputs.

Graph Memory Pro (Optional)

The project also provides an experimental Pro Lite DSH plugin (dsh-pro/ directory) that allows read-only viewing of graph snapshots in the web sidebar. Full 2D/3D rendering, split-screen conversation, and drag-to-context features are still in development, sharing the same SQLite database with the community edition.

Use Cases and Considerations

Who It’s For:

  • Developers who maintain the same project long-term in DSH and need to remember troubleshooting paths, tool usage, and decision rationale across sessions;
  • Teams with many conversation rounds and significant context inflation, looking to replace “full history replay” with structured memory;
  • Users interested in the OpenClaw ecosystem who want to share the same memory core between two hosts (the OpenClaw entry point is still retained).

Please Note When Using:

  1. The plugin runs with dsh process permissions, and installation and build steps will execute scripts from the repository. Read the source code and MIT license before installation.
  2. The current beta (1.6.0-beta.8) has not yet been published to npm; for production environments, it is recommended to pin the commit or tarball version.
  3. The DSH side does not yet expose the gm_update and gm_maintain tools for the OpenClaw entry point; automatic extraction quality varies by model, so use gm_record for critical knowledge.
  4. The 75% context compression comes from a specific benchmark scenario documented in the README; actual benefits depend on conversation type and graph scale.
  5. Configure API keys via Credentials or environment variables; do not write them into chat logs. If a key has been compromised, rotate it promptly.

Conclusion

If you’re looking for a memory layer for DSH agents that “can explain its sources and be reused across sessions,” graph-memory connects knowledge graphs, vector/full-text search, and the DSH native prompt pipeline, making it a community solution worth trying.