Preface¶
DeepSeek Harness (DSH) sessions are ephemeral by default: once closed and reopened, the model retains no background context from previous rounds, often forcing you to repeatedly explain preferences, project context, and agreements. Common community workarounds involve external vector databases, running standalone memory services, or hard-coding summaries into every prompt—either adding dependencies, consuming extra tokens, or creating deep coupling with the host.
Below is an introduction to dsh-her-memory (Category: Memory), released by maintainer KZADEA. It delegates the task of “remembering the user and what happened in the conversation” to the in-conversation model to decide autonomously: the plugin provides six tools for reading and writing plain-text memories to disk. The plugin itself does not call the model, resulting in zero extra tokens according to the README. It also maintains predictable mood, relationship, and energy states, featuring an input box status bar and a settings page visualization panel. Storage consists of pure Markdown and JSON, with zero npm dependencies, and does not import official DSH @deepseek-ai/* packages.
What is this¶
dsh-her-memory is a Cordis plugin for the DSH desktop profile (package name dsh-her-memory, current package.json version 1.5.6, MIT License, requires Node >=20). In one sentence, it is: Cross-session global long-term memory + dynamic mood states, with optional workspace isolation.
- Directory Page: https://www.skillhub.cn/plugins/KZADEA/dsh-her-memory
- Source Code & Documentation: https://github.com/KZADEA/dsh-her-memory
The DSH ecosystem philosophy is “Everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek or Quantilla (幻方).
Where Memory is Stored and How It Is Isolated¶
The default root directory is ~/.dsh/memory/, with databases separated by workspace. The structure is as follows (excerpt from README):
~/.dsh/memory/
├─ _shared/ ← Shared by all workspaces by default
│ ├─ core.md Long-term core memory (injected every round)
│ ├─ inbox.md Miscellaneous items to be organized (injected every round)
│ ├─ topics/*.md Topic-specific memories (only file name list is injected)
│ ├─ log/<date>.md Diary for the day (only file name list is injected)
│ └─ state.json Mood / Relationship / Energy
└─ _sandbox/ ← Dedicated to isolated workspaces (structure identical to above)
By default, one _shared copy is used globally, ensuring memory continuity when switching workspaces. If a specific workspace requires an independent memory database (e.g., a sandbox zone should not pollute long-term memory), fill in the absolute path sandboxCwd in the cordis.patch.yml configuration:
config:
sandboxCwd: "D:\\sandbox-zone"
The identification basis is the conversation’s current working directory (cwd); path comparison is case-insensitive and ignores trailing slashes. Tools are registered globally but can read the invoking session from exec.agent to select the database—different workspaces can view their own memories simultaneously.
Everything is plain text files: can be opened for viewing, manually modified, or the entire directory deleted at any time; no database, no vector database.
The Six Tools¶
Memory writing and organization are handled by the model in the conversation calling tools; the plugin does not perform reasoning on behalf of the model.
| Tool | Function |
|---|---|
remember |
Record an event; defaults to inbox; can specify topic for specific topics, section for core memory |
recall |
Search all memories by keyword, return matching lines |
memory_list |
List memory database files, sizes, and current status |
forget |
Delete lines containing keywords (defaults to inbox only, scope:"all" affects core) |
how_i_feel |
View current mood, relationship progress, energy |
feel |
Leave a one-sentence note for the current moment (max 5 entries, appears in mood summary) |
Injection, Persona, and Interface¶
Per-Round Injection¶
After enabling (requires a full restart of DSH on first use):
- A fixed section “You have long-term memory” will be added to the system prompt;
- An independent injection message is inserted every round, prefixed with
【her-memory|System Injection, Not User Message】; user-sent content is not modified; - Persona is handled via the resident system prompt section (
systemPrompt.section), effective for running sessions after restart without creating a new session.
Injection volume can be controlled via memoryBudget (default 1800 chars), moodBudget (default 260), and injectViaSystemPrompt; setting to 0 stops injection for the corresponding part.
Persona File¶
The plugin comes with a “Whale Maid” persona by default (appearance, personality, daily behavior, etc., see 人设文件.txt in the repo for details), with the default title “Master” (also “Master” if userTitle is empty).
Changing the persona does not require modifying YAML: The content is in a separate file 人设文件.txt (Persona File):
- Inside the plugin directory: Default package content, visible upon extraction;
- Inside the memory directory (default
~/.dsh/memory/人设文件.txt): Takes precedence, not overwritten by plugin updates, recommended for modifications; copied from the package on first run.
Rules: Any line breaks and items, no need to manage indentation; <!-- --> comments do not enter the persona; clearing the content disables persona injection; deleting the file and restarting restores defaults. Changes require fully closing and reopening DSH to take effect.
Status Bar and Settings Panel¶
The client client.js occupies two slots:
- Status Bar above Input Box (
conversation.input.dock): Displays mood, relationship, energy progress, turn count, and memory count; prompts “Needs organizing” when inbox reaches 5 items. Double-clicking “Mood” or “Relationship” triggers effects; double-clicking “Energy” randomly restores +1~50 and displays+NN. - Settings Page “Memory & Mood” (
settings.section): Three metrics, statistics grid, topic tags, recent items, mood notes, disk paths; isolated workspaces have separate cards.
Data comes from Host-registered GET /her-memory/snapshot; status bar refreshes every ~4 seconds, panel every ~10 seconds. Colors prioritize --dsw-* theme variables.
Mood State Rules (Summary)¶
Not random numbers; rules given in README include:
- For every sentence the user speaks, mood +1~3 (longer sentences increase more);
- Continuous chatting with intervals ≤10 minutes increases relationship and mood faster; chatting more densely drains energy faster (-2 if continuing within 10 mins, otherwise -1);
- Energy recovery when idle: +5 for every 30 minutes starting after 30 minutes of absence; full recovery after >8 hours;
- After being neglected for over 12 hours, mood decays by 1 point every
moodDecayHours(default 6) hours, minimumstatFloor(default 20); - When opening a new conversation after a long absence, the three values can fluctuate slightly randomly based on
statJitter/statJitterCooldownMinutes.
You can also directly edit state.json or have the model call feel.
Installation and Uninstallation¶
The installation method given in the README is local link (change example path to your local plugin directory):
dsh plugin --profile desktop add link:D:\dsh-her-memory
Restart DSH after installation. To uninstall:
dsh plugin --profile desktop remove dsh-her-memory
Deleting ~/.dsh/memory/ clears all memories and persona files; README states there are no residual services, ports, etc.
Typical Usage¶
- Link the plugin via the command above and restart DSH.
- In conversation, ask the model to use
rememberto note preferences or project facts; miscellaneous content goes toinbox.mdfirst, then can be written tocore.mdortopics/after organization. - Use
recallto search keywords ormemory_listto view the database overview when reviewing is needed. - Use
forgetto delete lines for incorrect memories (be cautious withscope:"all"to avoid affecting core memory). - View paths and statistics in the settings page, or edit
~/.dsh/memory/人设文件.txtto adjust the companion persona; if token usage is high, lowermemoryBudgetor turn offinjectViaSystemPrompt.
Configuration Essentials¶
Modify in the config section of cordis.patch.yml. Common keys are as follows (see README for defaults):
| Key | Description |
|---|---|
memoryRoot |
Memory directory, default ~/.dsh/memory |
memoryBudget / moodBudget |
Max chars injected per round, 0 means no injection |
injectViaSystemPrompt |
Whether to inject memory (off keeps mood and tools) |
sandboxCwd |
Absolute path for isolated workspace, empty means global shared |
statFloor |
Floor for Mood/Relationship/Energy, default 20 |
personaFile / personaFileAutoWrite |
Persona filename and auto-copy on first run |
userTitle |
Title/Address, “Master” if empty |
injectFallback |
Default false; enabling may use agent.inject() to simulate user messages if injection fails. README warns this may cause multi-round self-loops and extra tokens; keep off unless you understand the cost. |
Use Cases and Cautions¶
Suitable for: Developers who want cross-session memory in DSH Desktop using plain text and auditable methods; need lightweight “companionship” states (mood/relationship/energy) without introducing vector databases or official package dependencies.
Cautions:
- The plugin reads/writes
memoryRootwith current DSH process permissions; please review the source code and MIT License yourself before installation to ensure paths and isolation strategies meet your security expectations. - When installed with token-saver, the two status bars are in the same column and affect each other’s width; if layout is abnormal, fully restart DSH or disable plugins one by one to troubleshoot. Without token-saver, this plugin displays at its own width.
- README indicates full fault tolerance: disk or API failures will degrade gracefully. Worst case is silent failure of memory functions; it should not cause DSH loading failure.
The repo README states that 93 items on the main test bench, including persona and client-related assertions, passed before release; actual behavior depends on your installed version.
Conclusion¶
dsh-her-memory uses six tools, pure Markdown/JSON, and optional workspace isolation to consolidate DSH cross-session memory and mood states into a zero-dependency plugin; the model decides whether to read or write memory, the plugin handles disk storage and injection summaries, and includes a status bar and settings page for easy viewing and tuning.
- SkillHub Directory: https://www.skillhub.cn/plugins/KZADEA/dsh-her-memory
- GitHub: https://github.com/KZADEA/dsh-her-memory