返回顶部
d

doc-search文档搜索

Search a local document library (Obsidian vault, wiki, notes, etc.) using BM25 inverted index + LLM query expansion + grep for precise location. Use when the user asks to find, look up, or search for information in their local docs/notes/vault.Triggers on "find in docs", "look up X in vault", "搜索文档", "查找笔记", "文档里有没有

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
150
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

doc-search

文档搜索

BM25倒排索引 + LLM查询扩展 + grep。零外部依赖。

工作流程

每次按以下顺序执行步骤:

第1步 — 确定文档目录

检查用户是否提及了文档目录。如果没有,询问:

我应该搜索哪个目录?(例如 ~/obsidian, ~/notes)

第2步 — 检查索引是否存在

bash
ls /.cache/index.json

  • - 如果缺失 → 跳转到第3步(先构建索引)
  • 如果存在 → 跳转到第4步

第3步 — 构建索引

bash
python3 ~/.claude/skills/doc-search/scripts/buildindex.py dir>

索引保存至 /.doc-search/index.json。后续运行时会增量更新。

第4步 — 扩展查询词

在搜索前,将用户的查询扩展为包含同义词、中英文变体和可能的标题。合并为一个字符串:

获取音色列表 → 获取 查询 list voice 音色 tts ListVoice 音色列表

第5步 — BM25搜索

bash
python3 ~/.claude/skills/doc-search/scripts/search.py <扩展后的查询> \
--docs-dir --topk 5

输出:JSON数组 [{path, rel, score, title, summary}, ...]

第6步 — 对Top-K结果进行grep精确定位

对每个结果文件,使用原始关键词进行grep:

bash
grep -ni -e 关键词1 -e 关键词2 /path/to/doc.md

向用户报告文件路径及匹配行号。

选项

标志默认值描述
--topk5BM25结果数量
--ext
md,txt,rst,org | 要索引的文件扩展名 | | --index | /.doc-search/index.json | 覆盖索引路径 |

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 doc-search-1776127033 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 doc-search-1776127033 技能

通过命令行安装

skillhub install doc-search-1776127033

下载

⬇ 下载 doc-search v1.0.0(免费)

文件大小: 7.5 KB | 发布时间: 2026-4-14 10:34

v1.0.0 最新 2026-4-14 10:34
- Initial release of doc-search: search local document libraries using BM25, LLM query expansion, and grep.
- Supports Chinese and English queries, synonyms, and custom query expansions.
- Zero external dependencies; uses simple bash and Python scripts.
- Step-by-step workflow includes index building, query expansion, and line-precise grep results.
- Flexible options for file extensions, result count, and index location.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部