Preface

DeepSeek Harness (DSH) emphasizes “everything is a plugin,” but in its native environment, agents often lack persistent memory across sessions, leading to context fragmentation. Developers need to repeatedly enter background information in multi-turn conversations, or face overly broad memory injection. The dsh-cc-haha-memory plugin aims to replicate the CC-HAHA memory management experience and provide DSH with an explicit, auditable persistent memory solution. It does not rely on external services and implements memory writing and retrieval through native events and tool calls.

Basic Information

  • Plugin name: yihefeikong-rgb/dsh-cc-haha-memory
  • Core value: CC-HAHA-style persistent memory plugin for DeepSeek Harness (DSH)
  • Maintainer: yihefeikong-rgb
  • Category: Memory
  • License: MIT

Core Features

The plugin implements the following core capabilities:
* Real remembering: explicit tool calls. The system confirms an item as remembered only when the LLM returns saved: true.
* Independent file storage: each memory is saved as an independent Markdown file, maintained by an index in MEMORY.md.
* Project isolation: memories are isolated by “general” and “current project” scopes to avoid polluting global context.
* Per-turn recall and session budget: up to 5 relevant memory bodies are injected per turn, already injected memories are not repeated within the same session, and after the cumulative total exceeds sessionMaxBytes, only the index is retained.
* Automatic recording and turn review: supports backend automatic review of information worth retaining long-term, and keeps a buffer on failure.
* Safe update mechanism: updates are performed by memory ID, ambiguous title guessing is prohibited for overwrite, and historical versions are automatically saved before updates and deletions.
* Web UI management interface: provides tabs for searching, editing, and deleting memories.
* Claude memory import: supports non-destructive import of existing Claude Code memories.

Installation and Configuration

Installation

The installation command is as follows:

dsh plugin --profile web add github:yihefeikong-rgb/dsh-cc-haha-memory

After installation is complete, restart the DSH Web process:

dsh web

Verification

Enter any session and send the following test command:

请记住:这个项目使用 Rust 和 Tauri。

A normal trajectory should contain the following tool calls:

Read MEMORY.md → memory_remember → saved: true

Configuration

The default configuration is located in cordis.patch.yml. The main options are as follows:

Option Default Description
reviewEnabled true Whether to enable post-turn automatic review
reviewInterval 1 (schema) / 5 (this package patch) Review once every N turns
reviewTimeoutMs 120000 Total timeout for backend review
recallOrder 117 Injection order for index context
recallMaxBytes 25000 Maximum bytes for injected index
recallRelevantMaxBytes 16000 Maximum bytes for a single relevant body
sessionMaxBytes 61440 Cumulative cap for relevant bodies in this session (0 = unlimited)
dedupeRelevant true Already injected bodies are not injected again within the same session
relevantBodiesEnabled true Whether to inject relevant bodies based on the current query
freezeIndexPerSession true The index fragment is rendered only once per session
selectEnabled true LLM semantic relevance selection
selectTimeoutMs 12000 Timeout for relevance selection
guidanceEnabled true Verification guidance before memory citation registration
recentToolsEnabled true Pass recently used tools to the selector
recentToolsWindow 8 Number of recently used tools to retain
skipReviewAfterAgentWrite true Skip backend review when the main agent wrote the memory itself

Memory Tools

The plugin registers 8 tools for the LLM to call:
* memory_remember: explicit “remember” one-shot visible entry.
* memory_write: create a new memory.
* memory_read: read a complete memory.
* memory_update: update by ID and save a historical version.
* memory_delete: delete and save a historical version.
* memory_search: full-text search within the current scope.
* memory_list: list the index in the current scope.
* memory_suggest_tags: recommend existing tags.

File Structure

Memory files are stored by default under the user directory:

~/.dsh/memory/
├── MEMORY.md
├── 通用/
└── <当前项目>/
    └── <主题>.md

Notes

  • Data privacy: The repository and installation package do not include any user memories, sessions, logs, API keys, or local profiles.
  • Permission requirements: The current workspace must be confirmed before writing; otherwise, the write will fail.
  • Network boundary: The Web API runs within the DSH local same-origin trust boundary; it is not recommended to expose the DSH Web port to untrusted networks.
  • Concurrent writing: The current implementation uses serial writes within a single DSH process; sharing the same memory directory among multiple DSH instances is not recommended.
  • Official status: This project is not an official CC-HAHA component and is not affiliated with CC-HAHA or DeepSeek.

Relationships and Acknowledgments

This project primarily references the memory design concept of CC-HAHA, including independent file storage, explicit write verification, and project isolation. The plugin code is independently implemented using DSH native events, tools, LLM, and Web UI interfaces, aiming to let DSH users enjoy a similar memory management experience.