Preamble

DeepSeek Harness (DSH) follows the “everything is a plugin” philosophy. In real-world use, an Agent often loses prior context each time it starts a new session, requiring repeated confirmation of preferences or facts.

dsh-pi-memory is the DeepSeek Harness port of pi-memory, a popular memory plugin in the Pi ecosystem. It provides DSH with cross-session persistent memory, supporting long-term fact recording, daily log appending, to-do list management, and optional semantic search.

Features

The plugin provides the following core tools:

  • memory_write: writes long-term memory or today’s log.
  • memory_forget: deletes memory entries and generates a recovery record.
  • memory_restore: restores deleted entries using a recovery ID.
  • memory_read: reads memory files or lists daily logs.
  • scratchpad: manages the to-do list (add, complete, undo, and clean up).
  • memory_search: searches across all memory files (requires qmd support).
  • memory_status: checks health status, including file location and the status of qmd/collection/embeddings.

All memory content is stored as Markdown files in the $DSH_HOME/agent/memory/ directory.

Installation

The plugin has not yet been published to npm and must be installed via a local path.

# 1. 克隆仓库并安装依赖
git clone https://github.com/GongYuanCaiJi/dsh-pi-memory.git
cd dsh-pi-memory && npm install

# 2. 添加到 DSH Profile(headless 模式需先添加 @deepseek-ai/dsh-headless@next)
dsh plugin --profile "$P" add @deepseek-ai/dsh-headless@next
dsh plugin --profile "$P" add .

Usage

After installation, the Agent automatically loads memory context.

  • Basic recording: Directly ask the Agent to remember a fact.
    你:记住:我偏好深色模式。
    Agent:...
  • Query memory: Query it in a brand-new session.
    你:我上次说过偏好什么?
    Agent:...
  • To-do list: Use the scratchpad tool to manage tasks.
  • Improve searchability: Use #tags and [[wiki-links]] in memory content.
    #preference [[editor]] 用户偏好 Neovim + LazyVim 配置。
  • Check status: Run memory_status to confirm the status of memory files and qmd.

Notes

  • Installation method: Currently only local path installation is supported; the plugin is not published to npm.
  • Language: The prompts injected into the Agent and the memory context templates are the upstream English originals.
  • Search dependency: memory_search requires qmd support. When semantic search is first enabled, qmd embeddings require downloading a model (approximately 1 minute).
  • Windows compatibility: On Windows, if qmd is available in the Shell but not in DSH, ensure node_modules is in PATH, or the plugin will invoke the qmd entry directly via Node.
  • Getting the latest state: In stable mode, use memory_read or memory_search to obtain the latest state instead of relying on the injected context.

Ecosystem Context

DeepSeek Harness (DSH) follows the “everything is a plugin” philosophy. This plugin is maintained by GongYuanCaiJi, and the code and logic are 100% from pi-memory (MIT License). The community directory (SkillHub) is an independent site and has no affiliation with the official DeepSeek organization.