DeepSeek Harness plugin

dsh-memory-yan5236

Long-term memory system for DeepSeek Harness: two-phase extraction/consolidation pipeline over session logs, with summary injection and memory tools

Jump to install

Source facts

Repository
yan5236/dsh-memory
Latest update
Aug 16, 2026
Category
Workflow & Automation
GitHub stars
2
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/yan5236/dsh-memory
Plugin: dsh-memory-yan5236
Author: yan5236

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

<p align="right"> <strong>English</strong> · <a href="./README_ZH.md">简体中文</a> </p>

<p align="center"> <strong>dsh-memory</strong> · Long-term memory plugin for DeepSeek Harness </p>

<p align="center"> A two-phase memory pipeline (per-session extraction → global consolidation), a summary that is always injected into new sessions, and four on-demand retrieval tools. </p>

Why long-term memory

Without memory, every session restates user preferences and re-steps known landmines. dsh-memory extracts durable knowledge from finished sessions and periodically consolidates it into a dense navigation summary (injected into every session) plus a grep-friendly handbook, so future sessions need fewer repeated instructions, waste fewer tool calls, and avoid known failure modes.

The design is adapted from the Codex memories system (two-phase extraction/consolidation, three-layer artifact layout, job claims, cooldown, redaction) and re-composed for DSH: no SQLite, no git baseline, no resident consolidation subagent.

Features

  • 🧠 Phase 1 per-session extraction: after a session turns stop (debounced, 3 min default),

its log is read, filtered, rendered, and redacted, then a model extracts structured memory (raw_memory + rollout_summary + slug). Low-signal sessions produce an empty no-op.

  • 🧩 Phase 2 global consolidation: on a cooldown (6 h default) the new raw memories are

merged into MEMORY.md (handbook) and memory_summary.md (dense index, exact v1 first line); raw input is rotated into an archive and never consolidated twice.

  • 📥 Always-injected summary: memory_summary.md (hard size cap) is injected through the

system prompt of every session — zero effort for the model to see the index.

  • 🔍 Four memory tools: memory_list / memory_read / memory_search / memory_add

(writes only on explicit user request).

  • 🔒 Safety discipline: session content is treated as data, never instructions; secrets are

redacted on both input and output; memory paths are confined to the memory root.

  • 🔁 Reliable scheduling: one durable claim per session (KV-persisted); restarts never

re-extract or double-consolidate; failures retry with backoff; orphaned claims recover.

  • ⚙️ Settings page: Settings → Long-term memory for stats, manual runs, and config.

How it works

turn end ──► Phase 1 (per session) ──► rollout_summaries/<slug>.md + raw_memories.md
                                            │
                              (cooldown elapsed / new memories)
                                            ▼
                                     Phase 2 (global)
                                            │
              ┌─────────────────────────────┴────────────────────────────┐
              ▼                                                          ▼
   memory_summary.md (injected into every session)     MEMORY.md (searched on demand)

Installation

> [!NOTE] > Requires DeepSeek Harness. > > Naming: @nanmicoder/dsh-memory is the package identifier (@nanmicoder is the npm-style > scope, dsh-memory the name). This plugin is distributed via GitHub (not npm):

dsh plugin --profile web add 'git+https://github.com/yan5236/dsh-memory.git#main'

Then verify the composition and start:

dsh --profile web --dump-config
dsh web

Open Settings → Long-term memory. Memory files live in $DSH_HOME/memories/ by default.

> [!TIP] > If dump-config does not contain the - id: dsh-memory row, the package is missing from the > profile's dsh.profile.bundles array (the bundle patch layer is not applied) — add > "@nanmicoder/dsh-memory" to that array.

📋 One-prompt install: let DSH do it

Copy the whole block and paste it into a DSH conversation; the agent installs, registers, and verifies the plugin for you:

Please install the DSH long-term memory plugin `dsh-memory` into the `web` profile.
GitHub repo: https://github.com/yan5236/dsh-memory

Requirements:
1. Run: dsh plugin --profile web add 'git+https://github.com/yan5236/dsh-memory.git#main'
2. Check $DSH_HOME/profiles/web/package.json: dependencies should include
   "@nanmicoder/dsh-memory", and the dsh.profile.bundles array should contain
   "@nanmicoder/dsh-memory" (add it if missing — without it the plugin's patch layer
   is not applied).
3. Run: dsh --profile web --dump-config — confirm the output contains "- id: dsh-memory"
   with no errors.
4. Restart DSH: stop the running `dsh web` process, then run `dsh web` again.
5. Verify: the settings page shows "Long-term memory", and the session tool list contains
   memory_list / memory_read / memory_search / memory_add.
6. If any step that writes into the DSH profile directory ($DSH_HOME/profiles) is blocked
   by a permission policy, ask the user to switch to Full access or approve the operation —
   do not bypass it or fail silently.

Configuration

The composition config provides the base layer (the bundled config: {} uses all defaults); the settings page overrides common entries and persists them to DSH storage:

- id: dsh-memory
  config:
    memoryRoot: C:/path/to/memories   # default $DSH_HOME/memories
    provider: deepseek-official       # optional: pin the pipeline model route
    model: deepseek-v4-flash          # paired with provider
    consolidationCooldownMs: 21600000 # consolidation cooldown (6 h default)
    idleDebounceMs: 180000            # post-turn idle window (3 min default)
    maxRolloutsPerRun: 3              # sessions extracted per run
    maxSummaryChars: 8000             # injected-summary character cap

See [README_ZH.md](./README_ZH.md) for the full option table.

Memory layout

<memoryRoot>/
├── memory_summary.md          # injected navigation summary (first line `v1`)
├── MEMORY.md                  # handbook: preferences, procedures, failure shields
├── raw_memories.md            # Phase 1 output awaiting consolidation
├── raw_memories.archive.md    # rotated history of consolidated raw blocks
├── rollout_summaries/         # per-session recaps (evidence layer)
├── skills/                    # reusable procedures promoted by consolidation
└── extensions/ad_hoc/notes/   # user-requested ad hoc notes

Development

pnpm install
pnpm verify
git diff --check

Design and decisions: [DESIGN.md](./DESIGN.md).

License

[MIT](./LICENSE)