Introduction

DeepSeek Harness (DSH) is a plugin-based platform. dsh-memory (maintainer: haitang1) provides persistent memory for each session. It addresses the issue of agents losing context or state across multiple turns, by automatically injecting summaries, providing memory tools, and generating session summaries to enable long-term memory capabilities similar to Codex.

Core Features

This plugin mainly provides the following capabilities:

  • Codex-like persistent memory: Provides persistent memory storage and retrieval mechanisms.
  • Auto-injected memory summary: Automatically injects a global memory summary into every prompt, enabling the agent to use historical information.
  • Memory tools: Provides a complete set of memory read/write tools, supporting create, delete, update, query, and rollback of history.
  • Per-session rollout summaries: Automatically distills each conversation turn into session summaries and periodically merges them into global memory.
  • Localized Web settings card: Provides a visual settings card in the Web interface, supporting localized configuration.

Installation and Enablement

During installation, specify a version hash to obtain a stable version. After installation, restart DeepSeek Harness.

  1. Use the CLI to install the plugin:
dsh plugin --profile web add 'github:haitang1/dsh-memory#f3c8de4'
  1. Restart DeepSeek Harness.

How It Works

When the plugin runs, it manages memory files under the $DSH_HOME/memories/ directory.

  • File structure:

    • memory_summary.md: Global memory summary, injected whenever a prompt is assembled.
    • rollout_summaries/<sid>.md: Turn summaries for a single session, generated automatically.
    • raw_memories.md: Raw memory entries appended by date.
    • journal.jsonl: Memory change log, used for merging.
    • summary_history/: Stores old summary versions, used for rollback.
    • archive/: Archives expired raw entries.
    • state.json: Manages version and log cursor.
  • Injection mechanism: Each time a prompt is assembled, systemPrompt.context re-reads memory_summary.md, ensuring the latest memory is available.

  • Seeding mechanism: On first run, it reads content from $DSH_HOME/AGENTS.md as the initial summary and does not overwrite the original file.

Configuration Options

The plugin supports adjusting behavior via a configuration file or the Web card. The following are key configuration items:

Configuration Default Description
memoryDir $DSH_HOME/memories Memory storage directory.
maxBytes 8000 Byte budget for the injected summary.
consolidateMaxBytes 40000 Byte budget for inputs sent to the model during summary consolidation.
keepSummaryVersions 20 Number of historical summary versions to keep, for rollback.
autoSummarize true Whether to automatically distill conversation turns into summaries.
consolidateEvery 3 How many turn summaries trigger a global consolidation.
seedFromAgentsMd true Whether to seed memory initialization from $DSH_HOME/AGENTS.md.
scopedMemory false Whether to enable workspace- or project-scoped memory isolation.
redactSecrets true Whether to automatically redact sensitive information in summaries.

Typical Usage

  • Re-reading summaries: The plugin automatically injects the contents of memory_summary.md each time a prompt is assembled.
  • Seed initialization: On first use, the plugin automatically reads $DSH_HOME/AGENTS.md as the initial memory seed.
  • Memory tools: Directly operate on memories through tools such as memory_read, memory_add, and memory_search.

Notes

  • This plugin is distributed under the MIT License.
  • It uses $DSH_HOME/memories/ as the storage path. Ensure the directory is writable.
  • Before installing, review the source code and license to ensure compliance with your usage policies.