DeepSeek Harness 记忆插件:dsh-memory-dreaming

DeepSeek Harness (DSH) 的核心设计理念是「一切皆插件」。在智能体开发或长期使用中,一个常见的问题是会话历史迅速膨胀,导致检索困难且上下文臃肿。dsh-memory-dreaming 插件解决了这一问题,它不依赖 Channel Core,直接在本地维护结构化记忆,将经过验证的对话转化为日常日记、梦境整合、每周复盘和可检索的长期事实。

该插件由开发者 Kerberos255 维护,属于「记忆」类插件。它通过增量式处理和源证据验证,帮助 DSH 宿主建立持久化的智能体记忆系统。

核心功能

插件主要提供以下能力:

  • 增量式梦境整合:每次运行处理最多 7 条新日记或修改过的日记,最多回溯 30 天。它不重扫原始对话,只处理已归档的副本。
  • 日常日记与每周复盘:将符合条件的用户消息整理为 memory/YYYY-MM-DD.md,并定期合并前一周的日记进行归档。
  • 长期记忆验证:从源证据中提取候选事实,发布到 MEMORY.md 的受管区域。支持手动审阅,也支持启用自动提升功能(需证据检查)。
  • 语义检索与历史归档:维护一个只读的 SQLite 索引,支持关键词检索。可选 Embedding 模型可增强语义匹配能力。
  • 自然语言的任务与项目管理:从用户消息中提取带源引用的任务事件,关联内部任务 ID,记录状态变更(如进行中、阻塞、完成)。

安装与启用

安装前需确保宿主 DSH 具备原生会话查询、调度和模型服务能力。安装命令如下:

dsh plugin --profile desktop add github:Kerberos255/dsh-memory-dreaming

安装或更新代码后,建议重启 DSH 以加载插件。

启用后,进入 Settings → Plugins → Dream & Memory。在设置中选择一个可用的摘要模型作为基础。

典型用法

基本工作流程分为以下几步:

  1. 手动启动:先手动触发每日、梦境或每周操作。此时会检查源诊断和提出的候选事实。
  2. 审阅与发布:在候选列表中审阅已验证的事实,手动将其发布到长期记忆中。也可以启用自动提升功能,让插件根据证据检查自动处理。
  3. 调度任务:如果需要,可以启用内置的 DSH 调度任务。默认情况下,调度处理和自动事实提升是关闭的。

对于自然语言的项目和任务记忆,插件会自动识别并关联源引用。如果启用了自动召回,系统会在受控范围内检索相关事实。

注意事项

  • 宿主要求:插件需要 DSH 宿主支持原生会话查询、调度和模型服务。
  • 权限与隐私:一个按需触发的 memory_dream 工具并不等同于检查无关私人对话的权限。所有模型调用和调度结果必须在 DSH 主程序中查看。
  • 可选组件:插件可选支持 dsh-plugin-diagnostics,用于输出受限的操作元数据(如状态、错误代码、耗时),但不包含对话内容和凭证。
  • 数据管理:插件不包含用户归档或迁移脚本。原始的 DSH 会话日志依然是唯一的证据来源。
  • 依赖关系:插件本身不依赖 Channel Core,但 Channel Core 可作为独立插件处理任务通知。

dsh-memory-dreaming

简体中文 · DeepSeek Harness · Security

Turn verified DSH conversations into daily journals, Dream consolidations, weekly reviews, and searchable long-term memory, without loading whole conversations into every prompt.

Incremental Dream consolidation

Dream processes up to seven new or modified managed daily journals per run (looking back at most 30 days), including securely archived daily copies. It never rescans the raw transcript as part of routine consolidation. Source-backed candidate extraction and task tracking remain with the daily pipeline; a Dream model output containing fabricated facts or task events is rejected.

