dsh-compound-memory: Integrating the compound-memory MCP and Skill Pack into DSH

Introduction

When running agents in DeepSeek Harness (DSH), remembering stable facts across sessions and retrieving historical memories before a task begins often requires assembling MCP clients, skill catalogs, and prompt rules yourself. The community’s compound-memory already provides an LLM-free memory MCP service, but aligning it with DSH’s Cordis configuration and skill mounting still requires hand-written patch lines and environment variables.

dsh-compound-memory is a DSH bundle plugin published by maintainer chinwe: it launches the existing compound-memory MCP process, mounts the in-package skills/compound-memory skill, and injects a brief usage reminder on the first entry of each live agent session. It does not reimplement memory logic, nor does it add a sixth MCP tool.

What Is This

dsh-compound-memory (npm package name matches the plugin name, current version 0.1.5, MIT license) targets developers already using the DSH 0.2 prerelease line. The plugin points to ./cordis.patch.yml via dsh.bundle.patch in package.json, inserting three lines into the configuration:

  • mcp-compound-memory: built-in @deepseek-ai/dsh-mcp-client, executing uvx --from compound-memory compound-memory-server via stdio
  • compound-memory-rules: this package’s index.js, responsible for session-level usage reminders
  • compound-memory-skill: built-in @deepseek-ai/dsh-skill-filesystem, mounting only this package’s skills/ directory

engines.dsh requires >=0.2.0-rc.1 <0.3.0-0. The package declares no @deepseek-ai/* dependencies; do not install an old MCP client yourself — DSH 0.2 already ships a matching client.

Catalog page: skillhub.cn/plugins/chinwe/dsh-compound-memory. Source code and docs: github.com/chinwe/dsh-compound-memory.

Core Features

MCP Tools and DSH Naming

The underlying layer is still compound-memory’s five tools; invocation names within DSH are as follows:

MCP tool Name inside DSH
memory_search mcp__compound-memory__memory_search
memory_get mcp__compound-memory__memory_get
memory_write mcp__compound-memory__memory_write
memory_link mcp__compound-memory__memory_link
memory_feedback mcp__compound-memory__memory_feedback

The docs note: the hits field of the object returned by memory_search is an array.

Session-Level Usage Reminders

compound-memory-rules listens for agent/pre-step and appends a user-role message on the live agent’s first qualifying enter (subsequent steps in the same session do not repeat it). The reminder text is defined in RULES in index.js (about 356 characters), with key points including: use COMPOUND_MEMORY_AGENT_ID (default agent-dsh) as both source and agent; run memory_search before non-trivial tasks and call memory_feedback after adopting hits; prefer project-scoped memory within repositories; use only the five mcp__compound-memory__memory_* tools above.

Bundled Skills

skills/compound-memory/SKILL.md contains detailed usage of the five tools; the injected reminder is a short rule, while the skill document is a longer explanation. Non-trivial tasks should memory_search first, call memory_feedback after actually using hits, with agent consistent with COMPOUND_MEMORY_AGENT_ID; only stable facts should be written.

Installation and Activation

Prerequisites: the dsh CLI is installed; uv / uvx must be on the PATH of the process that starts dsh. The first uvx run pulls compound-memory from PyPI and requires network access; Python is provided by uv, with no system Python dependency. This package has no install, lifecycle, or postinstall scripts.

Install from npm (the official command from the materials):

dsh plugin --profile web add dsh-compound-memory

Install from GitHub:

dsh plugin --profile web add github:chinwe/dsh-compound-memory

Install from a local plugin root directory (not a subdirectory):

dsh plugin --profile web add /absolute/path/to/dsh-compound-memory

Restart dsh after installation. Use the following command to confirm the # == dsh-compound-memory layer and the three configuration lines above appear:

dsh --profile web --dump-config

If the memory store has not been initialized yet, you can first run:

uvx --from compound-memory compound-memory init

Environment Variables

Set them on the process that starts dsh; the patch reads them via !!js when loading the configuration. When unset or empty, defaults are used (none are secrets). The stdio subprocess starts with a trimmed parent environment, and the configured env is merged in to override.

Variable Default when unset or empty
COMPOUND_MEMORY_AGENT_ID agent-dsh
COMPOUND_MEMORY_ROOT $HOME/.agents/memory (optional; the server expands $HOME or ~)

If this machine should distinguish memory by a different host id, set COMPOUND_MEMORY_AGENT_ID before starting dsh. To point command to an absolute-path uvx, rewrite the corresponding MCP line in ~/.dsh/profiles/web/cordis.patch.yml (fields consistent with those in the patch).

Typical Usage

  1. After installation and restart, open a new session and send a message. A user reminder whose source.kind is plugin:dsh-compound-memory and whose body starts with compound-memory: should appear in the transcript; it should not be appended again in subsequent steps of the same session.

  2. When handling non-trivial tasks, call mcp__compound-memory__memory_search first; in repository scenarios, prefer project-scoped memory.

  3. After adopting retrieval results, call mcp__compound-memory__memory_feedback with agent set to agent-dsh (or your configured COMPOUND_MEMORY_AGENT_ID).

  4. When writing is needed, record only stable facts via tools such as memory_write; see the in-package SKILL.md for detailed parameters and flows.

To disable only the reminder while keeping MCP and the skill, add the following to the profile or home cordis.patch.yml:

- id: compound-memory-rules
  disabled: true

mcp-compound-memory and compound-memory-skill remain independent ids and are unaffected. To uninstall the plugin:

dsh plugin --profile web remove dsh-compound-memory

This removes the three lines above.

Use Cases and Notes

Suitable for developers who want to quickly integrate compound-memory under the DSH web profile without hand-writing Cordis patches. The plugin runs the MCP subprocess and reads/writes the memory directory with the current dsh process’s privileges; before installing, review the source code and the MIT license yourself to confirm they meet your security and compliance requirements.

Note: the DSH ecosystem emphasizes “everything is a plugin”; community catalogs such as skillhub.cn are independent sites with no official affiliation with DeepSeek / High-Flyer. This plugin does not implement the memory server itself; its behavior is consistent with compound-memory ADR-0001 — the server has no LLM, and this wrapper adds no model calls either.

Conclusion

dsh-compound-memory packages the compound-memory MCP, bundled skills, and session-level rule reminders into a single installation path, letting DSH 0.2 users hook up the five memory_* tools with the official command. See the GitHub README for further details, and the plugin catalog page at skillhub.cn/plugins/chinwe/dsh-compound-memory.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye