Foreword

Running agents in DSH (DeepSeek Harness) results in the loss of session context once the conversation ends. Writing preferences, project conventions, and historical conclusions into the prompt can help retain some information, but the manual maintenance cost for each session is high, and auditing changes is difficult. Cloud-based vector databases or hosted memory services can solve persistence, but data leaves the local machine, making recovery and rollback less intuitive.

dsh-memory (GitHub repository seriousz158/dsh-memory, bundle name dsh-git-memory) takes a different approach: storing long-term memory in a local Git repository. When enabled, the DSH plugin injects a summary, provides a settings page toggle, a clear confirmation, and an optional idle session sync. Maintained by seriousz158, the current version is v0.8.2 under the MIT license; as of 2026-08-26, it has approximately 67 GitHub stars and 2 forks.

What This Is

dsh-memory is a local, Git-versioned long-term memory plugin for DeepSeek Harness. It does not rely on hosted memory services or cloud vector databases. Memory data is separate from the plugin source code repository and defaults to ~/.dsh/storages/memory (a different local absolute path can be specified via the environment variable DSH_MEMORY_ROOT).

The plugin consists of two halves: the host and the settings UI, installed together as a bundle. After registering the memory settings namespace, memory.enabled takes effect before the next model call without requiring a restart of the DSH process.

Core Features

Local Git Storage

Memory is written as Markdown into a separate Git repository with a structure roughly as follows:

summary.md      # Short navigation and preference snapshot
handbook/       # Reusable knowledge
rollouts/       # Results extracted per session
archive/        # Superseded entries
scripts/        # Transcript filtering helpers
.last-sync      # Optional sync watermark

summary.md is a bounded, explicitly untrusted snapshot for the model (with a 12 KiB limit); details are placed in handbook/, rollouts/, and archive/. Records support front matter, namespace IDs, sources, expiration projections, and deterministic conflict handling.

Reading and Retrieval

When memory.enabled is true, the host injects memory guidelines into the model. At runtime, the following can also be called:

  • memory.search(): Local, bounded retrieval with citations.
  • memory.context(): Returns context in a deterministic order based on usage.

Read usage is written to private metadata in .sync/usage.json; the README states that transcripts, prompts, credentials, or memory bodies are not written to the journal.

Settings Page and Safe Clearing

The DSH settings include a “Long-term Memory” row where you can view repository status, toggle the switch, preview and rollback, and Delete memory with two-step confirmation. Before clearing, a recovery point is preserved in Git: a clean repository reuses the existing HEAD, while if the target path has uncommitted changes, a checkpoint commit is created first before recording the cleared state. The plugin rejects unsafe repository layouts, symlink escapes, non-repository root directories, and path races during clearing.

The only persistent setting is:

memory:
  enabled: true

The UI communicates through fixed memory remote service calls, such as memory.getSettings(), memory.setEnabled(), memory.status(), memory.clear({ confirmation: "DELETE_MEMORY" }), etc. The settings page does not expose the filesystem root path and does not directly execute Git.

Optional Idle Session Sync

An optional headless synchronizer processes only idle local session logs, editing isolated copies in a private workspace for each run. After validation by the host, changes are written to the online Git repository. The default permission is workspace-write, it does not silently install DSH, and only forwards environment variables from a whitelist. The host provides dry-run / preview / apply, operation locks, health checks, bounded batches, and retry backoff. Recovery, rollback, backup import/export, and legacy migration can be completed via the CLI / host API (migration is not exposed in the settings UI).

Installation and Enabling

The project is installed via GitHub source code and distributed through GitHub Releases; it is not published to npm. It is recommended to use the DSH plugin bundle to install the host and UI with a single command:

dsh plugin --profile web add github:seriousz158/dsh-memory

After installation, restart the selected DSH profile. The bundle does not include any memory data, session logs, credentials, or the local .dsh directory.

For local development or integration, clone the repository and use the installation script within it (requires Node.js ≥ 22 and aligned testing with DSH 0.1.0-rc.7):

git clone https://github.com/seriousz158/dsh-memory.git
cd dsh-memory
npm install --global @deepseek-ai/dsh@0.1.0-rc.7
npm ci --ignore-scripts
./integrations/dsh/install.sh

Example for non-default paths:

export DSH_HOME="$HOME/.config/dsh"
export DSH_MEMORY_ROOT="$HOME/Documents/dsh-memory-data"
./integrations/dsh/install.sh

The installation script will link dsh-memory and dsh-memory-ui under the profile and initialize the memory root directory as a private local Git repository if it is missing. After restarting the DSH host, enable the “Long-term Memory” switch in settings, and the next model call can participate in recall.

Typical Usage

Enable memory and view status in settings

After installation and restart, keep memory.enabled: true. In DSH Settings under “Long-term Memory”, view the repository and recent sync status. To disable recall, simply toggle the switch off—no need to delete the repository.

Retrieve memory in agent logic

The exposed host API supports bounded retrieval (refer to the repository README and DSH Cordis documentation for specific calls). The typical pattern is to fetch entries related to the current task via memory.context() before the session starts, or to call memory.search() in the toolchain and reference the returned source citations.

Clear learned memory

Only use the settings page clear if you confirm you want to delete the contents of summary.md, handbook/, rollouts/, and archive/, and complete the second confirmation string DELETE_MEMORY. Before the operation, Git leaves a rollbackable commit for recovery in case of accidental deletion.

Optional: Idle session sync

If you wish to incrementally distill memory from local idle session logs, run the headless synchronizer in an environment configured with the synchronizer and DSH_MEMORY_ROOT according to project documentation. Sync runs in an isolated workspace, and preview / dry-run can be used before applying.

Compatibility and Environment

Component Supported Versions
DSH runtime peer @deepseek-ai/dsh@^0.1.0-rc.6 (including rc.7)
Recommended test runtime 0.1.0-rc.7
Node.js 22.x
Python 3.11.x
Git Local executable in PATH
Operating system macOS is the official support/integration test target

DSH rc.8 and higher versions have not yet been validated by this repository’s test suite. DSH_MEMORY_ROOT must be consistently set during installation, every host startup, explicit initialization, and synchronizer runs; a one-time installation assignment does not automatically apply to subsequent LaunchAgent tasks.

Use Cases and Notes

Who is it for

  • Developers who wish to maintain DSH long-term memory in a single-machine, auditable Git history without using cloud memory services.
  • DSH users who need a settings page toggle, clear confirmation, rollback, and optional session sync.
  • Teams already using DSH 0.1.0-rc.6 / rc.7 graphs on macOS (other platforms require self-verification).

Precautions before use

  • The plugin reads and writes the local repository and environment with the current DSH process permissions. Before installation, read the source code and MIT license to confirm that the memory path and clearing behavior are acceptable.
  • The memory repository and the plugin source code repository are two separate Git instances; for backup or migration, operate on the directory pointed to by DSH_MEMORY_ROOT.
  • Community directories like SkillHub are independent sites, not officially affiliated with DeepSeek / High-Flyer; plugin lists and star counts may change, so refer to the GitHub repository.

Conclusion

dsh-memory places DSH’s long-term memory in a local Git repository: a single bundle installation command, a memory.enabled toggle, bounded summary.md injection, and optional idle sync—providing an auditable, rollbackable memory workflow without relying on hosted services.

  • Community directory page: https://www.skillhub.cn/plugins/seriousz158/dsh-memory
  • GitHub: https://github.com/seriousz158/dsh-memory