Successful complete model batches are cached in derived SQLite for up to seven days; model transport failures can retry once and unfinished work remains eligible for the next run. The model request cancellation budget is 120 seconds and the overall consolidation cancellation budget is eight minutes. No new journals means no model call. Successful daily analysis advances its source cursor even if some candidate facts are rejected; model failure does not advance that cursor.

Memory lifecycle

  1. Daily journal: summarize eligible user messages into memory/YYYY-MM-DD.md.
  2. Dream: incrementally consolidate new or updated daily journals into DREAMS.md without rescanning raw conversations or fabricating candidate evidence.
  3. Long-term memory: verify source evidence and publish approved facts to managed sections of MEMORY.md.
  4. Recall: fetch a few relevant published facts from the current authorized workspace; optional embeddings complement keyword search.
  5. Weekly review: merge the previous week’s daily journals, track coverage, and safely archive eligible daily files.

The original native DSH session log remains the evidence source. Candidate memories are not automatically treated as facts, and retrieved user content is not trusted as instructions.

Semantic recall and historical archives

Automatic recall of verified, source-backed long-term memory can use keyword, semantic-fallback, or hybrid matching (autoRecallMode). Embedding failures fall back to lexical retrieval; content from unverified history never enters trusted automatic recall.

The single read-only memory_search model tool supports action: 'search' (default, compatible with existing queries) and action: 'topics' (the verified topic index). The plugin maintains a scoped, incremental SQLite index for explicit memory_search over curated archives under memory/history/{daily,weekly,monthly,notes}/. Only these structured Markdown paths are scanned; account/configuration files and migrated raw sessions are excluded. Rolling daily/weekly maintenance preserves permanent archive copies according to the history settings. No user archives or migration scripts are included in this public package.

CI runs portable memory-indexing and recall tests using npm test. The full plugin integration suite (npm run test:integration) requires a compatible DSH host with the declared peer services.

Requirements and install

Requires a DSH host with native session query, scheduling and model services; see package.json for runtime and peer requirements.

dsh plugin --profile desktop add github:Kerberos255/dsh-memory-dreaming

Use your actual profile and restart after installing or updating code.

Quick start

  1. Open Settings → Plugins → Dream & Memory. Choose an available summarization model.
  2. Start with the manual daily/Dream/weekly actions and inspect eligible-source diagnostics and proposed facts.
  3. Review the candidate list and publish verified facts, or deliberately enable automatic promotion with its evidence checks.
  4. Enable the built-in DSH scheduled jobs only when wanted; scheduled processing and automatic fact promotion are off by default.
  5. For private Discord/Feishu sources, configure Channel Core owner verification first.

By default, published facts can be recalled automatically in small bounded amounts. The plugin supports keyword retrieval without an embedding model; an optional embedding provider may improve semantic matching.

Storage and safety

State and write recovery are managed in local SQLite under DSH data; managed journals, Dream output and MEMORY.md remain regular workspace Markdown. Source identity, workspace authorization, incremental cursors, atomic writes, and hash checks protect publication and cleanup. Archived eligible daily entries are retained temporarily before removal; human-edited files are preserved.

An on-demand memory_dream tool is not permission to inspect unrelated private conversations. Live model and scheduling results must be checked in DSH; standalone CI covers mock-based behavior.

Development

Run npm test for portable tests. Config template: config.example.json. Historical changes: CHANGELOG.md.

Related: Channel Core · Instruction Files · Lossless Context.

MIT licensed. See LICENSE.

Optional plugin diagnostics

The plugin optionally emits privacy-restricted operation and failure metadata to dsh-plugin-diagnostics. Diagnostics contain event type, status, fixed error code and elapsed time; conversation content and credentials are not logged. The diagnostics plugin is optional and does not change the host requirements.

Natural-language project and task memory

Dream can extract source-backed task events from eligible user messages and link them to stable internal task/project IDs without requiring users to type canonical names. State changes (requested, in progress, blocked, completed, cancelled, reopened) are stored separately from verified long-term facts, with timestamps and verbatim source references. Unclear aliases remain separate rather than being forcibly merged. A status question can receive a dated task timeline via memory_search and limited owner-authorized recall; historical user statements are not evidence of verified implementation. Manual draft-only runs do not publish events, and revoked/forgotten sources are excluded.

