Skip to main content

How to use dsh-memento

Add bounded, hierarchical, approval-gated, auditable cross-session memory to DeepSeek Harness: local

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-memento

— source: plugin_wiki.wiki_content

Install & verify

dsh plugin --profile web add dsh-memento

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

— source: plugins.install

Key points

  • Model-visible ⟺ logged. The injected snapshot lands verbatim in request/header.system; every write is reconstructable from approval/asked + approval/decided + the plugin's own audit table.
  • git channel (latest main): dsh plugin --profile web add git+https://github.com/PerryLink/dsh-memento.git.
  • npm channel (published releases): dsh plugin --profile web add dsh-memento.
  • tarball channel: npm pack in this repo, then dsh plugin --profile web add ./dsh-memento-<version>.tgz.
  • uninstall: dsh plugin --profile web remove dsh-memento (the memory database and session logs are kept).

— source: plugin_wiki.readme_en (fallback readme_raw)

FAQ

What is the relationship between this plugin and the officially recommended MCP memory server?

The two can coexist. dsh-memento is DSH's native local first-party memory solution (local SQLite, zero network), while MCP memory is the external server route recommended by official documentation; this plugin does not exclude MCP, positioning itself as an alternative implementation with the same goal but without relying on external processes.

Where is memory data stored? Is it uploaded to the network?

Stored by default at $DSH_HOME/dsh-memento/memory.db, POSIX permissions 0600, pure local SQLite. The plugin explicitly declares network:none / credentials:none in its manifest, and does not initiate any network requests throughout its entire lifecycle.

Can the model bypass write approval?

Cannot be bypassed. The approval gate is implemented within the write methods of the ctx.memory service (not the tool layer), and any path calling add / replace / remove / seed must go through the approval waterfall; writePolicy is a configuration invisible to the model.

What happens when it's full? Does it auto-compress?

It will not automatically compress; it throws a structured BUDGET_EXCEEDED error with current usage and limit attached. The model should first consolidate or delete entries before retrying, and the Provider layer will never silently truncate.

If memory is modified during a session, does the model's snapshot update immediately?

No. The snapshot is frozen once when assembling the prompt for each session's first time; memory changes during the session are only persisted and audited, not rewritten to the already injected system segment; this is to stabilize prefix caching, and is part of the design that what the model sees can be reconstructed from the session log.

Will uninstalling the plugin lose memory data?

No data will be lost. After the uninstall command is executed, both the SQLite database and session logs are preserved, and old sessions can be loaded normally (since the plugin never appends unregistered event types to the session log).

Does it support substring search for Chinese (CJK) memory entries?

Yes. The retrieval engine uses case-insensitive instr instead of FTS5, precisely because SQLite's built-in trigram / unicode61 tokenizers fail to index single CJK characters; instr naturally works correctly for Chinese scenarios.

What happens if two DSH processes under the same $DSH_HOME write simultaneously?

SQLite serializes writes through busy_timeout, but cross-process consistency is not guaranteed; the first writer wins. This is consistent with official warnings from Hermes and other terminal memory solutions, and the plugin documentation explicitly states this limitation.

— source: plugin_wiki.faq_json

Compatibility

  • DSH: 0.1.0-rc.6+
  • Node: ^22.19.0 || >=24.0.0
  • Platforms: macOS, Windows, Linux
  • Native modules: node:sqlite

— 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