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,不要解釋。

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

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

小夜