Introduction

When developing agents in DeepSeek Harness (DSH), the context window is limited, and cross-session memory usually has to rely on explicit tool calls (such as view_file and grep) to retrieve historical documents. This creates 1-2 rounds of retrieval overhead at the beginning of a conversation and easily misses implicit conventions that are not stored in files.

The DeepSeek Harness - MiMoCode Workspace Automatic Memory Plugin is built on the MiMoCode memory architecture and is designed to solve the above issues. It uses background asynchronous distillation and structured persistence so that the Agent can understand the project context from the start, and automatically accumulates knowledge during idle time without consuming conversation tokens.

Plugin Overview

  • Name: DeepSeek Harness - MiMoCode Workspace Automatic Memory Plugin
  • Owner: Rainpomelo
  • Category: Memory
  • License: MIT
  • GitHub: https://github.com/Rainpomelo/deepseek-harness-mimo-memory
  • Catalog: https://www.skillhub.cn/plugins/Rainpomelo/deepseek-harness-mimo-memory

Core Features

This plugin mainly implements the following features:

  1. Zero Tool-Call Pre-injection at Start: When a session starts, it automatically reads and injects the project’s long-term memory, without requiring the Agent to run retrieval tools first.
  2. Background Asynchronous Distillation and Consolidation: When the Agent is idle, it automatically analyzes verified conclusions and user conventions, and silently updates memory files.
  3. Cross-Session Task Checkpoint Recovery: It records task phases and active status via checkpoint.md, supporting breakpoint recovery after a session reset.
  4. Explicit Structured Persistence Tool: It provides the update_project_memory tool, allowing the model or user to append or replace content by section.
  5. Global Cross-Session Persistence: Memory data is stored in the local file system and shared across different sessions.

Working Mechanism

The plugin follows the original MiMoCode four-layer hierarchical memory and asynchronous scheduling model:

  1. Layer 1: Core Facts and Architecture Contracts (MEMORY.md)

    • Serves as globally persistent storage across sessions, maintained in a standard three-section structure.
    • When assembling the system prompt at the start of a session, it is automatically compiled and injected at the beginning of the System Prompt.
  2. Layer 2: Workspace Task Checkpoint (checkpoint.md)

    • Records the most recent workspace objectives, task phases, and active status.
    • When a session is created or reset, checkpoint context is automatically included to help the Agent continue from where it left off.
  3. Layer 3: Background Asynchronous Distillation and Consolidation

    • Monitors the Agent’s idle state and extracts verified conclusions and user conventions in the background.
    • Runs purely asynchronously, without consuming conversation context tokens or increasing conversation response latency.
  4. Layer 4: Active Persistence Tool

    • Provides the update_project_memory tool, supporting precise appending or replacing content by Markdown section.

Installation and Enabling

  1. Clone the repository locally, for example C:/plugins/deepseek-harness-mimo-memory.
  2. Open the configuration file for the Web profile (~/.dsh/profiles/web/package.json or the corresponding path).
  3. Add the plugin to dependencies and dsh.profile.bundles:
{
  "dependencies": {
    "dsh-mimo-memory": "file:C:/plugins/deepseek-harness-mimo-memory"
  },
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "dsh-mimo-memory"
      ]
    }
  }
}
  1. Enter the profile directory and run installation and startup:
cd ~/.dsh/profiles/web
pnpm install
dsh --profile web

Option 2: Reference Directly from GitHub

Configure it in the profile’s package.json:

{
  "dependencies": {
    "dsh-mimo-memory": "github:Rainpomelo/deepseek-harness-mimo-memory"
  }
}

Configuration and Storage

Workspace Isolation

The plugin encodes each workspace directory with a cross-platform conflict-free slug (for example, C:\Agent code\deepseek maps to --C-Agent~0020code-deepseek--) and isolates storage by projectKey. Memory is uniformly saved under the ~/.dsh/memory/<project-slug>/ directory.

Configuration Parameters

Configuration Item Type Default Description
memoryRoot string ~/.dsh/memory Root directory for globally persistent memory storage
maxChars number 12000 Maximum number of characters injected per workspace at the start of a session, preventing context overflow
autoDream boolean true Whether to enable automatic background distillation and consolidation when the Agent is idle

Memory File Storage Structure

The plugin automatically generates the following files:

~/.dsh/memory/
├── --C-Agent~0020code-deepseek--/
│   ├── MEMORY.md          # 长期核心规则与技术沉淀
│   └── checkpoint.md      # 最近任务断点与阶段检查点

Typical Usage

1. Automatic Memory Injection

The plugin automatically injects the content of MEMORY.md when a session starts, so the Agent can directly reference project background information at the start without extra retrieval steps.

2. Active Update Tool

The plugin registers the update_project_memory tool for the Agent. This tool can be used to explicitly manage memory content:

  • section: Specifies the section (such as “Architecture and Technology Selection” or “Verified Conclusions”).
  • content: The specific fact or rule.
  • action: append (append, with automatic deduplication) or replace (overwrite).

When the Agent is idle, it automatically triggers the background Dreaming process, scanning recent interactions and updating the files above.

Notes

  • The plugin runs with the permissions of the current dsh process. Check the source code and license before installation.
  • The plugin runs purely asynchronously. It does not block the main conversation thread, does not consume conversation context tokens, and does not increase conversation response latency.
  • Different projects are strictly isolated by projectKey and do not interfere with each other.

Conclusion

This plugin implements cross-session long-term memory for DeepSeek Harness through the file system, making it suitable for development scenarios that require long-term codebase maintenance or complex multi-round iteration.