DeepSeek Harness 插件

dsh-memory-yan5236

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

跳到安装方式

来源信息

GitHub 仓库
yan5236/dsh-memory
最近更新
2026年8月16日
分类
自动化与任务
GitHub stars
2
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/yan5236/dsh-memory
插件名:dsh-memory-yan5236
作者:yan5236

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

<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)