DeepSeek Harness 插件

dsh-memory-ben7am1n

Durable cross-session memory for DeepSeek Harness: local SQLite FTS5 store, three model-facing tools, and a recall prompt section — no embedding service and no sidecar(英文原文)

跳到安装方式

来源信息

GitHub 仓库
ben7am1n/dsh-memory
最近更新
2026年8月13日
分类
插件市场与管理
GitHub stars
1
载体类型
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/ben7am1n/dsh-memory
插件名:dsh-memory-ben7am1n
作者:ben7am1n

检查来源文件

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

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

dsh-memory

Durable cross-session memory for DeepSeek Harness.

The harness ships no memory plugin. Its extension-cookbook names the mechanism — a prompt section plus tools — but nothing implements it, so every session starts blank. This package fills that gap with one local SQLite file: no embedding service, no API key, no sidecar process.

Install

dsh plugin --profile web add dsh-memory

The shipped bundle row stores memories at $DSH_HOME/memory/memory.db, shared by every profile on the machine.

What it gives the model

ToolPurpose
memory_writeStore one self-contained durable fact, optionally tagged and pinned
memory_searchKeyword search over memory text and tags
memory_forgetDelete a memory that is now wrong or obsolete

Plus a memory:recall prompt section that renders pinned memories first, then the most recently updated, under a character budget. Recall therefore does not depend on the model remembering to search — what it stored is already in front of it, and search is for anything older than the budget allows.

The memory_write description steers the model away from the common failure modes: transient task state (that is what the todo list is for), secrets, and facts the repository already records.

Configuration

- id: memory
  name: dsh-memory
  config:
    path: !!js dshHomePath('memory/memory.db')
    promptRecentCount: 10
    promptMaxChars: 2000
    maxTextChars: 2000
    searchLimitDefault: 10
    searchLimitMax: 50
    promptOrder: 50
FieldDefaultMeaning
path— (required)SQLite file, or :memory: for an ephemeral store
promptRecentCount10Unpinned recent memories offered to the prompt section
promptMaxChars2000Budget for the rendered section; overflow is reported as a count, and pinned memories are emitted first so they survive a tight budget
maxTextChars2000Maximum characters accepted for one memory
searchLimitDefault10memory_search limit when the model omits it
searchLimitMax50Hard cap, whatever the model asks for
promptOrder50Section order; -100 is the harness identity, 0 the persona

path has no code-side default on purpose: a default would scatter durable user facts into whatever directory the harness happened to start in. The deployment value lives in the patch row.

Storage

One SQLite file: a memories table plus an external-content FTS5 index kept in sync by triggers. Parent directories are created on open, and the store survives process restarts.

Search compiles the query by quoting every token, so FTS5 operators a model happens to type (OR, *, -, ") are matched literally instead of changing the query's meaning or raising a syntax error mid-tool-call. Surviving tokens combine with FTS5's implicit AND: every token must appear, and a query whose tokens include a word you did not store legitimately matches nothing.

node:sqlite is still flagged experimental in Node 22/24, so running the harness prints one ExperimentalWarning. The harness's own dsh-session-query-sqlite uses the same module.

Failure behavior

Load-time misconfiguration fails loud: an empty path, a non-positive bound, or a searchLimitDefault above searchLimitMax throws at plugin load.

At call time, a blank fact or one over maxTextChars is a tool error the model can correct. A memory_forget for an id that does not exist is a successful result reporting forgotten: false — the model asked for a state that already holds, which is not an infrastructure failure.

Extension points

ctx.tools.register() for the three tools and ctx.systemPrompt.section() for recall. Every registration is a Cordis effect, so unloading the plugin removes the tools and the section together and closes the database.

Development

pnpm install --ignore-workspace
pnpm run typecheck
pnpm test
pnpm run build

Tests cover the store directly (FTS retrieval, the literal-token query contract, prompt ordering, durability across reopens) and the plugin against the real tool registry and prompt service (registration, disposal, the write→recall round trip, bounds, fail-loud config).

License

MIT

Prior art

The idea comes from pi-mentis (MIT) in the Pi ecosystem. This is an independent implementation against Harness extension points and shares no code with it. It deliberately drops pi-mentis's sidecar process, Zvec vector store, and required SiliconFlow embedding key in favour of one local FTS5 file — smaller, keyless, and offline, at the cost of lexical rather than semantic retrieval.