Preface

In DeepSeek Harness (dsh), preloading the entire memory index into the system prompt consumes a large number of tokens, even when the current task does not require those memories. dsh-unified-memory solves this problem through a SQLite full-text index. It only preloads feedback rules, retrieves memories when needed, and keeps per-turn costs low and stable.

What It Is

mattcarvercom/dsh-unified-memory is a plugin that provides long-term memory for DeepSeek Harness. It uses the Claude Code memory format and stores memories as local Markdown files. Through a SQLite full-text index, it enables on-demand retrieval and avoids packing the entire memory repository into the context.

Core Features

  1. Long-term memory storage: stores memories as Markdown files, each file containing metadata (such as origin and modified time).
  2. On-demand retrieval and cost control: uses a SQLite full-text index to retrieve memories only when needed, greatly reducing token consumption per conversation turn.
  3. Three working modes:
    • dsh: independent private storage, stored in ~/.dsh/memory.
    • overlay: reads Claude Code memories (read-only), but writes to its own storage.
    • shared: shares the memory folder with Claude Code; both sides read and write the same memories.
  4. Source tracking: each file contains an origin field, clearly recording the data source.
  5. Fully local: no network requests; all indexing and storage operations are completed locally.

Installation and Activation

Use the official installation command to add the plugin:

dsh plugin --profile web add github:mattcarvercom/dsh-unified-memory#v1.0.1

After installation, restart dsh web for the changes to take effect. The plugin starts in dsh mode by default.

Typical Usage

After installation, use the mem mode command to manage memory modes:

mem mode                        # View the current mode
mem mode shared                 # Switch to shared mode (triggers migration)
mem mode shared --dry-run       # Dry-run the migration only; do not execute

In shared mode, DeepSeek Harness and Claude Code can read and write the same memory repository, avoiding duplicate memories.

Applicable Scenarios and Notes

Applicable scenarios: When the local model has a limited context window, or when long-term agent tasks must be handled, this plugin can keep per-turn token consumption low.

Notes:
1. Environment dependencies: Requires Node.js 22.19+ or 24+.
2. Mode dependencies: overlay and shared modes require Claude Code to be installed.
3. Privacy and security: The plugin instructs the agent not to store confidential information in memories, but the files themselves are stored in plaintext.
4. File migration: The mode configuration does not automatically move files. When switching modes, you must run the mem mode command, which backs up files first and then migrates them.
5. License: MIT License.

Conclusion

This plugin provides a lightweight, low-cost long-term memory solution for DeepSeek Harness through a SQLite index and the Claude Code format. All data is stored locally and does not involve cloud requests.