Introduction¶
In DeepSeek Harness (DSH), agent memory is bound to the session by default. After a session reset or service restart, prior context information is typically lost. If you need the agent to retain memories of user preferences and historically important information across multi-turn conversations, an additional persistence mechanism is required. The dsh-memory-panel plugin provides utility functions and a visual panel to address this need.
Plugin Overview¶
The plugin is maintained by x2it and categorized as “Memory.” It provides DSH agents with a set of persistent storage tools and a panel in the Web interface sidebar for visualizing the entries remembered by the agent.
Core Features¶
The plugin provides the following agent tools and UI features:
- Memory tools:
memory_save: stores or updates a memory (identified by a key).memory_recall: searches memories by keyword or category.memory_list: lists all memories, with filtering by category supported.memory_delete: deletes a single memory by exact key.memory_clear: deletes all memories (requires confirmation).
- Web sidebar panel: Click the “Memory” button in the Web interface sidebar to open the panel and view stored content. The panel follows the UI language (Chinese/English) and issues a warning when accessed through a tunnel.
- Data and security mechanisms:
- Storage location: Memory content is stored in plaintext in
~/.dsh/memory.json. - Atomic writes and concurrency: Uses atomic writes (writing to a temporary file first and then renaming it) and a queue-based concurrency mechanism to avoid data overwrites.
- Corruption recovery: If
memory.jsonis corrupted, it is automatically backed up asmemory.json.corrupt-<timestamp>and the system attempts to continue running. - Growth control: The maximum content length per entry is 4000 characters, the maximum number of stored entries is 500 (older entries are evicted), and the maximum number of recall results is 30.
- Storage location: Memory content is stored in plaintext in
Installation and Enablement¶
The installation commands are as follows:
# Web 交互模式
dsh plugin --profile web add dsh-memory-panel
# 无头模式(单次运行)
dsh plugin --profile headless add dsh-memory-panel
# 或直接从 GitHub 安装
dsh plugin --profile web add github:x2it/dsh-memory-panel
After installation is complete, restart dsh web. Click the “Memory” button in the sidebar to see the panel.
Verification and Usage¶
Verify that the plugin is active:
dsh --profile web --dump-config | grep memory-panel
After successful installation, the agent’s tool list should include tools such as memory_save, memory_recall, and memory_list. The agent can use these tools to manage long-term memory.
Notes¶
- API security: The
/api/memoryendpoint currently has no authentication mechanism. Be sure to binddsh webtolocalhostor a trusted network segment and avoid exposing it to the public internet. - Data privacy: Memory content is stored in plaintext in
~/.dsh/memory.json. Do not store sensitive keys or passwords here that you would not write directly into a local file. - Version dependency: The plugin depends on
@deepseek-ai/dsh-tools(>=0.0.1-rc.1 <0.2.0).
Summary¶
dsh-memory-panel is suitable for developers who need to build long-context memory capabilities in DSH agents. This project is open-sourced under the MIT license. For more information, see the GitHub repository.