Introduction

The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” In multi-turn conversations or long-running sessions, conversation context can easily be lost, or cross-session preferences (such as communication style and work habits) cannot be persisted. dsh-agent-memory aims to solve this problem by providing a long-term memory solution that can collect evidence in real time, persist preferences, and provide status monitoring in the Web UI.

What Is This

This is a long-term memory plugin for DSH, maintained by BPTumbleweed. Through a zero-runtime-dependency architecture, it implements real-time collection of conversation evidence, dual-layer injection of global preferences and session memory, and a read-only data browser and status panel.

Core Features

  • Real-time collection of conversation evidence: Uses a hook mechanism to append user messages to evidence/live-messages.jsonl.
  • Web UI status panel: Displays /dsh-agent-memory/panel in the Memory tab of the conversation view.
  • Read-only data browser: Provides /dsh-agent-memory/data/<kind> routes, supporting browsing of data types such as human, live, signals, and preferences.
  • Capability probing and circuit breaking: When the plugin loads, it probes capabilities. If consecutive failures reach a threshold, the circuit breaker is triggered, and this does not affect the main DSH program.
  • Zero runtime dependencies: Uses only native Node.js modules.

Installation and Activation

Install using the official plugin management commands. After installation, you must restart the web instance for the corresponding profile.

dsh plugin --profile web add github:BPTumbleweed/dsh-agent-memory
systemctl restart dsh-web-<your-instance>

Typical Usage

The plugin depends on the accompanying CLI (bin/) to populate data. Initial use requires a full backfill.

python3 bin/memory-scan.py --full --root ~/agent-memory --dsh-home ~/.dsh

Record a preference:

python3 bin/memory-note.py "prefers terse, evidence-backed answers" --section "沟通"

After signals are processed, clear the pending counter:

python3 bin/memory-scan.py --mark-distilled

Notes

  • Preference injection: The plugin does not take over preference injection; preference injection is handled by the official agent-instructions.
  • Fragile-layer protection: In-session memory injection is a fragile layer, is subject to a byte budget, and is protected by the circuit-breaking mechanism.
  • Storage mechanism: Old records are compressed. The storage layout is read by the plugin and written by the CLI.

This plugin is designed for cross-version upgrades and follows the MIT License. For more details, see the community directory and GitHub repository.