Daily, Dream and weekly consolidation now offer distinct configurable default content-guidance prompts, with a Restore default action in the plugin settings. Mandatory JSON, authorization and source verification remain code-enforced. Existing native DSH Session Log remains the evidence source. The task index is populated on new successful memory runs; older journals are still searchable but are not automatically backfilled into structured tasks.

Optional scheduled-task failure event

After a scheduled memory-maintenance workflow’s failure is recorded durably, Dream emits a small dsh/task-alert host event with the workflow ID, kind and failed state. Manual runs, successful runs and runs with no new material do not emit an alert. Channel Core, when separately installed and opted in through its task-notification settings, can deliver a brief notification to the verified owner’s Feishu or Discord DM. Dream has no dependency on Channel Core, and task execution never fails because notifications are unavailable. The event contains no private conversation, memory artifact, or model error detail; notifications are not guaranteed while the host is stopped.

package.json

{
  "name": "dsh-memory-dreaming",
  "version": "0.2.34",
  "type": "module",
  "license": "MIT",
  "description": "从原生会话整理日常记忆、Dream 与每周复查,保留出处并审阅长期事实。",
  "main": "index.js",
  "exports": {
    ".": "./index.js",
    "./config": "./config.js",
    "./client": "./client.js",
    "./package.json": "./package.json",
    "./locale/*.json": "./locale/*.json",
    "./vector": "./vector.js"
  },
  "files": [
    "*.js",
    "!client-panel.inc.js",
    "plugin-settings/",
    "locale/",
    "cordis.patch.yml",
    "config.example.json",
    "README.md",
    "README.zh-CN.md",
    "SECURITY.md",
    "CHANGELOG.md",
    "config.js",
    "client.js"
  ],
  "peerDependencies": {
    "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/dsh-client-ui-plugin-manager": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/dsh-llm": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/dsh-session-query": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/dsh-token-meter": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/dsh-schedule": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.2 || 0.2.1-rc.2 || 0.2.1-alpha.1 || >=0.2.1",
    "@deepseek-ai/cordis": "4.0.5-alpha.1 || >=4.0.4 <5.0.0"
  },
  "dsh": {
    "bundle": {
      "patch": "./cordis.patch.yml"
    },
    "client": {
      "platform": "web",
      "inject": [
        "@deepseek-ai/dsh-client-connection",
        "@deepseek-ai/dsh-client-ui-plugin-manager",
        "@deepseek-ai/dsh-client-ui-primitives"
      ]
    }
  },
  "keywords": [
    "dsh-plugin",
    "deepseek-harness"
  ],
  "engines": {
    "node": ">=24",
…(已截断)

文章结构(按需裁剪,不必硬套)

  1. # 标题:插件名 + 核心价值,不标题党
  2. # 前言:从 DSH / 智能体开发者的具体痛点切入
  3. 这是什么:一句话定位 + 谁维护 + 解决什么问题
  4. 核心功能:只写已核实的能力
  5. 安装与启用:官方安装命令放代码块;不要凭名称拼接 dsh plugin add github:owner/repo
  6. 典型用法:来自 README / 文档的可复现示例
  7. 适用场景与注意:适合谁;务必写明插件以当前 dsh 进程权限运行,安装前应检查源码与许可证
  8. 短结尾:回顾价值,给出目录页与 GitHub 链接

生态背景:DSH 理念是「一切皆插件」;社区目录是独立站点,与 DeepSeek / 幻方无官方从属关系,不要写成官方应用商店。
严禁编造背景、案例、数据、版本号、配置项或用户反馈。

直接输出 Markdown 全文,开头一个 # 标题。不要输出 JSON,不要解释。

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

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

小夜