Skip to main content

How to use dsh-task-memory

Provides task-isolated long-term memory for DeepSeek Harness: each task's memory is stored separately, with memory read, write, retrieval, and prompt injection only effective within the current task.

This article is auto-derived from indexed fields (wiki / faq / compatibility_json), not freshly AI-generated.

This article is derived from the plugin's already-indexed fields (wiki / faq / compatibility_json / readme), not freshly generated by AI. Source field is noted at the end of each section.

Quick start

dsh-task-memory

— source: plugin_wiki.wiki_content

Install & verify

dsh plugin --profile web add github:wangyihao0001-oss/dsh-task-memory

Run the command above in your DSH Web Profile. Then enable the plugin in the plugin list.

— source: plugins.install

Key points

  • Files are plain JSON — safe to hand-edit or back up
  • Writes go through tmp file + atomic rename, so readers always see a consistent snapshot
  • On startup, stale *.tmp files from crashed writes are cleaned up (only those older than 1h, so another process's live write is never touched)
  • Only the vault bound to that session (or the cwd-derived default)
  • Prefer pinned entries, then recent ones, up to injectLimit / char budgets

— source: plugin_wiki.readme_en (fallback readme_raw)

FAQ

Will memory files remain after uninstalling the plugin?

Yes. Memories are stored as pure JSON in ~/.dsh/storages/task-memory/. Uninstalling the plugin will not delete these files; to completely clean up, you need to manually backup or delete that directory.

Will prompt injection content leak across tasks?

No. Prompt injection is registered per agent scope, and each session's system prompt only contains memories belonging to its own task; memories from other tasks and other sessions are never visible.

Does keyword search support Chinese?

Yes. Retrieval uses English tokenization + Chinese bigram matching (adjacent two-character combinations), but it's still lexical matching and does not support vector retrieval or semantic similarity.

What happens if I write a new key after the vault is full?

It will fail to write and report a clear error (prompting to forget or unpin first), never silently discarding; however, in-place updates (upsert) to existing keys won't be rejected due to capacity, and it will try to shrink non-pinned entries.

Do I still need to manually specify taskId?

Not by default: when not bound, a stable task id is automatically derived from the session's working directory (cwd). When running multiple projects simultaneously, call memory_bind_task to explicitly switch.

How to pin versions in production?

When installing, append the 40-character commit SHA after the package name, for example dsh plugin --profile web add "github:wangyihao0001-oss/dsh-task-memory#<sha>", to prevent upstream updates from being automatically pulled in.

Do I need to restart DSH after upgrading/uninstalling?

Yes. The plugin injects into the host layer via cordis.patch.yml. After installation or removal, you must restart dsh web (or restart the profile) to let Cordis reload.

Can I write sensitive information into memory?

Not recommended. Both the README and tool description clearly warn against writing keys, tokens, or personal privacy; the vault is pure JSON, so when backing up or manually editing, it will still be written to disk.

— source: plugin_wiki.faq_json

Compatibility

  • DSH: >=0.1.0-rc.8 (peer 依赖 @deepseek-ai/dsh-agent ^0.1.0-rc.8;其他 dsh-* peer 均为 ^0.1.0-rc.6)
  • Node: >=20 (package.json#engines.node)

— source: plugin_wiki.compatibility_json

Pitfalls

Review the upstream repo before installing. This guide is auto-derived from indexed fields and may lag the latest release. If anything contradicts the official docs, treat the upstream source as authoritative.

— source: general rule