hjqcan/dsh-goodmemory
DeepSeek Harness 的自动跨会话 GoodMemory 回忆与回写
项目介绍Project Overview
dsh-goodmemory 是 DeepSeek Harness 的持久跨会话记忆插件,基于 GoodMemory。它在模型步骤前召回相关记忆,并在成功回合后写回用户与助手文本;适用于需要长期上下文、跨会话延续的 DSH 工作流。注意:仅发送直接用户文本和最终助手文本,工具、推理、图片不写回;DSH RC 版本需匹配支持范围。
dsh-goodmemory is a DeepSeek Harness plugin that adds durable, cross-session memory via GoodMemory. It recalls relevant context before a model step and writes completed user/assistant exchanges after successful turns, for workflows needing long-term continuity. Caveat: only direct user text and final assistant text are stored; tool calls, reasoning, images, and injected context are excluded, and supported DSH RC versions are strictly pinned.
请帮我了解并安装插件:【dsh-goodmemory】【https://github.com/hjqcan/dsh-goodmemory】
把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.
或使用命令行安装(适合开发者)Or use CLI install (for developers)
命令行安装CLI Install
dsh plugin --profile web add dsh-goodmemory@0.1.1
把 hjqcan/dsh-goodmemory 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-goodmemory
Automatic, durable, cross-session memory for DeepSeek Harness, backed by GoodMemory.
The plugin recalls relevant memory before a DSH model step and writes the completed human/assistant exchange after a successful turn. Recalled context is an identified DSH user/message, so everything visible to the model remains reconstructable from the session log.
completed DSH turn -> GoodMemory remember -> later DSH pre-step
-> GoodMemory recall -> durable user/message -> model
Compatibility
| Package/runtime | Supported version |
|---|---|
@deepseek-ai/dsh |
0.1.0-rc.8 |
goodmemory |
0.7.5 |
| Node.js | ^22.19.0 or >=24.0.0 |
| Bun, managed mode only | >=1.3.14 |
DSH is still an RC. This package deliberately pins its DSH peers; a new RC is unsupported until the integration suite passes against it.
Install
Install from npm:
dsh plugin --profile web add dsh-goodmemory@0.1.1
dsh --profile web --dump-config
dsh --profile web
For a local checkout:
pnpm install
pnpm pack
dsh plugin --profile web add ./dsh-goodmemory-0.1.1.tgz
Use --profile headless instead of web for the headless composition. The bundle inserts one goodmemory row; later profile, home, and CLI patch layers can replace its complete config.
Managed mode
Managed mode is the default. It starts the published goodmemory-http-bridge on a random loopback port, creates an in-memory bearer token, enables the recommended retrieval preset, and stores SQLite data at $DSH_HOME/goodmemory/memory.sqlite.
Install Bun first. GOODMEMORY_BUN_BINARY may name a non-default Bun executable. To choose a different database path, override the row in the profile's cordis.patch.yml:
- id: goodmemory
name: dsh-goodmemory
config:
mode: managed
databasePath: /absolute/path/to/memory.sqlite
The plugin waits for in-flight writeback during normal HMR or process teardown, then terminates the managed sidecar. It does not automatically restart a sidecar that crashes after activation; DSH keeps running without memory and logs the failure until the plugin is reloaded.
External mode
External mode connects to an existing GoodMemory HTTP bridge. Keep the token in an environment variable, not in DSH config:
export GOODMEMORY_HTTP_BRIDGE_TOKEN='replace-with-a-secret'
goodmemory-http-bridge --recommended
- id: goodmemory
name: dsh-goodmemory
config:
mode: external
baseUrl: http://127.0.0.1:8739
tokenEnv: GOODMEMORY_HTTP_BRIDGE_TOKEN
Activation verifies health, the exact phase-39.http-memory.v1 contract, and authenticated recall. Invalid config, a missing token, failed authorization, or a contract mismatch fails plugin activation.
Behavior and configuration
type Config = {
recall?: boolean // default true
writeback?: boolean // default true
maxRecallTokens?: number // default 256
requestTimeoutMs?: number // default 10000
scope?: {
userId?: string
workspaceId?: string | null
agentId?: string | null
}
} & (
| { mode?: 'managed'; databasePath?: string; startupTimeoutMs?: number }
| { mode: 'external'; baseUrl: string; tokenEnv?: string }
)
- Recall runs only when the final
agent/pre-stepbatch contains directsource.kind === "user"text. Tool-only continuations and plugin context do not trigger another lookup. - Completed-turn writeback contains all direct user text and the final assistant text. Tool calls/results, reasoning, images, recalled memory, and other injected context are excluded.
- Writeback uses GoodMemory's normal extraction and policy. The plugin sends no annotations and does not force content to become durable memory.
- Runtime recall/writeback failures are logged with phase, session, and turn identity, then the DSH turn continues. Startup failures remain fatal.
- The next recall for the same durable scope waits for pending writeback, including a new session created immediately after the preceding turn.
Scope
Defaults are deliberately DSH-isolated:
userId: DSH's persisted anonymous user id under$DSH_HOME;workspaceId: SHA-256 of the normalized session working directory, ordsh-workspace:globalwithout a working directory;agentId:dsh;sessionId: the current DSH session id.
GoodMemory's durable scope excludes sessionId, so different DSH sessions in the same user/workspace/agent scope share long-term memory. To share with another GoodMemory host, explicitly configure the same userId, workspaceId, and agentId; set nullable workspace/agent fields to null when the other host omits them.
Privacy and management
The plugin does not copy DSH JSONL logs or create a second memory schema. It sends only selected text to GoodMemory: direct human text plus the final assistant text. GoodMemory remains the sole memory/storage truth.
The first release intentionally adds no model tools, MCP server, DSH command, or management UI. Use GoodMemory's existing CLI and Inspector for health, review, revision, export, and forgetting:
goodmemory inspector serve
Development
pnpm test
pnpm typecheck
pnpm build
pnpm test:e2e # real Bun + GoodMemory SQLite restart proof
pnpm pack
The deterministic integration suite uses a scripted DSH model adapter. It verifies logged recall context, completed-only writeback, tool/reasoning exclusion, scope isolation, write-after-read ordering, runtime degradation, and strict startup validation. No benchmark uplift claim is made.
nexu-io/open-design
freestylefly/awesome-gpt-image-2
anywhere-labs/dsh-desktop
walkinglabs/learn-harness-engineering
awesome-dsh-plugin/awesome-dsh-plugin
MemTensor/MemOS