返回顶部
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
安全检测
已通过
124
下载量
0
收藏
概述
安装方式
版本历史

doc-search

# Doc Search BM25 inverted index + LLM query expansion + grep. Zero external dependencies. ## Workflow Follow these steps in order every time: ### Step 1 — Resolve docs_dir Check if the user mentioned a docs directory. If not, ask: > "Which directory should I search? (e.g. ~/obsidian, ~/notes)" ### Step 2 — Check index exists ```bash ls <docs_dir>/.cache/index.json ``` - If missing → go to Step 3 (build index first) - If exists → skip to Step 4 ### Step 3 — Build index ```bash python3 ~/.claude/skills/doc-search/scripts/build_index.py <docs_dir> ``` Index saved to `<docs_dir>/.doc-search/index.json`. Incremental on subsequent runs. ### Step 4 — Expand query terms Before searching, expand the user's query to cover synonyms, Chinese/English variants, and likely headings. Combine into one string: ``` "获取音色列表" → "获取 查询 list voice 音色 tts ListVoice 音色列表" ``` ### Step 5 — BM25 search ```bash python3 ~/.claude/skills/doc-search/scripts/search.py "<expanded query>" \ --docs-dir <docs_dir> --topk 5 ``` Output: JSON array `[{path, rel, score, title, summary}, ...]` ### Step 6 — Grep top-K for precise location For each result file, grep with the original keywords: ```bash grep -ni -e "keyword1" -e "keyword2" /path/to/doc.md ``` Report file path + matching line numbers to the user. ## Options | Flag | Default | Description | |------|---------|-------------| | `--topk` | `5` | Number of BM25 results | | `--ext` | `md,txt,rst,org` | File extensions to index | | `--index` | `<docs_dir>/.doc-search/index.json` | Override index path |

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

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

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

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

通过命令行安装

skillhub install doc-search-1775886731

下载 Zip 包

⬇ 下载 doc-search v1.0.0

文件大小: 7.5 KB | 发布时间: 2026-4-12 09:45

v1.0.0 最新 2026-4-12 09:45
- 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-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部