Introduction

DeepSeek Harness (DSH) adopts an “everything is a plugin” architecture, allowing developers to extend the system’s core capabilities through plugins. When building agents with LLMs, one of the most common problems is context loss: new conversations cannot leverage information accumulated in previous conversations, forcing the agent to repeatedly explain background context or repeat tasks. The dsh-shared-memory plugin is designed to address this pain point. It provides a cross-conversation memory system that, through persistent memory injection and tool-based management, enables agents to maintain continuity.

Plugin Positioning

This is a plugin that provides cross-conversation memory capabilities for DSH. It follows a design philosophy similar to Hermes, injecting persistent memories into the system prompt of each session and providing a memory tool and a visual panel for maintaining these memories.

Core Features

The plugin mainly includes the following capabilities:

  • Hierarchical memory management:
    • Persistent injection: MEMORY.md (Agent high-frequency notes) and USER.md (user profile) are persistently injected into the system prompt of each new session.
    • On-demand loading: Topic files under the topics/ directory (such as feishu.md) are not persistently injected; only a one-line index is generated at the end of MEMORY.md, which the Agent reads on demand through the tool when needed.
  • Memory maintenance tools:
    • Provides add, replace, remove, and list commands.
    • Supports a target parameter to specify writing to memory, user, or topic:<filename>.
    • Built-in write self-check rules guide the Agent to record only principles, preferences, decisions, corrections, work data, and persistent facts.
  • Visual memory panel:
    • The sidebar provides a “Memories” button; clicking it opens the panel.
    • The panel includes three tabs: “Notes”, “Profile”, and “Topic Library”. It supports browsing, editing, adding/deleting entries, and displays capacity usage in real time.
  • Formatting and limits:
    • Memory entries use the § separator. It is recommended to use [Discovery]/[Decision]/[Preference]/[Correction] as prefixes.
    • Capacity can be controlled via the environment variables DSH_MEMORY_CHAR_LIMIT, DSH_MEMORY_USER_CHAR_LIMIT, and DSH_MEMORY_TOPIC_CHAR_LIMIT.

Installation and Enablement

It is recommended to install the plugin using the official plugin command.

dsh plugin --profile web add github:futongxu9-maker/dsh-shared-memory

If the command-line method is unavailable, you can perform a manual installation:

  1. Copy the dsh-shared-memory directory to ~/.dsh/profiles/web/node_modules/dsh-shared-memory/.
  2. Append the following content to ~/.dsh/profiles/web/cordis.patch.yml:
    - insert:
        - id: shared-memory
          name: 'dsh-shared-memory'
  1. Refresh the page or restart the service.

Usage

After enabling the plugin, interaction is mainly performed on the model side and the user side.

  • Model side (Agent usage):
    The system prompt automatically injects MEMORY.md, USER.md, and the topic index. The Agent can call the memory tool to maintain memories, for example adding new entries, replacing old entries, deleting entries, or viewing current usage. The tool will block temporary content that does not meet the built-in requirements.

  • User side (manual management):
    Click the “Memories” button at the bottom of the sidebar, then use the three tabs in the opened panel for management. The panel supports create/read/update/delete operations and displays character usage.

  • Manual editing:
    Memory files are stored in the ~/.dsh/memories/ directory. You can directly edit the MEMORY.md, USER.md, or topics/*.md files to modify their content.

Environment Requirements

  • DeepSeek Harness: The version must be rc.6 or higher (dsh web).
  • Operating systems: Supports Windows, macOS, and Linux.
  • License: MIT.

Summary

dsh-shared-memory solves the problem of agent context loss across conversations through structured hierarchical memory and a visual panel. After installing this plugin, developers can more easily manage the long-term memory of the Agent.

For more documentation and source code, please visit:
* GitHub repository
* Community catalog