Introduction¶
In DSH, implementing long-term memory often involves stuffing file paths into conversations or relying on external vector databases. Paths can change with project switches, and proprietary formats hinder manual verification. If you want a knowledge base residing in your chosen directory, serving Markdown as the single source of truth, and allowing unified read/write access across agent tools, CLI, and Web panels, you might want to check out the community plugin dsh-knowledge-base-local (Maintainer: CodfishYao, categorized as “Memory” in the community directory).
What is this¶
dsh-knowledge-base-local is a local knowledge base plugin for DeepSeek Harness (DSH): Data is stored as plain Markdown, supporting hybrid retrieval (BM25 + Vector), PDF/Office text extraction, optional static encryption, and multi-user permissions. It can also be accessed by external clients via MCP. The design emphasizes three points: storage paths are user-specified, any model can read Markdown directly, and both text and attachments can be indexed with automatic chunking and vectorization. It relies solely on Node’s built-in modules at runtime and requires no compilation during installation.
Core Features¶
The following summarizes capabilities listed in the README without expanding on details not present in the provided materials.
Storage & Directory
- Each document is
docs/<id>.md(with frontmatter), and aCATALOG.mdis generated for model and human browsing. - The root directory and preferences are written to
knowledge-base/settings.jsonunder the DSH user data directory (default~/.dsh), decoupled from the workspace and profile so configuration persists across project switches.
Retrieval & Vector Modes
- Hybrid retrieval: BM25, vector cosine similarity, plus title/substring boosting; results include document ID, line numbers, and snippets.
- Three vector modes:
local(offline TF-IDF feature hashing),llm(model enhancement + local vectors),api(OpenAI-compatible embeddings, falling back to local on failure).
Agents & Entry Points
- Six tools:
kb_search,kb_read,kb_list,kb_add,kb_import,kb_manage(including sub-operations for collections, trash, re-indexing, encryption & RBAC, MCP info, etc.). - After knowledge base changes, a summary including the root path, scale, and collections is appended to the system prompt, eliminating the need to manually paste paths every time.
Import & Monitoring
- Supports text, Markdown, code, web URLs, and binary attachments; the
inbox/directory supports automatic import and change monitoring (including PDF/Office). - PDF:
.pdf; Office:.docx,.xlsx,.pptx(legacy.doc/.xls/.pptare not parsed and must be saved as new formats). The default single file size limit isimport.maxFileBytes(8 MiB).
Security & Collaboration
- Static encryption: AES-256-GCM; passphrases derive a KEK via scrypt to wrap data keys.
- Multi-user RBAC is disabled by default:
owner > admin > editor > reader, with permissions narrowable by collection; API tokens are stored as SHA-256 hashes. - Passing passphrases via agent parameters will enter the session log; a more secure method is via the Web panel under Settings → Knowledge base → Security.
Others
- Soft delete and versions (default 20 versions retained), collections and tags, MCP (stdio / Streamable HTTP / Harness internal
POST …/kb-mcp). - Known limitations are subject to the “Known limitations” section in the repository README; the current package version is 1.2.5, License MIT.
Installation & Activation¶
Environment requirements: Node.js ≥ 22, and DeepSeek Harness must be running locally.
Official installation command (from source material):
dsh plugin --profile web add dsh-knowledge-base-local
After installation, configure via Settings → Knowledge base in the Web interface; CLI access is available via the packaged kb.mjs or the global dsh-kb command (sharing src/ with the plugin, not forcing the Harness process to remain resident).
Typical Usage¶
1. Specify Knowledge Base Root Directory
Select a folder in the Web interface, or instruct the agent to set the knowledge base to a specific path; alternatively, use CLI:
node kb.mjs config --root /path/to/knowledge
2. Daily Retrieval and Writing
node kb.mjs status
node kb.mjs search "hybrid retrieval" --limit 5
node kb.mjs add --title "Title" --text "Body" --collection notes --tags a,b
node kb.mjs import /path/Notes --collection notes
node kb.mjs import /path/Papers/report.pdf --collection papers
When importing PDFs, the body text will include a source note such as extracted from …; if parsing fails, the attachment is retained and the reason is logged—no silent discarding occurs.
3. Unlock Encrypted Knowledge Base
The CLI will explicitly report an error when the knowledge base is locked; unlock it first:
node kb.mjs unlock
You can also use the environment variable DSH_KB_PASSPHRASE or --passphrase (note that for security scenarios, the Web panel is preferred).
4. External MCP Clients (Examples)
stdio method (from source materials, no Harness runtime required):
node mcp-stdio.mjs
node mcp-stdio.mjs --root /path/to/knowledge --readonly
Use Cases & Notes¶
Who is it for
- Users who need stable retrieval of personal/team notes, documents, and imported materials during DSH agent conversations.
- Scenarios requiring data to reside as Markdown, utilize offline
localvectors, or connect tollm/apiembeddings on demand. - Developers wanting to connect the same knowledge base to MCP clients like Cursor or Claude Desktop.
Important Notes
- The plugin runs under the permissions of the current DSH process and can read/write to the knowledge base paths and imported files you configured. Before installation, you should review the source code and MIT License on the GitHub repository to ensure the paths and encryption strategies meet your security requirements.
- The community directory skillhub.cn plugin page and GitHub are maintained by the community and are not the official DeepSeek / High-Flyer app store; the DSH ecosystem adheres to “Everything is a plugin,” with the repository README serving as the authoritative usage guide.
Conclusion¶
dsh-knowledge-base-local consolidates an “editable Markdown directory + hybrid retrieval + multiple entry points (Agent / CLI / Web / MCP)” into a single plugin, serving as an ideal local long-term memory layer for DSH. For further details on features and configuration fields, please refer to the repository README (including the Chinese version README.zh.md).