DeepSeek Harness (DSH) adopts a plugin-based architecture. When building long conversations or multi-turn Agent tasks, traditional session modes are limited by context windows, making it difficult for the model to effectively use historical information. The dsh-prime-memory plugin aims to solve this problem by automatically capturing conversations, consolidating memories, and injecting relevant content before model generation through a hierarchical distillation mechanism, all in the background.
Plugin Positioning¶
dsh-prime-memory is a hierarchical distillation memory plugin for DeepSeek Harness, maintained by drscrewdriver and open-sourced under the MIT License. It addresses the problem of “short-term memory loss” in agent development, enabling the model to retain key facts and scenarios across multi-turn interactions.
Core Features¶
The plugin’s core workflow is automatically completed in the background and is transparent to the user conversation layer:
- Hierarchical distillation pipeline: Conversations pass through four levels: L0 raw capture → L1 atomic memory → L2 scene consolidation → L3 profile distillation.
- Automatic injection: Before each reasoning step, the plugin retrieves relevant memories by relevance and injects them into the context.
- Cost dashboard: Under the “Memory” tab on the Settings page, a “Cost” tab is provided, displaying trend line charts color-coded by model, showing a Token consumption table by hierarchy × time window, and supporting cumulative statistics by model.
- Memory tools: Provides tools such as
memory_search,conversation_search, andmemory_read_scene, allowing the model to actively invoke them to read scene blocks. - Session tiers: Provides four session-level memory tiers: “Daily”, “Work”, “Smart”, and “Off”, as well as a “write-only, no read” mode.
Installation and Enablement¶
Before installation, ensure that the Node version is ≥ 22.16.
Use the official CLI to install (recommended):
npx -y @deepseek-ai/dsh plugin --profile web add dsh-prime-memory
If the current Agent has terminal execution capability, you can send the following instruction to have it install automatically:
请为 DeepSeek Harness 的 web Profile 安装 dsh-prime-memory 插件。
只执行下面两条命令,不要修改其他 Profile:
dsh plugin --profile web add dsh-prime-memory
dsh --profile web --dump-config
确认输出中出现 dsh-prime-memory 后告诉我安装结果。
不要替我关闭或重启正在运行的 DSH;安装完成后提醒我手动重启 DSH Web Host。
After successful installation, restart DeepSeek Harness. In the Web Host interface, the input bar will show the “Memory” tier; a “Memory” page will appear on the Settings page.
Usage and Workflow¶
After installation and restart, the plugin will automatically take over the conversation.
- Memory injection display: When the model needs historical memory, the interface will display a “Context injection · memory” line above the user message, which the user can expand to view the specific injected content.
- Tool calls: The model will invoke tools such as
memory_read_sceneas needed to read scene blocks, or use search tools. - Deduplication and recency: The plugin deduplicates memories within the same session to avoid repeated injection. Recall ranking uses a recency-weighting mechanism (based on the
recall.decayHalfLifeDaysconfiguration) to prioritize newer memories.
Configuration and Modes¶
- Session tier: The “Memory · Auto” pill on the right side of the input bar can switch tiers. Default is “Smart”, supporting “Daily”, “Work”, and “Off”.
- Write-only, no read: The “write-only, no read” mode can be enabled in the floating panel. Once enabled, the plugin continues to capture and distill memories but does not inject any content into the current session (recall injection, tool guides, etc. all stop), suitable for debugging or sensitive conversations.
Uninstallation and Data¶
To uninstall:
dsh plugin --profile web remove dsh-prime-memory
After uninstalling, you need to restart DSH. Note that data files remain in the ~/.dsh/memory/ directory (including conversations/, records/, scenes/, and memory.db); for complete cleanup, you can manually delete this directory.
Notes¶
- Plugin accounting failures only trigger warnings and do not block the distillation flow.
- The plugin runs with the permissions of the current DSH process; reviewing the source code and license before installation is recommended.
- Data is stored in SQLite format.
dsh-prime-memory provides DSH with long-term memory capabilities, making it suitable for scenarios requiring long conversations or complex Agent tasks.