Preface¶
The DeepSeek Harness agent usually loses context after a session ends, resulting in “forgot who you are” or “forgot earlier agreements.” dsh-memory provides a cross-session semantic memory layer in any configuration profile, solving this issue without introducing new infrastructure. It aligns with DSH’s “everything is a plugin” philosophy and implements local vector storage and retrieval using SQLite and Zhipu Embedding-3.
Plugin Positioning¶
- Name:
dsh-memory - Description: Cross-session semantic memory plugin for DeepSeek Harness, supporting installation in any configuration profile.
- Maintainer:
mnbvcxzaqwertyuioplm - License: MIT
Core Capabilities¶
The plugin registers three core tools in Web/Headless configuration profiles:
memory_add: Persists facts worth retaining long-term; entries are automatically vectorized upon ingestion.memory_search: Retrieves relevant facts semantically (via cosine similarity), with keyword fallback. If semantic retrieval is unavailable, it automatically degrades to pure keyword matching.memory_update: Corrects, retracts, restores, verifies, edits, sets, or links existing memories. Replaced entries retain history (marked assuperseded) instead of being deleted directly.
The underlying technology stack uses Zhipu embedding-3 (2048 dimensions) + SQLite (node:sqlite) + cosine similarity computation. The plugin has zero-configuration behavior: if the Zhipu Key, database, or service is missing, it degrades gracefully without crashing the DSH process.
Installation and Enablement¶
Use the official plugin installation command to add the plugin to the target configuration profile (example: web):
dsh plugin --profile web add dsh-memory
After installation, you must restart the DSH Web process, because the Bundle layer the plugin depends on only takes effect at startup:
systemctl restart dsh
Typical Usage¶
- Semantic retrieval command: Enter
/mem <question>in the editor. The agent prioritizesmemory_searchto retrieve memories (results are presented as collapsible tool cards), and then answers based on the memories. - Forced memory signal words: Configure
forceMemoryWordswith specific trigger words (e.g., “remember”, “important”). When a user message contains these words, the agent is forced to callmemory_addfirst to store the fact, then provide an answer.
Notes and Limitations¶
- Zero new infrastructure: The plugin does not depend on a standalone vector database or sidecar container; all data is stored in SQLite.
- Process restart: After changing the configuration, always restart the DSH Web process so the Bundle layer takes effect.
- Length limitation: By default, entries longer than 800 characters are truncated, while the full length is still displayed; set
full: trueto return the full text. - Timeout configuration: Embedding calls have an 8-second timeout. Under poor network conditions, the plugin fails fast and falls back to keyword search, avoiding session stalls.
Conclusion¶
dsh-memory solves the challenge of cross-session agent memory with minimal write overhead: a few hundred bytes in SQLite and one HTTP request. It provides a low-cost semantic recall solution, suitable for scenarios requiring long-term memory of specific user preferences or project conventions.