Preface¶
When working on projects with DSH, agents frequently encounter the same types of issues across multiple conversation turns: pitfalls that were clearly understood in a previous session are re-encountered from scratch in a new dialogue; practices summarized in a specific conversation lack a stable location for reference or citation. Relying on chat history retrieval is imprecise, and numbering cannot be aligned consistently over the long term.
The following introduces the community plugin @moyu-cn/dsh-knowledge (Maintainer: MoYu-CN, Category: Memory). It maintains a set of Markdown volume-based knowledge bases under each project, allowing agents to write “Pitfalls” and “Methods” into a fixed structure, and retrieve or inject them via tools and interfaces in subsequent sessions according to usage conventions.
What is this¶
dsh-knowledge is a plugin for DeepSeek Harness (DSH): The Host side semi-registers 8 agent tools and homologous HTTP routes, while the Client side provides settings, conversation header buttons, and a right-side knowledge base panel; library files are stored by default in the 知识库/ (Knowledge Base) directory under the project root.
The principle in one sentence: Reusable practices go into 方法/ (Methods), and encountered pitfalls go into 避错/ (Pitfalls); entry IDs M-0XX / P-0XX are append-only and immutable, while volumes and indexes are maintained automatically by the tools.
The original English introduction is: Project knowledge base for DSH agents: capture pitfalls and reusable methods into paged volumes and surface them while you work.
Core Features¶
Agent Tools (8)¶
| Tool | Function |
|---|---|
kb_guide |
Returns entries to follow based on the current task; check before starting work |
kb_search |
Keyword search |
kb_add |
Add a new pitfall or method entry |
kb_list |
List summaries of all entries |
kb_get |
Read full text by ID |
kb_remove |
Delete an entry (irreversible) |
kb_prune |
Clean up to no more than N entries, deleting only the oldest ones |
kb_init |
Establish the knowledge base skeleton; can also build a library for a brand new project |
When writing Pitfall entries, the README requires four mandatory sections: Trigger Conditions, Do First, Why, and Violation Symptoms.
Interface and HTTP¶
- Settings → “Enable Knowledge Base Precipitation”: Precipitation status, storage location (if empty, each project creates
知识库/in its own root directory), capacity per volume, and total limit. - Conversation header “View / Precipitate”:
Viewopens the right-side panel;Precipitatehands the current conversation to the agent to extract insights and write them to the library. - Homologous HTTP routes include
/__kb/list,/__kb/get,/__kb/search,/__kb/distill, etc., for use by the Client and browser panels.
The settings UI switches between Chinese and English based on the host language; prompts for the model remain in Chinese by design. You can turn off “Inject Usage Conventions” or “Mandatory Reading for This Project” in the settings to control the amount of context injection.
Library Directory Structure¶
<项目根>/知识库/
├── 00-开始这里-总纲.md
├── 方法/
│ ├── 00-方法主体.md
│ └── 方法-01-【领域】.md
└── 避错/
├── 00-避错主体.md
└── 避错-01-【领域】.md
Volumes are divided by domain, with 10 entries per volume; when full, a new volume is opened. The plugin data directory defaults to <DSH 安装根>/.dsh-knowledge-data/ (containing config.json); if “Knowledge Base Parent Directory” is filled in the settings, new projects will be centralized under that directory, but existing entries will not be automatically moved.
Installation and Activation¶
Recommended to install from npm (command from original source, do not modify package name manually):
dsh plugin add @moyu-cn/dsh-knowledge
After installation, restart DSH as prompted (Host side); the client side requires a page refresh for the settings row and right-side panel to appear.
Alternative: tarball installation dsh plugin add https://registry.npmjs.org/@moyu-cn/dsh-knowledge/-/dsh-knowledge-0.1.0.tgz; or clone and use dsh plugin add "link:<your_directory>/dsh-knowledge" for local symlink development. The version in package.json is 0.1.0, License MIT.
Compatibility notes: The README states it is tested and usable on DSH Desktop 2.0.17 (@deepseek-ai/* 0.2.0-rc.2); it requires the host to provide webServer and several official client injection packages (see dsh.client.inject in the repository’s package.json).
Typical Usage¶
1. Build library for the first time¶
If there is no 知识库/ under the project, the tool will report an error and provide a kb_init(...) suggestion that can be copied, without silently creating files. Initialization can be triggered by the agent or by you in the conversation.
2. Check workflow before starting¶
Before performing a specific task, call kb_guide to match entries to follow based on trigger conditions; results may differ from the keyword inclusion matching of kb_search, which is an intentional design.
3. Write pitfalls or methods¶
Use kb_add to append entries; when the total volume reaches the set limit, the write will be rejected, requiring manual decision on which entry to delete (kb_remove or kb_prune).
4. Distill from conversation¶
Click “Precipitate” in the conversation header, allowing the agent to extract categories and domains from the current conversation and write them to the library; you can also browse and search existing entries in the right panel.
Applicable Scenarios and Notes¶
Suitable for: Long-term maintained code repositories; teams or individuals needing to retain “project-specific pitfalls and routines” across sessions; scenarios requiring stable, citable numbering (e.g., “see P-012”).
Boundaries (Explicitly stated in README):
- No automatic library creation; reporting an error when no library exists is expected behavior.
kb_remove/kb_pruneare irreversible; confirmation is required before deletion.- The plugin reads and writes to the disk with the permissions of the current DSH process; before installation, you should read the GitHub Source Code and the MIT License to evaluate whether to include it in your workflow.
The DSH ecosystem is “Everything is a Plugin”; the SkillHub Directory Page is a community site and has no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-knowledge turns pitfalls and methods from agent conversations into paged Markdown volumes within the project, using monotonic numbering and automatic indexing to support subsequent retrieval and citation. If you perform repetitive engineering tasks in DSH, you can install the plugin first, run kb_init for the project, and then configure capacity and injection strategies in the settings.
- Directory Page: https://www.skillhub.cn/plugins/MoYu-CN/dsh-knowledge
- Source Code and Full Documentation: https://github.com/MoYu-CN/dsh-knowledge