Introduction

In long conversations with DeepSeek Harness (DSH), context window limits are unavoidable. Summary compression can reduce token usage, but after multiple rounds of compression, details such as the rationale behind design decisions, rejected alternatives, and key constraints are often lost. This plugin moves memory work into the ongoing conversation. By continuously accumulating observations and reflections in the background, long conversations remain coherent even after multiple rounds of compression.

Core Features

The plugin maintains a background memory pipeline and applies special handling to DSH’s compression mechanism:

  • Background memory pipeline: Includes an observer, a reflector, and a cleaner. The observer distills conversation events into timestamped, relevance-weighted records; the reflector extracts long-term facts; the cleaner prunes observations that have already been covered by reflections. The whole process is driven by events such as turn/end according to token thresholds.
  • Compression as rendering: When DSH initiates a summary compression call, the plugin intercepts it in the llm/stream waterfall. If memory is non-empty, it directly returns the rendered memory text, achieving zero model calls; when memory is empty, it falls back to DSH’s native summarization.
  • Proactive compression: Supports both calibrated (fixed threshold) and ratio (proportion of the context window) modes. It is automatically triggered when the conversation is idle and the context reaches the threshold.
  • recall tool: The model can call recall(id) to restore the original conversation evidence behind any observation or reflection.
  • Memory tab: A “Memory” tab is added to the conversation view ring, displaying the memory list, worker progress, contents, and debug logs in real time.
  • Rollback button: A button is added below each user message, allowing users to fork the conversation in one click and put the original text back into the input box.

Installation and Enablement

Before installing, ensure your DSH version meets the requirements. This plugin only supports the DeepSeek Harness prerelease line (0.1.5-rc.2, 0.1.7-rc.1, 0.2.0-rc.1).

Install via the DSH CLI:

dsh plugin --profile web add dsh-observational-memory

After installation, restart the DSH Web service. In the Web UI, go to Settings → Plugins → Plugin Configuration, and find the Observational Memory card to configure it.

Configuration

Configuration items are located under the observational-memory namespace. Core parameters are as follows:

  • Threshold controls:
    • observeAfterTokens: Number of incremental tokens that triggers the observer (default 10000).
    • reflectAfterTokens: Number of incremental tokens that triggers the reflector (default 20000).
    • compactAfterTokensMode: Threshold mode selection (calibrated or ratio).
    • compactAfterTokensRatio: Threshold in ratio mode (default 0.68).
  • Model override:
    • model: Optional override for the model used by the memory workers. The configuration card supports three-level selection by provider, model ID, and reasoning strength. If all are left blank, it follows the current session model.
  • Other settings:
    • passive: Passive mode switch. When set to true, proactive background triggering is disabled (only manual triggering and recall are retained).
    • debugLog: Whether to record debug logs.

Usage

  • Viewing memory: Click the “Memory” tab in the conversation view ring to view currently visible memory, complete records, and worker runtime progress.
  • recall tool: After the model sees a memory ID in compressed memory, it can call recall(id) to retrieve the original conversation evidence with timestamps.
  • Rollback operation: Click the “Rollback” button below a user message to fork a new conversation at the nearest turn boundary before that message, and put the original message text back into the input box for editing and resending.

Applicable Scenarios and Notes

  • Version restriction: Only supports the DSH prerelease line (0.1.5-rc.2, 0.1.7-rc.1, 0.2.0-rc.1); stable versions are not supported yet.
  • Subagents: Subagent conversations do not participate in memory and proactive compression.
  • Headless mode: The Memory tab depends on the Typert Remote endpoint and is unavailable in Headless runs without an API Gateway, while other features work normally.
  • Rollback button limitations: The rollback button remains disabled for the first message, attachment-only messages, or messages without text.
  • Token estimation: All token counts are estimates (approximately 4 characters/token).

Conclusion

The plugin solves the problem of context loss in long conversations by using a background pipeline and compression rendering with zero model calls. You can get the source code and more details from the GitHub repository epcn-fla/dsh-observational-memory.