Introduction¶
When running Agents in DeepSeek Harness (DSH), common pain points include: preferences, project conventions, and prohibitions written in conversations are lost when switching sessions or opening new windows; if long text is stuffed into skills or disk documents, the model might not read it in every turn. The community plugin dsh-destinywind-memory (maintained by rickwindman) uses SQLite for persistent memory and injects entries into the system prompt of every session. Starting with v2, it abandons Markdown file storage to prevent content like ## headers or comments from being silently split or reinterpreted by parsers. The following section describes what it does, how to install it, and how to use it.
What is this?¶
dsh-destinywind-memory is a “Memory” category plugin for DSH: it allows adding and deleting memories via the Web GUI settings, supports optional HTTP API script modifications, writes the entire database into the system prompt on the Host side, and performs runtime enforcement on “Hard Constraints.” In terms of implementation, it does not modify other DSH files but integrates purely as a plugin via dsh.bundle.patch.
- Directory Page: skillhub.cn/plugins/rickwindman/dsh-destinywind-memory
- Source Code & Docs: github.com/rickwindman/dsh-destinywind-memory (MIT, current package version 2.0.0)
- Runtime Environment: Node ≥ 22.5 (Uses built-in
node:sqlite, no additional native dependencies)
Core Features¶
Settings Page “Memory”¶
The settings navigation adds a “Memory” page (settings.section Slot, order: 16), positioned below “Plugins” and above “Skills”. Users can add (with optional tags), browse, delete entries, or click “Refresh” to re-read.
Raw SQLite Storage¶
Memories are saved in the SQLite file memory.sqlite. The body text is stored exactly as written and read exactly as stored, unaffected by Markdown syntax.
Default Path (Windows example):
%USERPROFILE%\.dsh\destinywind-memory\memory.sqlite
The DSH_HOME environment variable can override the DSH data root directory. The table structure includes memories (id, title, text, created_at) and tags (associated by entry, preserving tag order). Limits (per source material): Body text up to 8000 characters (truncated if exceeded), up to 12 tags, up to 1000 entries. v2 no longer maintains a Markdown mirror; memory.md is read only once when upgrading from v1 and then renamed to memory.md.v1.bak.
Three-Layer Injection: Making Constraints Harder to Skip¶
The plugin splits memories into “Hard Constraints (Must Obey)” and “Background Knowledge (Reference if relevant)” and injects them into three locations:
| Location | Content | Purpose |
|---|---|---|
System Prompt order: 216 |
Full database, presented in two groups | Distinguish between mandatory rules and background info |
Runtime Context order: 100 (user role snapshot) |
Hard Constraints only | Short instructions are easier to follow; refreshed every turn without accumulating |
System Prompt order: 9999 (Tail) |
One-line “Memory Check” reminder | Leverages tail recency for self-checking before action |
Determination of Hard Constraints: Tags contain “约束/规则/偏好/规范/要求” or constraint, OR the body text contains words like “必须/禁止/不要/不得/务必/一定要/只能/只用/都要/偏好/约束/规则/规范”; you can also explicitly add the 约束 tag. The tail reminder can be disabled in the patch configuration:
config:
tailReminder: false
Automatic Migration from v1¶
On the first startup of v2, the plugin imports from old formats in one go (marked by .migrated-to-sqlite), including destinywind-memory/memory.md (v1.1), memory.json (v1.0), and the earlier plugin name hindsight-memory/memory.json; upon success, original files are renamed as backups. If entries already exist in the database, legacy files are not merged. Note: Entry corruption caused by ## parsing in v1 cannot be automatically restored; it is advisable to check the entry count after import.
HTTP API (Optional)¶
Shares the same source as the settings page, facilitating script-based memory maintenance (port depends on the actual dsh web, not necessarily 3080):
| Action | Request |
|---|---|
| List | GET /dsh-destinywind-memory/memories |
| Add | POST /dsh-destinywind-memory/memories, body { text, title?, tags? } |
| Delete | DELETE /dsh-destinywind-memory/memories/<id> |
PowerShell Example for Adding (per source material, replace $port with your Web port):
$port = 19387 # Replace with your actual port
$body = @{ text = 'Memory body text'; tags = @('tag') } | ConvertTo-Json
Invoke-RestMethod -Method POST -Uri "http://127.0.0.1:$port/dsh-destinywind-memory/memories" `
-Body ([System.Text.Encoding]::UTF8.GetBytes($body)) `
-ContentType 'application/json; charset=utf-8'
Installation & Activation¶
The plugin declares dsh.bundle.patch. After installing the bundle, you must restart dsh web for changes to take effect; for client.js changes, simply refresh the page.
Install from GitHub (Original README syntax, replace target with repository):
plugin_manager { action: "install_bundle", target: "rickwindman/dsh-destinywind-memory" }
Uninstalling does not delete memory.sqlite; if you wish to clear memories, you must manually delete the database file in the data directory.
The DSH ecosystem follows the principle “Everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer. The plugin runs with the permissions of the current dsh process; please review the source code and MIT license before installing.
Typical Usage & Writing Suggestions¶
The README suggests: Since memories enter the system prompt of every conversation, they should be kept short.
- Constraint-type info (“Must/Prohibited” categories): One item per line, can carry the
约束tag. - Long knowledge: Write as a Skill, leave only a one-line index in memory; place the Skill body at
%USERPROFILE%\.dsh\skills\<name>\SKILL.md. - Larger materials: Place in disk documents, write only the path in memory.
Use Cases & Precautions¶
Suitable for: Project specifications, personal preferences, or brief background indexes that need to be stable across sessions; scenarios where constraint-type entries need to be repeatedly emphasized in both system and user snapshots.
Precautions:
- The entire database is injected into all sessions; too many entries or excessively long body text will consume context; adhere to limits like 8000 characters and 1000 entries.
- The API and Web GUI share the same port; expose it only locally or in networks you trust.
- Host-side changes require a restart of
dsh web; storage layer and end-to-end behavior can be self-tested vianpm testin the repo or by runningnode tests/store-sqlite.test.mjsandnode tests/memory-bank.test.mjsseparately (not required for installation).
Conclusion¶
dsh-destinywind-memory uses SQLite for durable long-term memory and distinguishes constraints from background via three-layer injection, bridging the gap where “just writing a sentence to reference” is easily overlooked by models. After installing the bundle and restarting the Web, you can maintain it in the Settings “Memory” page or integrate it into automation via the HTTP API.