wiki-retrieve
Agent skill fromAgriciDaniel/claude-obsidian
Build and query a vault-local contextual BM25 retrieval index with optional multilingual Nomic cosine reranking; use for retrieve, hybrid retrieval, BM25, rerank, contextual retrieval, chunk search, vault search, semantic search, find relevant passages, or retrieval diagnostics. Derived caches stay under .vault-meta, remote egress requires explicit consent, and unavailable reranking falls back deterministically.
How to install wiki-retrieve
install wiki-retrieve
# install the claude-obsidian pack with the skills CLI
npx skills add AgriciDaniel/claude-obsidian# or add only this skill to Claude Code: copy the folder
skills/wiki-retrieve/
# into
~/.claude/skills/wiki-retrieve/ (all projects)
.claude/skills/wiki-retrieve/ (one project)
1# Retrieve relevant passages23This extension derives search data from `wiki/` into `.vault-meta/`. It never4changes canonical notes. Always pass the selected vault explicitly.56Resolve the installed product root from this skill's own location, not from the7vault or current working directory:89```bash10PRODUCT_ROOT=/absolute/path/to/installed/claude-obsidian11PREFIX="$PRODUCT_ROOT/scripts/contextual-prefix.py"12BM25="$PRODUCT_ROOT/scripts/bm25-index.py"13RETRIEVE="$PRODUCT_ROOT/scripts/retrieve.py"14RERANK="$PRODUCT_ROOT/scripts/rerank.py"15test -f "$PREFIX" && test -f "$BM25" && test -f "$RETRIEVE" && test -f "$RERANK"16```1718## Pipeline19201. `contextual-prefix.py` splits pages on paragraph boundaries and stores the21 raw chunk plus a short page-level prefix.222. `bm25-index.py` builds a local, standard-library BM25 index over the23 contextualized text.243. `retrieve.py` selects BM25 candidates, optionally reranks them, rejects25 invalid records, deduplicates by page, and returns paths and snippets.264. The caller reads the returned pages and performs synthesis; retrieval output27 is not itself evidence.2829## Provision locally3031Preview first, then build synthetic prefixes without network egress:3233```bash34python3 "$PREFIX" --vault "$VAULT" --all --no-llm --peek35python3 "$PREFIX" --vault "$VAULT" --all --no-llm36python3 "$BM25" --vault "$VAULT" build37python3 "$RETRIEVE" --vault "$VAULT" "wiki" --top 1 --no-rerank --explain38```39…
Excerpt shown under the repository's MIT license.
