htcqp802/dsh-knowledge-base
DeepSeek Harness (DSH) knowledge base plugin: import PDF/DOCX/Markdown documents, organize them in folders, full-text search with FTS5 (BM25), and manage everything in a Web UI
Listed
5
Memory
Bundle verified
What it does
General-purpose knowledge base for DSH: import md/txt/json/yml/docx/pdf, folder management, FTS5 full-text search (BM25), and a Web management UI.
Best for
- Teams that need a persistent, searchable corpus of Markdown, text, JSON, YAML, DOCX, and text-based PDF documents.
- Agents that benefit from BM25-ranked full-text retrieval through native import, query, list, update, and delete tools.
- DSH Web users who want file-manager-style folders, drag-and-drop imports, and document browsing.
Not ideal for
- Scanned PDFs that require OCR are not supported by the documented roadmap state.
- Users who need to edit entry contents in a detail view must use another workflow; that UI is not implemented.
- Environments below Node 22.5 are unsuitable because the plugin depends on built-in node:sqlite.
- One-off reading of a single document may not justify importing, chunking, and maintaining a knowledge base.
README
๐ณ dsh-knowledge-base
A general-purpose knowledge base plugin for DeepSeek Harness (DSH)
Import documents ยท organize in folders ยท full-text search ยท manage in the Web UI
English ยท ็ฎไฝไธญๆ ยท Espaรฑol ยท ๆฅๆฌ่ช
dsh-knowledge-base turns documents into a searchable knowledge base for DeepSeek Harness agents. Drop in a PDF, Word, or Markdown file โ it is parsed, chunked by section, and instantly searchable by your agent with FTS5 (BM25) ranked retrieval. A built-in Web UI lets you manage the knowledge base like a file manager: create/rename/delete folders, move files, and browse content.
โจ Features
- ๐ฅ Import anything โ
md / txt / json / yml / docx / pdf, no size limit; PDF is parsed in-process with pdfjs-dist (cross-platform, zero system dependencies) - ๐ช Auto-chunking โ documents are split by headings/paragraphs; adjacent small chunks are merged to reduce fragmentation
- ๐ Upsert โ re-importing the same file overwrites it; no duplicate accumulation
- ๐ Folder management โ categories are folders: create / rename / delete (empty) / move files, like an OS file manager
- ๐ FTS5 full-text search โ SQLite FTS5 (trigram tokenizer, no Chinese segmentation needed) + BM25 relevance ranking; falls back to LIKE for short queries or anomalies
- ๐ค Agent-native tools โ
kb_query/kb_import/kb_list/kb_update/kb_delete, usable directly by the model in conversation - ๐ฅ Web management UI โ a โKnowledge Baseโ tab in the conversation view: drag-and-drop import, directory browsing, category management, search
- โ๏ธ Configurable categories โ no preset categories by default (fits any domain); create folders at runtime from the UI
๐ Install
dsh plugin --profile web add dsh-knowledge-base
Dependencies: DeepSeek Harness (
dsh) provides the@deepseek-ai/*runtime; Node โฅ 22.5 (built-innode:sqlite).
๐ Quick Start
Via the Web UI (recommended)
- Start dsh Web:
dsh web(ordsh --profile web) - Open your browser, create a session, and switch to the Knowledge Base tab at the top of the session view
- Drag and drop files to import โ auto-chunked โ browse / rename / move in the directory view
- Ask your agent in chat: โUse kb_query to search for ISO9001โ
Via agent tools (headless / any profile)
import: Use kb_import to import /path/to/manual.pdf, category "Documents", tags ["manual"]
search: Use kb_query to search for "transformer"
list: Use kb_list / kb_list category=Documents
update: Use kb_update to change id=3's category to "Documents"
delete: Use kb_delete to delete id=3
โ๏ธ Configuration
# In the profile's cordis.patch.yml or when installing the bundle
# No categories are preset (fits any domain); entries without a category go to "Uncategorized".
# You can also create folders directly in the UI (persisted, no config edit needed).
- id: knowledge-base
name: 'dsh-knowledge-base'
config:
categories: # configure as needed, e.g.:
- Documents
- Manuals
๐ Web API (for the UI and third-party integrations)
| Method | Path | Purpose |
|---|---|---|
| POST | /api/kb/import |
Upload a file (base64 JSON) โ parse, chunk, store |
| GET | /api/kb/list |
List entries and categories |
| GET | /api/kb/search?q= |
Full-text search (FTS5 + BM25) |
| POST | /api/kb/update |
Update an entryโs category/tags |
| POST | /api/kb/rename-category |
Rename a category |
| POST | /api/kb/create-category |
Create a folder (persisted) |
| POST | /api/kb/delete-category |
Delete an empty folder |
| POST | /api/kb/move-file |
Move a file (change category) |
| POST | /api/kb/rename-file |
Rename a file |
| POST | /api/kb/delete-file |
Delete an entire file |
| POST | /api/kb/delete-entry |
Delete a single entry |
๐ Architecture
dsh-knowledge-base (one npm package, three plugin rows)
โโโ dsh-knowledge-base host tools: kb_query / kb_import / kb_list / kb_update / kb_delete
โโโ dsh-knowledge-base/web Web endpoints: /api/kb/* (web composition only)
โโโ (client half) "Knowledge Base" conversation view tab + directory browser UI
Data storage (default):
$DSH_HOME/knowledge-base/kb.sqlite # entries + FTS5 index + meta (dynamic categories)
$DSH_HOME/knowledge-base/inbox/ # upload temp dir (cleaned up after import)
Tables: kb(id, category, name, summary, payload, tags, source, updated_at) + kb_fts (FTS5 external-content table) + meta (dynamic categories).
๐ง Development
npm run build # tsc type-check + tsdown bundle (host half + client bundle)
# Local verification (use a workspace-local test home, never touch ~/.dsh)
DSH_HOME=$PWD/.dsh-home DSH_TELEMETRY_DISABLED=1 \
dsh --profile headless --patch dev-headless.cordis.yml \
"Use kb_import to import /tmp/test.md, then kb_query to search for 'keyword'"
The standalone repo ships
dev.cordis.yml/dev-headless.cordis.ymlfor local verification. During development the@deepseek-ai/*dependencies are symlinked from an official checkout viascripts/link-official-deps.mjsโ see AGENTS.md โ โDependenciesโ.
๐บ Roadmap
- File import (md/txt/json/yml/docx/pdf)
- Folder management (create/rename/delete/move)
- FTS5 full-text search (BM25 + Chinese trigram)
- Knowledge base management Web UI
-
AI auto-classification (direct
ctx.llmstructured calls on import) - Entry detail view/edit
- OCR (scanned PDFs)
- Better Chinese tokenization (custom tokenizer instead of trigram)
๐ค Contributing
PRs welcome! Please read AGENTS.md (agent development guide) first. Before submitting:
-
npm run buildpasses - The headless tool chain is self-tested
- No local data is committed (
.dsh-home/,.test-workspace/, etc. โ see .gitignore)
๐ License
MIT ยฉ dsh-knowledge-base contributors
๐ Related
- DeepSeek Harness โ Everything is a Plugin
- awesome-dsh-plugin โ curated community plugin list
- pdfjs-dist โ PDF parsing engine
Frequently Asked QuestionsFAQ
Use the verified command dsh plugin --profile default add github:htcqp802/dsh-knowledge-base in a DSH-enabled shell. The command resolves the public package metadata and keeps the plugin attached to the catalog identity shown on this page.
Compatibility follows the bundle and profile status shown above. If a profile is not detected, keep the plugin disabled there and check the repository documentation before enabling it in production.
The GitHub link and activity metadata are the source of truth for releases and maintenance. Revisit this page after a new release to confirm the catalog has observed the latest version.