omdsh-dev/dsh-kb-sieve

DSH知识库插件:从md/txt/docx/pdf构建可审计的知识库包(引用+SQLite FTS5),确定性检索(kb_query)与原文阅读(kb_read),零脚本生成技能。Apache-2.0。

Project Overview项目介绍

This is a native knowledge base plugin built exclusively for DeepSeek Harness (DSH), that provides three pure computation tools to turn plain documents into an auditable, deterministically searchable knowledge base. It supports incremental document builds, BM25 weighted full-text search, and precise line-level document reading, and only registers tools without modifying agent-loop, TUI, or system-prompt behavior for non-intrusive integration. To install it, you run the command dsh plugin --profile <profile> add git+https://github.com/dsh-external/dsh-kb-sieve.git, replacing <profile> with your target profile such as tui, headless, web, or a custom profile. After restarting DSH, the three tools kb_build, kb_query, and kb_read are automatically injected into your profile ready for use.

The standard workflow starts when you tell the DSH model to turn your documents into a knowledge base and provide the document path. The kb_build tool will generate a pure-data knowledge package, which by default outputs to the DSH skill system's watched directory, so DSH can automatically discover and load the new skill dynamically without a full restart. After the skill is loaded, the model follows the instructions in the auto-generated SKILL.md to call kb_query for search and kb_read for reading full document content. This plugin is ideal for developers and technical writers who manage local technical documents, standards, or specifications that require precise retrieval.

This plugin relies on @deepseek-ai/dsh-tools and cordis, which are provided by DSH core, and the fflate dependency for docx extraction is automatically handled during installation. The generated knowledge packages contain no scripts or extra runtime dependencies, only data files, and this plugin is licensed under the open-source Apache 2.0 license. It is backward compatible with existing knowledge packages built by the original Python kb-sieve, and the v1 release intentionally omits some advanced original kb-sieve features to keep the plugin lightweight. It also implements incremental building that only reprocesses changed documents to speed up rebuilds for large document sets.

这是一款专为DeepSeek Harness开发的原生知识库插件,提供三个纯计算工具,用于将普通文档转换为可审计、支持确定性检索的知识库。它支持增量构建、BM25加权全文检索和精准文档精读,可通过dsh plugin官方命令安装到任意DSH配置文件,包括tui、headless、web或自定义配置。

用户只需对模型说“把这些文档做成知识库”并给出文档路径,即可调用kb_build生成知识包,默认输出到DSH技能系统的监听目录,DSH会自动动态发现并加载新技能,随后模型就能按照生成的SKILL.md指引调用检索和精读工具。它适合需要管理本地技术文档、标准规范等对检索精度有要求的开发人员和技术创作者使用。

本插件依赖由DSH提供的@deepseek-ai/dsh-tools和cordis,安装流程会自动处理fflate依赖,生成的知识包是纯数据,无脚本、无额外依赖。遵循Apache 2.0开源协议,v1版本暂不支持部分原版kb-sieve的高级功能,兼容原版kb-sieve生成的知识包可直接查询。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add git+https://github.com/dsh-external/dsh-kb-sieve.git

把 omdsh-dev/dsh-kb-sieve 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

@dsh-external/dsh-kb-sieve

知识库筛子——把文档做成可审计、确定性检索的知识库插件(DSH 版 kb-sieve)。

三个工具,纯计算(零子代理、零 workflow、零外部服务):

工具 干什么 核心机制
kb_build 文档 → 知识包(支持增量) 抽取(md/txt/docx/pdf,并发 4 可调)→ 分词 → references/ 原文 + kb.sqlite(FTS5,BM25 title=10/body=1)→ manifest + SKILL.md + build_state.json
kb_query 确定性检索 FTS5 BM25 → 精确标识符匹配(标准号/章节号/型号)→ 文档类型加权 → 窗口密度重排 → 行级定位(doc_id+行号+匹配行)→ OOV 越界门 → 置信度
kb_read 原文精读 around(自动章节边界)/ sections(文档地图)/ find / jump / 命中标记

为什么是"干净的方式"

原版 kb-sieve 生成的 skill 自带 Python kbtool 脚本 + 包装器 + 可选 PyInstaller 二进制。 本插件把运行时(检索/精读)搬进插件工具(TS),生成的 skill 是纯数据: SKILL.md 指令 + references/ + kb.sqlite——零脚本、零 Python、零依赖。

安装与使用方式

装进任意 profile(把 <profile> 换成 tui / headless / web 或自建 profile; 需要支持 dsh plugin 子命令的 dsh 版本):

# 安装
dsh plugin --profile <profile> add git+https://github.com/dsh-external/dsh-kb-sieve.git
dsh --profile <profile>        # 重启生效:kb_build / kb_query / kb_read 随 profile 注入

# 更新 / 卸载
dsh plugin --profile <profile> update
dsh plugin --profile <profile> remove @dsh-external/dsh-kb-sieve
# 或:从 profile 的 package.json 移除依赖后 dsh plugin --profile <profile> update

peer 依赖(@deepseek-ai/dsh-tools、cordis)由 dsh 组合提供;运行时仅需 fflate (docx 抽取),由插件安装流程一并安装。

用法一:构建 + 动态加载(推荐)

对模型说人话:「把这些文档做成知识库」并给出文档路径。kb_build 默认输出到 当前项目根目录的 .dsh/skills/<name>/(最近的 .git 目录,或当前工作目录 之下)——这正是 DSH skill 系统的监听根目录:

  • DSH 动态发现新 skill(目录热更新,下一轮对话模型目录里即出现该知识库)
  • 模型加载 skill 后按 SKILL.md 指引调用 kb_query / kb_read(pack 路径)
  • skill 内容按需加载(每次调用重读文件,无缓存失效问题)

用法二:构建到任意目录 + 工具直查

kb_build 传 out 指定输出父目录;之后随时用 kb_query/kb_read 指定 pack 路径查询。

用法三:查询旧知识包

kb_query/kb_read 读的是 kb.sqlite + references/ —— schema 与原版 Python kb-sieve 产物一致,原版构建的知识包可直接查询。

开发与检查

pnpm install        # typescript/@types/node + fflate(docx 抽取)
pnpm run typecheck  # tsc -b,类型从 sibling deepseek-harness checkout 解析

回归测试(test/)与开发脚本(scripts/)不随本仓库发布(见 .gitignore)。

源码即运行时:包入口直接指向 src/index.ts,无构建步骤。profile 安装的副本位于 node_modules 下,由 dsh 源码启动器的 tsx hook 加载(Node 原生类型剥离拒绝 node_modules 内的文件);源码 checkout 在 node_modules 外直跑时也可用原生类型剥离 (Node ≥22.19,与 harness engines 一致;原生剥离默认开启自 22.18)。要求 erasable-only TS 语法。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-progressive-tools 下一个 Next mindspace-dsh-session-memory →