retrieval-and-indexing
Build and diagnose FlashRAG corpora, BM25/dense/multimodal/web retrievers, indexes, rerankers, and multi-retriever configurations.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- retrieval-and-indexing
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Build and diagnose FlashRAG corpora, BM25/dense/multimodal/web retrievers, indexes, rerankers, and multi-retriever configurations.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/data-preparation.md3.9 KB
- 参考文档references/indexing-workflows.md6.8 KB
- 参考文档references/retriever-api.md6.8 KB
- 参考文档references/troubleshooting.md6.3 KB
- 脚本scripts/inspect_index_builder_args.py9.3 KB
- 脚本scripts/validate_corpus_jsonl.py5.6 KB
03 SKILL.md 正文
Retrieval and Indexing
Use this sub-skill when the task is about FlashRAG corpus preparation, index construction, retriever configuration, reranking, multi-retriever fusion, multimodal retrieval, or web retrieval. Do not use it for generator/refiner internals, full pipeline/method selection, or base dataset/config conventions outside retrieval-specific fields.
Route by Task
- Prepare corpus JSONL: validate
idandcontents, check title/text formatting, estimate chunking readiness, then see data preparation. - Build indexes: choose BM25 (
bm25sorpyserini), dense Faiss, CLIP multimodal, or SPLADE/Seismic commands; see indexing workflows. - Configure retrieval: map
retrieval_method,retrieval_model_path,index_path,corpus_path, pooling, Faiss GPU, cache, and batch settings; see retriever API. - Add reranking or fusion: configure
use_rerankeroruse_multi_retrieverwithconcat,rrf, orrerank; see retriever API. - Debug failures: missing optional dependencies, Java/Pyserini, Faiss CPU/GPU mismatch, malformed JSONL, model/index mismatches, or Serper credentials; see troubleshooting.
Bundled Helpers
scripts/validate_corpus_jsonl.pychecks FlashRAG corpus JSONL shape and reports chunking/indexing risks without rewriting the corpus.scripts/inspect_index_builder_args.pyvalidates and printspython -m flashrag.retriever.index_buildercommands without importing heavy optional retrieval dependencies.
Quick Commands
python skills/flashrag/sub-skills/retrieval-and-indexing/scripts/validate_corpus_jsonl.py corpus.jsonl --sample 20
python skills/flashrag/sub-skills/retrieval-and-indexing/scripts/inspect_index_builder_args.py --retrieval_method bm25 --corpus_path corpus.jsonl --save_dir indexes --bm25_backend bm25s
FlashRAG Retrieval Mental Model
Each usable retriever needs a corpus and either an index or an external search service. BM25 indexes are directories, dense and CLIP indexes are Faiss .index files, multimodal CLIP may use separate text and image index paths, and Serper uses web API credentials instead of local index files.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).