The DeepSeek Harness (DSH) ecosystem emphasizes “everything is a plugin.” When developing agents, preserving context in multi-turn conversations and sharing memory across workspace scenarios are common needs. dsh-memory is a host-side bundle plugin designed to provide DSH with persistent three-layer memory capabilities and to address the maintenance cost associated with manually managing memory.
Plugin Positioning¶
The plugin is maintained by biubiu23333333 and is released under the MIT open source license. It runs as a host bundle and is responsible for cross-workspace storage, forced automatic consolidation after each turn ends, and providing memory operation tools to the Agent. It injects a system prompt segment so that all preset agents can proactively use memory features.
Core Capabilities¶
- Three-layer memory structure: Builds a three-layer structure consisting of long-term memory, short-term memory, and session summaries.
- Cross-workspace storage: The memory root directory is fixed to
$DSH_HOME/memory(default~/.dsh/memory) and is decoupled from specific workspaces. - Forced automatic consolidation: Listens to the
turn/end(completed)event and automatically performs consolidation after a turn ends. If no LLM is available, it uses a deterministic fallback mechanism. - Agent memory tools: Provides three tools for the Agent to call:
memory_read,memory_write, andmemory_search. - Proactive memory guidance: A system prompt segment that applies to all presets guides the Agent to read and write memory.
Installation and Activation¶
Run the following commands to build and install:
cd dsh-memory
pnpm pack
dsh plugin --profile web add ./dsh-memory-0.1.0.tgz
After installation, the memory root directory is automatically initialized with the three-layer skeleton.
Typical Usage¶
- Automatic effect: No need to select a “memory mode” in a preset. Any preset (standard / minimal / custom) automatically gains memory capabilities during a session.
- Memory maintenance: The Agent maintains long-term memory via
memory_write; the Host appends raw logs toshort-term/<sessionId>.mdafter each turn ends, and uses an LLM to generate a one-sentence summary appended toepisodes/<sessionId>.md. - Storage layout:
$DSH_HOME/memory/
├── long-term/ # profile / facts / decisions / projects
├── short-term/ # 原始日志流水
└── episodes/ # LLM 生成的会话摘要
Development and Notes¶
- Zero build: Implemented in pure ESM with no build step required.
- Runtime dependencies: Relies on
@deepseek-ai/dsh-tools,dsh-llm, anddsh-home-paths, resolved by DSH’s profiles module. - Event listening: The Host must listen for the
turn/end(completed)event on thesession/eventfirehose.
dsh-memory addresses agent memory persistence and cross-workspace sharing by acting as a host-layer plugin, enabling low-cost memory automation. For more details and source code, see GitHub.