flashrag
Use FlashRAG for retrieval-augmented generation research workflows: config/data validation, retrieval and index building, generation/refinement components, RAG pipelines/method reproduction, evaluation, and WebUI setup.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- flashrag
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use FlashRAG for retrieval-augmented generation research workflows: config/data validation, retrieval and index building, generation/refinement components, RAG pipelines/method reproduction, evaluation, and WebUI setup.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/capability-map.md4.2 KB
- 参考文档references/repo-provenance.md1.9 KB
- 参考文档references/repo-routing-metadata.json501 B
- 参考文档references/troubleshooting.md3.8 KB
- 脚本scripts/check_flashrag_environment.py4.1 KB
03 SKILL.md 正文
FlashRAG
Use this skill when a task asks for help with FlashRAG, the Python toolkit for Retrieval-Augmented Generation research, benchmark reproduction, custom RAG pipelines, retriever/index setup, generator/refiner configuration, evaluation, or the FlashRAG UI.
Start Here
- Check staleness first: Read repo-provenance.md before using this skill with a local checkout; refresh the skill if the commit, dirty state, package version, or public evidence paths changed.
- Install minimally: Public package name is
flashrag-dev; install withpip install flashrag-dev --preor install a checkout withpip install -e .when editing the repo. - Verify import: Run
python -c "import flashrag, importlib.metadata as md; print(md.version('flashrag_dev'))"after install. If metadata lookup fails, tryflashrag-devbecause Python tools normalize underscores and hyphens differently. - Check optional dependencies: Run check_flashrag_environment.py before loading models, building indexes, or launching services.
- Read troubleshooting: Use troubleshooting.md for cross-cutting install/import, optional dependency, data, hardware, credential, and stale-skill failures.
Route by Task
- Config, dataset, corpus schemas, and safe input checks: Use data-and-config for
Config,Dataset, YAML/dict override behavior, JSONL schemas, and validation helpers. - Corpus preparation, retrieval, reranking, and index building: Use retrieval-and-indexing for BM25s/Pyserini, dense Faiss, CLIP/multimodal retrieval, Serper/web retrieval, rerankers, and multi-retriever fusion.
- Generators, prompt templates, refiners, compressors, and judgers: Use generation-and-refinement for HF/FastChat/vLLM/OpenAI generation, multimodal generators,
PromptTemplate, refiners, and judgers. - End-to-end pipelines and method reproduction: Use pipelines-and-methods for quick-start demos,
SequentialPipeline, active/branching/adaptive/reasoning RAG, multimodal RAG, and experiment-runner planning. - Evaluation metrics and WebUI: Use evaluation-and-webui for
Evaluator, metrics, prediction parsing, WebUI chat/evaluate setup, and service troubleshooting.
Capability Map
Read capability-map.md when a request spans multiple FlashRAG areas or when you need to choose the right sub-skill owner for a source artifact, helper, or failure mode.
Safe Workflow Defaults
- Validate config/data with the data/config helper before running retrieval or pipelines.
- For retrieval, validate corpus JSONL and build command arguments before starting index construction.
- For generation or methods, inspect config keys and optional dependency requirements before loading models or contacting APIs.
- Treat benchmark reproduction, model downloads, vLLM serving, WebUI launch, and large index builds as explicit user-approved runtime actions.
- Keep API keys, model paths, dataset locations, and machine-specific paths out of generated notes unless the user explicitly asks for local operational commands.
Optional Dependency Surface
FlashRAG core workflows commonly need torch, transformers, PyYAML, numpy, tqdm, and related runtime packages. Optional workflows add more constraints:
- Dense retrieval:
faissplus embedding model packages. - BM25 retrieval:
bm25sfor lightweight CPU use, orpyseriniplus Java for Lucene-backed indexes. - Generator acceleration:
vllmrequires a compatible PyTorch/CUDA stack. - OpenAI generation or LLMJudge-style evaluation:
openai,tiktoken, and credentials. - Multimodal RAG: image packages and model-specific utilities such as Qwen-VL helpers.
- WebUI: service/UI dependencies such as Streamlit or Gradio plus valid model/index configs.
When Editing a FlashRAG Checkout
- Prefer focused changes in the owning module and update nearby docs/examples when public behavior changes.
- Use package source and installed-package inspection to confirm APIs; docs/examples show intended workflows but source resolves defaults and edge behavior.
- If modifying public config keys, retriever/generator factories, pipeline names, or metric names, refresh this skill after the code change so routing and references stay aligned.
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).