DeepSeek Harness 插件

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(英文原文)

跳到安装方式

来源信息

GitHub 仓库
YuMu247/dsh-kb-rag
最近更新
2026年8月15日
分类
文档与渲染
GitHub stars
1
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/YuMu247/dsh-kb-rag
插件名:dsh-kb-rag
作者:YuMu247

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

@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.

ToolWhat it doesBacking script
kb_querySemantic search over your local vector DB (top-k chunks with source + similarity)query.py --json
kb_ingestIngest a docs directory into ChromaDB (incremental, manifest hash-idempotent; Shiyu notes auto-stripped of front-matter + machine layer)ingest.py
kb_crawlBatch-crawl URLs to clean Markdown (Scrapling + markdownify)crawl.py
kb_relatedRelated-document recommendations: retrieval-style, graph-style knowledge walk, or from a known docrelated.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; <profile> = tui/headless/web/...
dsh plugin --profile <profile> add github:YuMu247/dsh-kb-rag
dsh --profile <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_queryquery (required), k (default 5, max 20). Returns {ok, count, chunks:[{source, chunk, similarity, text}]}.
  • kb_ingestdocs (default <kb-rag>/docs), force, reset, heading, chunkSize (default 512), overlap (default 64). Returns {ok, summary}.
  • kb_crawlurls (array) or urlsFile (path), out (default <kb-rag>/out), delay (default 1.5s, min 0.2). Returns {ok, summary, outDir}.
  • kb_relatedseed or fromDoc (exactly one), k (default 5), graph (>0 enables graph-style walk). Returns {ok, text}.

Plugin config

All keys optional, set in the profile plugin config:

KeyDefaultMeaning
pythonCmdpython (win) / python3 (other)Python executable
kbRagDirKB_RAG_DIR env, then <cwd>/kb-ragkb-rag checkout directory

Development

npm install                 # typescript + @types/node + dsh-tools/cordis types (compile only)
npm run typecheck           # tsc -b

Runtime has zero npm dependencies; src/ is the source of truth and lib/ the compiled copy (both shipped).

中文说明

DSH 的本地优先知识库插件:kb_query(语义检索)/ kb_ingest(增量入库)/ kb_crawl(网页批量抓取)/ kb_related(关联推荐),底层调用 kb-rag Python 管线(Ollama bge-m3 + ChromaDB),全程本地、零 API 成本。安装:dsh plugin --profile <profile> add github:YuMu247/dsh-kb-rag。前置:克隆 kb-rag、pip install -r requirements.txtollama pull bge-m3,并用配置 kbRagDir 或环境变量 KB_RAG_DIR 指明 kb-rag 路径。

License

[MIT](LICENSE)