wiki-retrieve
Skill này làm gì
Skill này tạo một chỉ mục tìm kiếm của wiki và trả về các đoạn liên quan nhất với một câu hỏi. Skill dành cho người có nhiều ghi chú và muốn tra cứu nhanh, chính xác.
Khi nào nên dùng
- ✓Khi wiki của bạn lớn và bạn muốn tìm các đoạn liên quan đến một câu hỏi.
- ✓Khi bạn muốn xây dựng hoặc làm mới chỉ mục tìm kiếm cục bộ cho kho.
- ✓Khi bạn cần chẩn đoán vì sao một tìm kiếm trả về kết quả như vậy.
Liên kết skill
https://github.com/AgriciDaniel/claude-obsidian/blob/main/skills/wiki-retrieve/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy xây dựng chỉ mục tìm kiếm cho wiki của tôi và tìm các đoạn về quy trình tuyển dụng của chúng tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent chia các trang thành các đoạn nhỏ, xây dựng chỉ mục từ khóa trên máy tính này và trả về các đoạn khớp nhất cùng trang của chúng. Mọi xử lý từ xa cần sự đồng ý rõ ràng của bạn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Retrieve relevant passages
This extension derives search data from wiki/ into .vault-meta/. It never
changes canonical notes. Always pass the selected vault explicitly.
Resolve the installed product root from this skill's own location, not from the vault or current working directory:
PRODUCT_ROOT=/absolute/path/to/installed/claude-obsidian
PREFIX="$PRODUCT_ROOT/scripts/contextual-prefix.py"
BM25="$PRODUCT_ROOT/scripts/bm25-index.py"
RETRIEVE="$PRODUCT_ROOT/scripts/retrieve.py"
RERANK="$PRODUCT_ROOT/scripts/rerank.py"
test -f "$PREFIX" && test -f "$BM25" && test -f "$RETRIEVE" && test -f "$RERANK"
Pipeline
contextual-prefix.pysplits pages on paragraph boundaries and stores the raw chunk plus a short page-level prefix.bm25-index.pybuilds a local, standard-library BM25 index over the contextualized text.retrieve.pyselects BM25 candidates, optionally reranks them, rejects invalid records, deduplicates by page, and returns paths and snippets.- The caller reads the returned pages and performs synthesis; retrieval output is not itself evidence.
Provision locally
Preview first, then build synthetic prefixes without network egress:
python3 "$PREFIX" --vault "$VAULT" --all --no-llm --peek
python3 "$PREFIX" --vault "$VAULT" --all --no-llm
python3 "$BM25" --vault "$VAULT" build
python3 "$RETRIEVE" --vault "$VAULT" "wiki" --top 1 --no-rerank --explain
Chunk and index files are disposable runtime state. Incremental prefixing skips records whose chunk hashes, page hashes and provider/model profile still match. Legacy records without that profile regenerate on an explicit build. A complete scan removes surplus records for deleted pages, and the prefixer invalidates the BM25 index before changing its chunk set so a mixed stale index is not served. Prefix and BM25 build operations share the vault-wide mutation lock with every other writer; a busy vault fails closed instead of publishing a partial index.
Contextual-prefix privacy
Synthetic prefixes use only local frontmatter and page text. The explicit
Anthropic API profile can send page bodies off-machine and requires the user's
consent plus --allow-egress and a configured API key. There is no Claude CLI
generation tier or ambient subprocess fallback. Never infer consent from an
API key or installed binary. Preview the scope first and state which provider
will receive what data.
Remote Ollama endpoints also require explicit approval and
--allow-remote-ollama; the default reranker accepts localhost only.
Local model prefixes are a separate explicit option. Use an already installed
exact name:tag; no server is started and no model is installed or pulled:
python3 "$PREFIX" --vault "$VAULT" --all --local-ollama --ollama-model installed:tag --peek
python3 "$PREFIX" --vault "$VAULT" --all --local-ollama --ollama-model installed:tag
The prefix adapter verifies cloud-disabled server status and local model
identity before sending page text. Unsupported or unavailable preflight falls
back to synthetic prefixes for new or changed chunks only; prefixes from the
same endpoint and model stay in place, so a transient outage leaves an
unchanged vault's chunks and BM25 index untouched. This requirement can exclude
older Ollama servers.
Reranking and tiling use the same local-only proof before query, page, chunk,
or embedding cache work. --allow-remote-ollama approves the endpoint, not
cloud delegation by the server.
See prefix providers for the exact policy,
cloud model selection and verification limits. The reranker has its own model
and endpoint policy; selecting local prefixes does not enable reranking.
Query
For a strictly read-only lookup, use the prebuilt BM25 index:
python3 "$RETRIEVE" --vault "$VAULT" "$QUERY" --top 5 --no-rerank --explain
For an explicitly requested rerank, omit --no-rerank. The default is Ollama's
multilingual nomic-embed-text-v2-moe model (approximately 958 MB); the product
never pulls it automatically. To use an already-installed, smaller,
English-oriented v1.5 model, pass --model nomic-embed-text explicitly.
Nomic models use search_query: for the query and search_document: for
candidate text. Nomic v2 has a 512-token input context and Ollama truncates
longer embedding inputs by default; BM25 still scores the complete chunk.
Embeddings are cached by exact model, verified digest, input scheme, and hash
of
Câu hỏi thường gặp
Nó có gửi ghi chú của tôi lên internet không?
Không, trừ khi bạn đồng ý rõ ràng. Xử lý từ xa cần sự đồng ý của bạn, còn chỉ mục vẫn nằm trên máy tính của bạn.
Nó có thay đổi ghi chú của tôi không?
Không. Chỉ mục được lưu như dữ liệu phát sinh, và các ghi chú chuẩn không bị thay đổi.
Nếu bước xếp hạng lại không khả dụng thì sao?
Tìm kiếm chuyển sang phương pháp từ khóa đơn giản hơn, nên kết quả vẫn được trả về.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 16k
- Vị trí xếp hạng
- #10817
- Giấy phép
- MIT
- Cập nhật
- 25/10/2026
Bình luận
- …
Thêm skill từ kho mã này
autoresearch
16kCho phép agent của bạn nghiên cứu một chủ đề trong giới hạn đã đặt và soạn báo cáo có trích dẫn. Kết quả web chỉ là bằng chứng, không tự vào ghi chú.
canvas
16kGiúp agent của bạn tạo và cập nhật bảng canvas trong Obsidian để chứa ghi chú, file, liên kết và nhóm. Hữu ích cho bản đồ và bố cục không gian.
defuddle
16kGiúp agent của bạn lên kế hoạch làm sạch một trang web thành văn bản dễ đọc và giữ bản sao cục bộ của các file nguồn. Làm sạch qua mạng chưa khả dụng.
obsidian-bases
16kGiúp agent của bạn thiết kế các chế độ xem Obsidian Bases hoạt động như cơ sở dữ liệu đơn giản, với bộ lọc, công thức và bố cục bảng hoặc thẻ.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.