@dsh-external/dsh-kb-rag
Local-first RAG knowledge tools for DSH: kb_query / kb_ingest / kb_crawl / kb_related, backed by the kb-rag Python pipeline (Ollama bge-m3 + ChromaDB + SiYuan). Zero API cost, data never leaves your machine.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:YuMu247/dsh-kb-rag说明文档
阅读完整 README ↗@dsh-external/dsh-kb-rag
Local-first RAG knowledge tools for DSH — thin tool wrapper around the kb-rag Python pipeline (Ollama bge-m3 + ChromaDB + SiYuan). Four tools, all on-premises, zero API cost, your documents never leave the machine.
| Tool | What it does | Backing script |
|---|---|---|
kb_query | Semantic search over your local vector DB (top-k chunks with source + similarity) | query.py --json |
kb_ingest | Ingest a docs directory into ChromaDB (incremental, manifest hash-idempotent; Shiyu notes auto-stripped of front-matter + machine layer) | ingest.py |
kb_crawl | Batch-crawl URLs to clean Markdown (Scrapling + markdownify) | crawl.py |
kb_related | Related-document recommendations: retrieval-style, graph-style knowledge walk, or from a known doc | related.py |
The plugin is a pure forwarder: it locates Python, spawns the kb-rag scripts and parses their output. All knowledge-base logic lives in the Python project, which you can also use standalone.
Install
# requires a dsh build with the `dsh plugin` subcommand;
= tui/headless/web/...
dsh plugin --profile
add github:YuMu247/dsh-kb-rag
dsh --profile
# restart: kb_query / kb_ingest / kb_crawl / kb_related injected
Peer dependencies (@deepseek-ai/dsh-tools, @deepseek-ai/cordis) are provided
by the dsh profile.
Prerequisites (one-time, on the host)
# 1. the Python pipeline
git clone https://github.com/YuMu247/kb-rag
pip install -r kb-rag/requirements.txt
# 2. Ollama + embedding model
ollama pull bge-m3 # ~1.2GB
# 3. tell the plugin where kb-rag lives (either one)
# a) plugin config: kbRagDir: "/path/to/kb-rag"
# b) env var: KB_RAG_DIR=/path/to/kb-rag
# c) default: ./kb-rag under the session working directory
# 4. ingest something, then ask
python kb-rag/ingest.py --docs /path/to/docs
Optional (Windows daily sync): examples/sync_daily.cmd in the kb-rag repo
starts Ollama, syncs Shiyu video notes, ingests and imports into SiYuan.
Tool arguments
- kb_query —
query(required),k(default 5, max 20). Returns .