Preface¶
DeepSeek Harness (DSH) emphasizes an ecosystem philosophy of “everything is a plugin.” In local development or documentation management scenarios, models often struggle to accurately retrieve unstructured text, and practical experience accumulated in long conversations can easily be lost. The dsh-knowledge plugin provides a local solution aimed at addressing the storage, retrieval, and visualization of documents, web pages, and conversational experience.
Plugin Positioning¶
This is a purely local, zero-dependency knowledge base plugin. It leverages Node 24’s built-in node:sqlite and fetch to build FTS5 full-text search indexes, stores Markdown text, code, and web page content in a single-file database, and provides source attribution, conversation experience capture, and knowledge graph visualization features.
Core Capabilities¶
Zero Dependencies and Chinese Language Support¶
The plugin does not depend on npm packages and directly uses Node 24 built-in modules. For Chinese scenarios, it adopts the FTS5 trigram tokenization algorithm, combined with a short-word LIKE fallback strategy, ensuring effective retrieval for Chinese, code, and mixed text.
Source Retrieval and Experience Capture¶
- Source Attribution: When the model retrieves content, it returns the source path, title, and line number range of the matched snippet, enforcing citation.
- Experience Database: Supports two ways of adding experiences to the database. First, the model can actively invoke
kb_rememberto record them when solving specific problems; second, usekb_ingest_sessionto read historical conversations (supporting zstd multi-frame decoding) for retroactive ingestion.
Web Clipping and Interactive Panel¶
- Web Clipping: Provides the
kb_add_urltool, which fetches web pages, automatically removes non-content elements such as navigation and footers, and converts the content to Markdown for storage (limited to 4 MiB). - Interactive Panel: When the model output includes a
kbqueryfenced block (e.g.,{"q":"search content"}), an interactive search panel is rendered, supporting real-time searching and result viewing.
Knowledge Graph¶
Provides Obsidian-style force-directed layout visualization. Data is stored in ~/.dsh/knowledge/kb.sqlite. Enter via the floating button in the bottom-right corner (by default located above the NetEase Asset Library icon):
- Node size represents content volume (documents in blue, web pages in green, experiences in orange).
- Supports node dragging, force-directed layout, click ripple effects, and detail panel viewing.
- Supports physical linkage between nodes and their associated nodes.
Installation and Activation¶
Run the following command in the terminal to install:
dsh plugin --profile web add https://github.com/dhb861832993-star/dsh-knowledge#v0.2.1
After installation, restart dsh web so new sessions can load the plugin functionality. After installation, you can ask the model “What is in the knowledge base?”, and the model will invoke kb_stats to return the current database status.
Typical Usage¶
- Import Documents: In the conversation, ask the model to import Markdown files or folders into the knowledge base. The model automatically invokes
kb_addto perform recursive import. - Retrieval with Citation: Ask a specific question (e.g., “What was the port configuration for UE4.27 MCP last time?”). The model will invoke
kb_searchand include the source path and line numbers in the answer. - Record Experience: After the conversation ends, the model can actively invoke
kb_rememberto record the title, solution, and tags of the problem solved. - Web Clipping: Use the
kb_add_urlcommand to fetch a specified web page and store it in the database. - Visual Browsing: Click the floating button in the bottom-right corner to open the knowledge graph, drag nodes to organize the layout, or view node details.
Notes¶
- Path Restriction: The resolved import path must fall within the workspace root directory to prevent out-of-bounds access.
- File Type Filtering: Binary file extensions are in the blocklist and will be automatically skipped.
- Storage Location: All data is written only to
~/.dsh/knowledge/kb.sqlite, enabling full backup. - Activation Timing: The plugin only takes effect in
dsh websessions started after a restart; a restart is required after modifying data.
Ecosystem and Links¶
This plugin is maintained by community developers and follows the MIT License. The complete source code and documentation are available in the GitHub repository.