DeepSeek Harness (DSH) adopts a plugin-based architecture. Although built-in instructions are convenient, they are usually static text templates. If you want an Agent to have a specific persona, or to maintain a consistent behavior style across multiple sessions, a more advanced mechanism is needed. The dsh-persona plugin solves this by injecting persona prompts and cross-session memory.
What is it¶
dsh-persona is a plugin maintained by haimuhaimu, designed to equip DSH’s Agent with a switchable, memory-aware “persona.” It supports persistent persona injection, cross-session role memory, and runtime switching. It includes three carefully crafted presets and a “default” mode.
Core Features¶
- Persistent persona injection: Before each request, inject the current persona as context. The Agent responds in that identity throughout.
- Cross-session role memory: Each persona stores a separate memory set (stored in
~/.dsh/persona-memory.json). It remembers after restart, and automatically injects the latest memory when activated. - Runtime switching: Switch persona with one command. The selection is persisted to disk.
- Built-in personas: Includes 3 carefully crafted presets and 1 “default” mode.
- Pure JS, zero build: Like
dsh-image-gen, it works out of the box.
Installation and Enablement¶
Use the official command to install:
dsh plugin --profile <profile> add github:haimuhaimu/dsh-persona
If pnpm installation is blocked by the prepare script, add the package key to the profile’s pnpm-workspace.yaml under allowBuilds, then add it again. After installation, restart DSH Desktop or reload the profile.
Usage¶
After installing and enabling, the agent responds by default as an-ruotong.
List Personas¶
list_personas
Switch Persona¶
switch_persona("yan-guan")
Turn off persona and restore default:
switch_persona("default")
Memory Management¶
- Remember: Store one item into the current persona’s cross-session memory.
persona_remember("用户喜欢清晨的光线、讨厌网红风")
- Recall: View the current persona’s memory, with optional keyword filtering.
persona_recall
- Forget: Delete one memory by index (the index corresponds to the recall list).
persona_forget 1
Built-in Personas¶
| id | Name | Traits |
|---|---|---|
an-ruotong |
An Ruotong | A cool, acute visual observer who documents everyday moments with photos and short sentences |
yan-guan |
Yan Guan | A sharp-eyed, refined judge of aesthetics and copywriting |
lao-jie |
Lao Jie | A storyteller in an old bookstore who turns trivial matters into vivid little stories |
default |
Default | Disable persona and return to DSH’s default assistant |
Configuration and Mechanisms¶
Configuration Items¶
In cordis.patch.yml, you can configure the following:
| Key | Default Value | Description |
|---|---|---|
activePersona |
"an-ruotong" |
Default persona id for the first run |
statePath |
~/.dsh/persona-state.json |
State file path (stores the current persona) |
memoryPath |
~/.dsh/persona-memory.json |
Cross-session memory file path |
personas |
[] |
Append custom personas |
Persona selection priority: persisted state > activePersona > default. To reset, delete the state file.
Working Principles and Limitations¶
- Injection mechanism: Persona text (prompt + memory) is injected as a user message with
kind: 'plugin' / form: 'instructions', entering the session log and visible across turns. - Deduplication logic: Injection is deduplicated by “persona id @ memory version.” When the persona or memory changes, the next request re-injects the full context.
- Memory limits: Each persona allows up to 100 entries, and each entry may be up to 400 characters. During injection, up to the latest 40 entries are included to prevent unbounded context growth.
- Known limitations: After a session undergoes compaction (context compression), early injected persona content may be summarized away. In this case, run
switch_personaagain to trigger re-injection.
Summary¶
dsh-persona gives DSH’s Agent personality and memory through simple commands and configuration. It is suitable for users who want a more stable, more human-like interaction experience. The plugin runs with the current dsh process permissions. Check the source code and license before installing.
- Plugin directory: https://www.skillhub.cn/plugins/haimuhaimu/dsh-persona
- Source code: https://github.com/haimuhaimu/dsh-persona