DeepSHPlugins
dsh-knowledge-base 專案預覽
GITHUB / COMMUNITY PROJECT

dsh-knowledge-base

記憶與知識JavaScriptMIT

DSH 通用知識庫外掛:匯入 md/txt/json/yml/docx/pdf、目錄化管理、FTS5 全文檢索(BM25)、Web 管理介面。

6 Starshtcqp802 更新時間 2026-08-16
訪問 GitHub 倉庫
dsh-knowledge-base 專案預覽

專案介紹

中文

DSH 通用知識庫外掛:匯入 md/txt/json/yml/docx/pdf、目錄化管理、FTS5 全文檢索(BM25)、Web 管理介面。

English

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.

專案資訊與收錄訊號

快照 2026-09-11
作者 / 組織
htcqp802
倉庫
htcqp802/dsh-knowledge-base
GitHub Stars
6
Forks
1
開發語言
JavaScript
許可證
MIT
最近推送
2026-08-16
Manifest
資料中檢測到宣告

公開倉庫不自動等於可商用;許可證與當前相容性以原專案文件為準。Manifest 和資料評分不構成安裝安全認證。

資料評分

58/ 100
維護活躍
82
文件與實用資訊
50
生態關注度
28
安裝便捷訊號
75
專案宣告訊號
85

關注度尚低(6)。

評分來自已有資料快照的五維模型,僅作瀏覽參考,不是實際使用評測或安全檢測結論。

安裝與使用

所有專案資料與許可均以對應 GitHub 倉庫為準。

dsh plugin --profile web add dsh-knowledge-base

複製命令不會自動執行。請先閱讀倉庫文件,確認環境要求與許可證。

專案截圖

倉庫 README

GitHub 原文

已儲存的倉庫文件快照;文件抓取時間未記錄,可能與上方目錄介紹處於不同版本。安裝前請核對當前倉庫說明。

儲存庫檔案保留原文,指令與授權文字不作自動改寫。

🐳 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

MIT License Node Awesome DSH Plugin Topic: dsh-plugin

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-in node:sqlite).

🏃 Quick Start

Via the Web UI (recommended)

  1. Start dsh Web: dsh web (or dsh --profile web)
  2. Open your browser, create a session, and switch to the Knowledge Base tab at the top of the session view
  3. Drag and drop files to import → auto-chunked → browse / rename / move in the directory view
  4. 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)

MethodPathPurpose
POST/api/kb/importUpload a file (base64 JSON) → parse, chunk, store
GET/api/kb/listList entries and categories
GET/api/kb/search?q=Full-text search (FTS5 + BM25)
POST/api/kb/updateUpdate an entry's category/tags
POST/api/kb/rename-categoryRename a category
POST/api/kb/create-categoryCreate a folder (persisted)
POST/api/kb/delete-categoryDelete an empty folder
POST/api/kb/move-fileMove a file (change category)
POST/api/kb/rename-fileRename a file
POST/api/kb/delete-fileDelete an entire file
POST/api/kb/delete-entryDelete 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.yml for local verification.
During development the @deepseek-ai/* dependencies are symlinked from an official checkout via
scripts/link-official-deps.mjs — see AGENTS.md → "Dependencies".

🗺 Roadmap

  • [x] File import (md/txt/json/yml/docx/pdf)
  • [x] Folder management (create/rename/delete/move)
  • [x] FTS5 full-text search (BM25 + Chinese trigram)
  • [x] Knowledge base management Web UI
  • [ ] AI auto-classification (direct ctx.llm structured 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:

  1. npm run build passes
  2. The headless tool chain is self-tested
  3. No local data is committed (.dsh-home/, .test-workspace/, etc. — see .gitignore)

📄 License

MIT © dsh-knowledge-base contributors

🔗 Related

使用前核對

安裝步驟、相容版本與授權範圍以原專案當前文件為準。Stars 和評分是快照中的導航訊號。

安裝與排錯 · 專案問題反饋

同類專案