Preface¶
When doing multi-turn, cross-session development or collaboration in DeepSeek Harness (DSH), common practices are to stuff descriptions into the skills directory, or paste long documents into the context each time. The former makes retrieval unintuitive; the latter consumes tokens and is hard to reuse. In DSH, the carriers that can be retained long-term and fetched by the Agent on demand are mainly the skills directory and tools registered by plugins.
dsh-knowledge-base turns materials into a plugin: the same local Markdown can be browsed and edited in the GUI, and can also be searched in-session via kb_search and kb_read, instead of being stuffed into the prompt as a whole. Below we introduce its positioning, installation, and typical usage.
What is this¶
dsh-knowledge-base is a DSH plugin published by maintainer gaoheng980610, categorized as “Memory” in the community directory SkillHub. Source code and documentation are in the GitHub repository.
The plugin itself does not contain any preset materials: after installation it only maintains a Markdown tree on the local machine. The Host half uses node:fs to read/write directories and registers Agent tools; the Browser half provides a “Knowledge Base” panel in the sidebar (search, category tree, reading and online editing).
Architecture and core capabilities¶
The plugin splits into two halves, with responsibilities clearly mapped in the README:
| Half | Entry | Role |
|---|---|---|
| Host | lib/index.js |
Reads/writes $DSH_HOME/knowledge-base/; webServer registers same-origin HTTP routes; registers kb_search, kb_read with ctx.tools |
| Browser | lib/client.js |
Loaded via __ModuleLoader__; sidebar “Knowledge Base” and middle panel |
Session side (Agent tools)
| Tool | Description |
|---|---|
kb_search |
Params { query?, limit? }. query is tokenized by spaces, and all tokens must match; when query is omitted it lists all material directories |
kb_read |
Params { id }, returns the full Markdown text of that material |
Human-machine side (HTTP, prefix /knowledge-base, POST + JSON)
The browser panel manages materials via endpoints such as list, read, save, delete, search, stats; list does not return body content, to avoid flooding the frontend or context with the whole library in one go. For specific input parameters and return fields, refer to the repository README.
Where materials are stored and how to organize them¶
The default root directory is $DSH_HOME/knowledge-base/ (commonly ~/.dsh/knowledge-base/):
$DSH_HOME/knowledge-base/
<category>/<name>.md ← directory is the category; id = relative path with .md removed
.trash/ ← deleted materials (recoverable)
File headers may use YAML frontmatter (title, tags, category, updated, source); when there is no frontmatter the title may be taken from the filename. The upper bound for a single document body is 4MB; delete is a soft delete (moved into .trash) and can be manually restored.
Installation and activation¶
The plugin requires DSH version >=0.2.0-rc.2 (see dsh.engines in package.json). The version currently recommended in the README is v0.1.1.
It is recommended to install from GitHub by tag, which facilitates repeated installation and upgrades:
dsh plugin --profile <your profile> add "github:gaoheng980610/dsh-knowledge-base#v0.1.1"
You may also use the Release prebuilt package:
dsh plugin --profile <your profile> add "https://github.com/gaoheng980610/dsh-knowledge-base/releases/download/v0.1.1/dsh-knowledge-base-0.1.1.tgz"
The README notes: on pnpm 11, reinstalling or upgrading the same tarball via a direct link may trigger ERR_PNPM_MISSING_TARBALL_INTEGRITY; when you need to repeatedly install or upgrade, use the github: method above.
dsh plugin add writes dsh-knowledge-base into dsh.profile.bundles in the profile’s package.json. After installation you must restart DeepSeek Harness so that the Host-side HTTP routes and Agent tools, as well as the Browser-side UI, take effect together.
Uninstall:
dsh plugin --profile <profile> remove dsh-knowledge-base
If the entry still remains in dsh.profile.bundles, it needs to be deleted as well.
Typical usage¶
1. Manually maintain materials
After installing and restarting, open “Knowledge Base” in the DSH sidebar to create or edit Markdown by category. Materials are stored only on the local machine; you write them into the plugin directory yourself.
2. On-demand retrieval in-session
Call the tools registered by the plugin in Agent conversations, e.g. search first then read in detail:
- Use
kb_search: withqueryfor keyword search (all tokens must match), or withoutqueryto browse the directory listing. - Use
kb_read: pass the material’sid(relative path with.mdremoved) to read the full text.
This way, long descriptions stay in the knowledge base, and the session only pulls relevant fragments, rather than being stuffed into the system or user message by default.
3. Development and self-testing (maintainer path)
The repository provides offline smoke tests that do not depend on a running DSH instance:
node --check lib/index.js
node --check lib/client.js
node test/smoke.mjs
test/smoke.mjs covers assertions for routes, frontmatter, search scoring, path traversal protection, .trash deletion, and the two Agent tools (the README records 36 items).
Security and operational boundaries¶
- Material ids are normalized, rejecting
.., absolute paths and non-.mdextensions, and cannot escape the material root directory. - The plugin introduces no third-party dependencies (the browser side uses the host’s built-in
react); read/write is local only, and the README states the plugin does not make external network requests. - The plugin runs with the permissions of the current DSH host process and can read/write
$DSH_HOME/knowledge-base/. Before installing, you should inspect the source code and the MIT license yourself to confirm it meets your environment and compliance requirements.
The maintainer also recorded pitfalls in the README, such as incomplete cordis inject declarations leading to unregistered Host routes and 405 errors on the panel; when doing secondary development or forking, you should read the “Development and self-testing” and “Pitfall records” sections.
Who is it for¶
- Developers who need to accumulate project descriptions, interface notes, and process documentation in DSH, and want to search via tools in any session.
- Teams or individuals who want humans to view via the GUI and the Agent to view via tools, sharing the same Markdown, with fully local data.
It is not suitable for treating the plugin as cloud sync or a multi-user collaborative knowledge base: there is no built-in remote storage or permission model; collaboration requires you to manage the knowledge-base directory yourself with Git or other sync methods.
Conclusion¶
dsh-knowledge-base connects a local Markdown knowledge base into DSH’s plugin system: the GUI handles browsing and editing, while kb_search / kb_read handle on-demand retrieval on the session side. For installation commands and versions, refer to the repository README; the community entry is at SkillHub directory page, and source code and Releases are on GitHub.