DeepSeek Harness (DSH) often encounters issues such as loss of conversational context, disorganized memory management, and personality drift when building agents with long-term memory and stable personalities. Existing memory solutions often lack a hierarchical structure, resulting in low retrieval efficiency.
dsh-lan-memory (Lan: Memory and Personality System) is a DSH plugin designed to address these pain points. Through a three-tier memory architecture, personality injection mechanisms, and Mood state pool management, it provides agents with persistent cross-session memory and stable personality expression.
Core Features¶
- Three-tier memory architecture: Divides memories into three levels: resident (always injected), retrieval (keyword-based retrieval), and experience library (distilled lessons and methods).
- Personality system: Includes SOUL static drafts and MOOD output contracts, providing a stable personality foundation for agents.
- Mood state pool: Automatically generates state information across four dimensions—Vibe, Sparks, Reflections, and Will—before each reply, assisting with personality evolution and debugging.
- One-click cleanup: Provides manual deduplication and merging, with automatic backups before writing to ensure data safety.
- Editable personality: Supports online modification of SOUL and MOOD contracts in the GUI settings page; changes take effect immediately after saving.
- Dependency-free storage: Based on pure JSONL file storage, with no external databases or runtime dependencies.
Installation and Activation¶
Use the following command to install the plugin. Replace <插件目录绝对路径> with the actual path.
dsh plugin --profile web add <插件目录绝对路径>
Verify the installation:
dsh --profile web --dump-config | grep lan
To uninstall, run:
dsh plugin --profile web remove dsh-lan-memory
Data files are saved in the ~/.dsh/hanako/ directory by default. Uninstallation does not delete these files.
Typical Usage¶
The plugin provides tool functions with the lan_ prefix for the model to invoke proactively during conversations.
- Resident memory: Use
lan_pinto add critical information that must always be injected.
lan_pin("用户偏好", "喜欢美式咖啡")
- Retrieval memory: Use
lan_rememberto record information and tag it for later retrieval.
lan_remember("用户是医学总监,关注肠内营养", ["用户偏好"])
The model can proactively invoke `lan_recall` during conversations based on context.
- Personality configuration: The personality configuration file
persona.jsonis stored in~/.dsh/hanako/and loaded and injected on plugin startup. The default personality is “Whale Girl”, and GUI online editing is supported.
Use Cases and Notes¶
This plugin is suitable for agent development scenarios that require long-term memory and high personality consistency. It does not rely on external databases, and data is stored in local files, making it suitable for scenarios with data privacy requirements.
Note: The plugin runs with the permissions of the current DSH process. It is recommended to check the source code and license (MIT) before installation.
Short Conclusion¶
dsh-lan-memory lowers the development barrier for long-term agent conversations through layered memory and personality injection. Its pure JSONL storage approach also ensures lightweight design and portability.
Project URL: https://github.com/kiefeng/dsh-lan-memory