DeepSeek Harness Plugin: dsh-memory (Cross-Session Memory)

Preface

DeepSeek Harness (DSH) provides flexible agent development capabilities through a plugin-based architecture. The dsh-memory plugin is designed to solve the problem of memory gaps in long conversations, filling the gap between existing plugins (such as those that only handle current session compression or persistent storage without a summarization mechanism). It achieves long-term memory of past conversations for agents by automatically summarizing sessions and injecting notes.

Core Features

  • Automatic Session End Summary: Automatically distills conversation content into long-term notes when a session ends.
  • Automatic Note Injection: Automatically injects global notes and current workspace notes as prompt segments at the beginning of the next session.
  • Local Storage: All data is stored locally in the $DSH_HOME/memory/ directory.
  • No UI Configuration: Configured via environment variables without a graphical interface.

Installation and Activation

Installing the plugin requires using the official command. After installation, the profile must be restarted to mount host events.

dsh plugin --profile web add /path/to/dsh-memory-0.1.0.tgz

Configuration

The plugin is configured solely through environment variables and does not rely on configuration files or a UI. The key configuration options are as follows:

Variable Default Value Function
DSH_MEMORY_DISABLED — If non-empty, fully lazy mounting is performed; used for troubleshooting plugin tree issues.
DSH_MEMORY_ROOT $DSH_HOME/memory Root directory for memory; can be pointed to a temporary directory for testing.
DSH_MEMORY_MIN_CHARS 600 Lower limit for the text volume of a new turn; summarization is skipped if below this length.
DSH_MEMORY_MIN_INTERVAL_MS 60000 Minimum interval between two distillations in the same session.
DSH_MEMORY_TRANSCRIPT_CHARS 16000 Upper limit of body text fed into a single distillation.
DSH_MEMORY_RECALL_BYTES 6000 Byte limit for the recall segment; oldest data is discarded if exceeded.
DSH_MEMORY_FILE_BYTES 32000 Byte limit for a single memory file.
DSH_MEMORY_MAX_TOKENS 1200 Output budget for a single distillation.
DSH_MEMORY_TIMEOUT_MS 45000 Timeout duration for a single distillation.

Typical Usage

  • Control Distillation Frequency: Use the environment variable DSH_MEMORY_MIN_CHARS to control distillation frequency and avoid meaningless summaries for short turns.
  • Control Recall Range: The recall segment is inserted at FILE_REFERENCE (850), immediately preceding the environment context.

Use Cases and Notes

  • Data Security: The plugin does not read session logs, does not depend on session-query-sqlite, and all writes are confined to $DSH_HOME/memory/.
  • Functional Positioning: It provides no tools or slash commands and does not perform vector retrieval; it only provides two core paths: automatic recall and automatic distillation.
  • Data Persistence: File writes utilize a temp file + rename strategy to prevent corruption from crashes.

Brief Conclusion

dsh-memory is a component in the DeepSeek Harness plugin ecosystem used to build persistent memory. It implements session-level automatic summarization and prompt segment injection via local storage and environment variable configuration. For more details, please visit: GitHub.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye