[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-RUC-NLPIR--FlashRAG":3,"tool-RUC-NLPIR--FlashRAG":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",157379,2,"2026-04-15T23:32:42",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":72,"owner_avatar_url":73,"owner_bio":74,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":76,"owner_url":77,"languages":78,"stars":87,"forks":88,"last_commit_at":89,"license":90,"difficulty_score":10,"env_os":91,"env_gpu":92,"env_ram":93,"env_deps":94,"category_tags":106,"github_topics":108,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":113,"updated_at":114,"faqs":115,"releases":151},7949,"RUC-NLPIR\u002FFlashRAG","FlashRAG","⚡FlashRAG: A Python Toolkit for Efficient RAG Research (WWW2025 Resource)","FlashRAG 是一款专为检索增强生成（RAG）研究打造的高效 Python 工具包，旨在帮助开发者轻松复现前沿成果并构建自定义流程。它有效解决了 RAG 领域实验环境搭建繁琐、基准测试不统一以及先进算法难以快速落地的痛点。\n\n这款工具特别适合 AI 研究人员、算法工程师及希望深入探索 RAG 技术的开发者使用。其核心亮点在于提供了一个高度模块化且可定制的框架，用户像搭积木一样灵活组合检索器、重排序器、生成器等关键组件。FlashRAG 内置了 36 个经过预处理的权威基准数据集和 23 种最先进的 RAG 算法，其中包括 7 种创新的“推理驱动”方法，能显著提升处理复杂多跳问答任务的能力。此外，它还集成了 vLLM 等加速工具以提升运行效率，并配备了直观的 FlashRAG-UI 界面，让实验监控与流程管理变得更加简单直观。无论是想要验证最新论文效果，还是开发专属的 RAG 应用，FlashRAG 都能提供坚实的技术支撑。","# \u003Cdiv align=\"center\">⚡FlashRAG: A Python Toolkit for Efficient RAG Research\u003Cdiv>\n\\[ English | [中文](README_zh.md) \\]\n\u003Cdiv align=\"center\">\n\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.13576\" target=\"_blank\">\u003Cimg src=https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-b5212f.svg?logo=arxiv>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FRUC-NLPIR\u002FFlashRAG_datasets\u002F\" target=\"_blank\">\u003Cimg src=https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20HuggingFace%20Datasets-27b3b4.svg>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.modelscope.cn\u002Fdatasets\u002Fhhjinjiajie\u002FFlashRAG_Dataset\" target=\"_blank\">\u003Cimg src=https:\u002F\u002Fcustom-icon-badges.demolab.com\u002Fbadge\u002FModelScope%20Datasets-624aff?style=flat&logo=modelscope&logoColor=white>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdeepwiki.com\u002FRUC-NLPIR\u002FFlashRAG\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_1a081b2fa577.png\" alt=\"DeepWiki Document\" height=\"20\"\u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg alt=\"License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLICENSE-MIT-green\">\u003C\u002Fa>\n\u003Ca>\u003Cimg alt=\"Static Badge\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fmade_with-Python-blue\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Ch4 align=\"center\">\n\n\u003Cp>\n\u003Ca href=\"#wrench-installation\">Installation\u003C\u002Fa> |\n\u003Ca href=\"#sparkles-features\">Features\u003C\u002Fa> |\n\u003Ca href=\"#rocket-quick-start\">Quick-Start\u003C\u002Fa> |\n\u003Ca href=\"#gear-components\"> Components\u003C\u002Fa> |\n\u003Ca href=\"#art-flashrag-ui\"> FlashRAG-UI\u003C\u002Fa> |\n\u003Ca href=\"#robot-supporting-methods\"> Supporting Methods\u003C\u002Fa> |\n\u003Ca href=\"#notebook-supporting-datasets--document-corpus\"> Supporting Datasets\u003C\u002Fa> |\n\u003Ca href=\"#raised_hands-additional-faqs\"> FAQs\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003C\u002Fh4>\n\n\nFlashRAG is a Python toolkit for the reproduction and development of Retrieval Augmented Generation (RAG) research. Our toolkit includes 36 pre-processed benchmark RAG datasets and **23 state-of-the-art RAG algorithms**, including **7 reasoning-based methods** that combine reasoning ability with retrieval.\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_a5b3f114cfae.jpg\">\n\u003C\u002Fp>\n\nWith FlashRAG and provided resources, you can effortlessly reproduce existing SOTA works in the RAG domain or implement your custom RAG processes and components. Besides, we provide an easy-to-use UI:\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F8ca00873-5df2-48a7-b853-89e7b18bc6e9\n\n\u003Cp>\n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F10454\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_1145cd82417e.png\" alt=\"RUC-NLPIR%2FFlashRAG | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n## :link: Navigation\n- [Features](#sparkles-features)\n- [Roadmap](#mag_right-roadmap)\n- [Changelog](#page_with_curl-changelog)\n- [Installation](#wrench-installation)\n- [Quick Start](#rocket-quick-start)\n- [Components](#gear-components)\n- [FlashRAG-UI](#art-flashrag-ui)\n- [Supporting Methods](#robot-supporting-methods)\n- [Supporting Datasets & Document Corpus](#notebook-supporting-datasets--document-corpus)\n- [Additional FAQs](#raised_hands-additional-faqs)\n- [License](#bookmark-license)\n- [Citation](#star2-citation)\n\n## :sparkles: Features\n\n- **Extensive and Customizable Framework**: Includes essential components for RAG scenarios such as retrievers, rerankers, generators, and compressors, allowing for flexible assembly of complex pipelines.\n\n- **Comprehensive Benchmark Datasets**: A collection of 36 pre-processed RAG benchmark datasets to test and validate RAG models' performances.\n\n- **Pre-implemented Advanced RAG Algorithms**: Features **23 advancing RAG algorithms** with reported results, based on our framework. Easily reproducing results under different settings.\n\n- **🚀 Reasoning-based Methods**: **NEW!** We now support **7 reasoning-based methods** that combine reasoning ability with retrieval, achieving superior performance on complex multi-hop tasks.\n\n- **Efficient Preprocessing Stage**: Simplifies the RAG workflow preparation by providing various scripts like corpus processing for retrieval, retrieval index building, and pre-retrieval of documents.\n\n- **Optimized Execution**: The library's efficiency is enhanced with tools like vLLM, FastChat for LLM inference acceleration, and Faiss for vector index management.\n\n- **Easy to Use UI** : We have developed a very easy to use UI to easily and quickly configure and experience the RAG baselines we have implemented, as well as run evaluation scripts on a visual interface.\n\n## :mag_right: Roadmap\n\nFlashRAG is still under development and there are many issues and room for improvement. We will continue to update. And we also sincerely welcome contributions on this open-source toolkit.\n\n- [x] Support OpenAI models\n- [x] Provdide instructions for each component\n- [x] Integrate sentence Transformers\n- [x] Support multimodal RAG\n- [x] Support reasoning-based methods\n- [ ] Inlcude more RAG approaches\n- [ ] Enhance code adaptability and readability\n- [ ] Add support for api-based retriever (vllm server)\n\n## :page_with_curl: Changelog\n[25\u002F11\u002F06] 🎯 NEW Retriever! We have integrated a Web Search Engine-based Retriever, which seamlessly integrates with existing methods and can be enabled quickly with just a Serper API key! This enhancement significantly expands retrieval coverage and real-time capability, supporting dynamic information access and external knowledge augmentation. Experience a more flexible and powerful retrieval workflow now! \n\n[25\u002F08\u002F06] 🎯 **NEW!** We have added support for **Reasoning Pipeline**, which is a new paradigm that combines reasoning ability and retrieval, representing work that includes [R1-Searcher](https:\u002F\u002Fgithub.com\u002FSsmallSong\u002FR1-Searcher), [Search-R1](https:\u002F\u002Fgithub.com\u002FPeterGriffinJin\u002FSearch-R1),.... We evaluate the performance of the pipeline on various RAG benchmarks, it can achieve F1 scores close to 60 on multi hop inference datasets such as HotpotQA. See it in [**result table**](#robot-supporting-methods).\n\n[25\u002F03\u002F21] 🚀 **Major Update!** We have expanded our toolkit to support **23 state-of-the-art RAG algorithms**, including **7 reasoning-based methods** that significantly improve performance on complex reasoning tasks. This represents a major milestone in our toolkit's evolution!\n\n[25\u002F02\u002F24] 🔥🔥🔥 We have added support for **multimodal RAG**, including [**MLLMs like Llava, Qwen, InternVL**](https:\u002F\u002Fruc-nlpir.github.io\u002FFlashRAG\u002F#\u002Fzh-cn\u002Fcomponent\u002Fgenerator?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e7%94%9f%e6%88%90%e5%99%a8), and various [**multimodal retrievers with Clip architecture**](https:\u002F\u002Fruc-nlpir.github.io\u002FFlashRAG\u002F#\u002Fzh-cn\u002Fcomponent\u002Fretriever?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e6%a3%80%e7%b4%a2%e5%99%a8). More information can be found in our new version of arxiv article and our documentation. Try it!\n\n[25\u002F01\u002F21] Our technical paper [FlashRAG: A Python Toolkit for Efficient RAG Research](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.13576) is honored to have been accepted to the Resource Track of the 2025 **ACM Web Conference (WWW 2025)**. Please Check it out!\n\n[25\u002F01\u002F12] Introduce \u003Cstrong>FlashRAG-UI\u003C\u002Fstrong>, an easy to use interface. You can easily and quickly configure and experience the supported RAG methods and evaluate them on the benchmarks.\n\n[25\u002F01\u002F11] We have added support for a new method [\u003Cu>RQRAG\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2404.00610) method, see it in [**reproduce_experiment**](docs\u002Foriginal_docs\u002Freproduce_experiment.md).\n\n[25\u002F01\u002F07] We have currently support the aggregation of multiple retrievers, see it in [**multi retriever usage**](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fblob\u002Fmain\u002Fdocs\u002Foriginal_docs\u002Fmulti_retriever_usage.md).\n\n[25\u002F01\u002F07] We have integrated a very flexible and lightweight corpus chunking library [**Chunkie**](https:\u002F\u002Fgithub.com\u002Fchonkie-ai\u002Fchonkie?tab=readme-ov-file#usage), which supports various custom chunking methods (tokens, sentences, semantic, etc.). Use it in [\u003Cu>chunking doc corpus\u003C\u002Fu>](docs\u002Foriginal_docs\u002Fchunk-doc-corpus.md).\n\n[24\u002F10\u002F21] We have released a version based on the Paddle framework that supports Chinese hardware platforms. Please refer to [FlashRAG Paddle](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG-Paddle) for details.\n\n[24\u002F10\u002F13] A new in-domain dataset and corpus - [DomainRAG](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2406.05654) have been added to the dataset. The dataset is based on the internal enrollment data of Renmin University of China, covering seven types of tasks, which can be used for conducting domain-specific RAG testing.\n\n[24\u002F09\u002F24] We have released a version based on the MindSpore framework that supports Chinese hardware platforms. Please refer to [FlashRAG MindSpore](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG-MindSpore) for details.\n\n\u003Cdetails>\n\u003Csummary>Show more\u003C\u002Fsummary>\n\n[24\u002F09\u002F18] Due to the complexity and limitations of installing Pyserini in certain environments, we have introduced a lightweight `BM25s` package as an alternative (faster and easier to use). The retriever based on Pyserini will be deprecated in future versions. To use retriever with `bm25s`, just set `bm25_backend` to `bm25s` in config.\n\n[24\u002F09\u002F09] We add support for a new method [\u003Cu>Adaptive-RAG\u003C\u002Fu>](https:\u002F\u002Faclanthology.org\u002F2024.naacl-long.389.pdf), which can automatically select the RAG process to execute based on the type of query. See it result in [\u003Cu>result table\u003C\u002Fu>](#robot-supporting-methods).\n\n[24\u002F08\u002F02] We add support for a new method [\u003Cu>Spring\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.19670), significantly improve the performance of LLM by adding only a few token embeddings. See it result in [\u003Cu>result table\u003C\u002Fu>](#robot-supporting-methods).\n\n[24\u002F07\u002F17] Due to some unknown issues with HuggingFace, our original dataset link has been invalid. We have updated it. Please check the [new link](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FRUC-NLPIR\u002FFlashRAG_datasets\u002F) if you encounter any problems.\n\n[24\u002F07\u002F06] We add support for a new method: [\u003Cu>Trace\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.11460), which refine text by constructing a knowledge graph. See it [\u003Cu>results\u003C\u002Fu>](#robot-supporting-methods) and [\u003Cu>details\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbaseline_details.md).\n\n[24\u002F06\u002F19] We add support for a new method: [\u003Cu>IRCoT\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2212.10509), and update the [\u003Cu>result table\u003C\u002Fu>](#robot-supporting-methods).\n\n[24\u002F06\u002F15] We provide a [\u003Cu>demo\u003C\u002Fu>](.\u002Fexamples\u002Fquick_start\u002Fdemo_en.py) to perform the RAG process using our toolkit.\n\n[24\u002F06\u002F11] We have integrated `sentence transformers` in the retriever module. Now it's easier to use the retriever without setting pooling methods.\n\n[24\u002F06\u002F05] We have provided detailed document for reproducing existing methods (see [how to reproduce](.\u002Fdocs\u002Foriginal_docs\u002Freproduce_experiment.md), [baseline details](.\u002Fdocs\u002Foriginal_docs\u002Fbaseline_details.md)), and [\u003Cu>configurations settings\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fconfiguration.md).\n\n[24\u002F06\u002F02] We have provided an introduction of FlashRAG for beginners, see [\u003Cu>an introduction to flashrag\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fintroduction_for_beginners_en.md) ([\u003Cu>中文版\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fintroduction_for_beginners_zh.md) [\u003Cu>한국어\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fintroduction_for_beginners_kr.md)).\n\n[24\u002F05\u002F31] We supported Openai-series models as generator.\n\n\u003C\u002Fdetails>\n\n## :wrench: Installation\n![PyPI - Version](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fflashrag-dev) \n![PyPI - Downloads](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdw\u002Fflashrag-dev) \n![PyPI - Downloads](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Fflashrag-dev)\n\nTo get started with FlashRAG, you can simply install it with pip:\n\n```base\npip install flashrag-dev --pre\n```\n\nOr you can clone it from Github and install (requires Python 3.10+):\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG.git\ncd FlashRAG\npip install -e .\n```\n\nIf you want to use vllm, sentence-transformers or pyserini, you can install the optional dependencies:\n\n```bash\n# Install all extra dependencies\npip install flashrag-dev[full]\n\n# Install vllm for faster speed\npip install vllm>=0.4.1\n\n# Install sentence-transformers\npip install sentence-transformers\n\n# Install pyserini for bm25\npip install pyserini\n```\n\nDue to the incompatibility when installing `faiss` using `pip`, it is necessary to use the following conda command for installation.\n\n```bash\n# CPU-only version\nconda install -c pytorch faiss-cpu=1.8.0\n\n# GPU(+CPU) version\nconda install -c pytorch -c nvidia faiss-gpu=1.8.0\n```\n\nNote: It is impossible to install the latest version of `faiss` on certain systems.\n\nFrom the official Faiss repository ([source](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Ffaiss\u002Fblob\u002Fmain\u002FINSTALL.md)):\n\n> - The CPU-only faiss-cpu conda package is currently available on Linux (x86_64 and arm64), OSX (arm64 only), and Windows (x86_64)\n> - faiss-gpu, containing both CPU and GPU indices, is available on Linux (x86_64 only) for CUDA 11.4 and 12.1\n\n## :rocket: Quick Start\n\n### Corpus Construction\nTo build an index, you first need to save your corpus as a `jsonl` file with each line representing a document.\n\n```jsonl\n{\"id\": \"0\", \"contents\": \"...\"}\n{\"id\": \"1\", \"contents\": \"...\"}\n```\n\nIf you want to use Wikipedia as your corpus, you can refer to our documentation [Processing Wikipedia](.\u002Fdocs\u002Foriginal_docs\u002Fprocess-wiki.md) to convert it into an indexable format.\n\n### Index Construction\n\nYou can use the following code to build your own index.\n\n* For **dense retrieval methods**, especially popular embedding models, we use `faiss` to build the index.\n\n* For **sparse retrieval methods (BM25)**, we use `Pyserini` or `bm25s` to build the corpus into a Lucene inverted index. The built index contains the original documents.\n\n#### For Dense Retrieval Methods\n\nModify the parameters in the following code to your own.\n\n```bash\npython -m flashrag.retriever.index_builder \\\n  --retrieval_method e5 \\\n  --model_path \u002Fmodel\u002Fe5-base-v2\u002F \\\n  --corpus_path indexes\u002Fsample_corpus.jsonl \\\n  --save_dir indexes\u002F \\\n  --use_fp16 \\\n  --max_length 512 \\\n  --batch_size 256 \\\n  --pooling_method mean \\\n  --faiss_type Flat \n```\n\n* ```--pooling_method```: If this parameter is not specified, we will automatically select it based on the model name and model file. However, since different embedding models use different pooling methods, **we may not have fully implemented them**. To ensure accuracy, you can **specify the pooling method corresponding to the retrieval model you are using** (`mean`, `pooler`, or `cls`).\n\n* ```---instruction```: Some embedding models require additional instructions to be concatenated to the query before encoding, which can be specified here. Currently, we will automatically fill in the instructions for **E5** and **BGE** models, while other models need to be supplemented manually.\n\nIf the retrieval model supports the `sentence transformers` library, you can use the following code to build the index (**without considering the pooling method**).\n\n```bash\npython -m flashrag.retriever.index_builder \\\n  --retrieval_method e5 \\\n  --model_path \u002Fmodel\u002Fe5-base-v2\u002F \\\n  --corpus_path indexes\u002Fsample_corpus.jsonl \\\n  --save_dir indexes\u002F \\\n  --use_fp16 \\\n  --max_length 512 \\\n  --batch_size 256 \\\n  --pooling_method mean \\\n  --sentence_transformer \\\n  --faiss_type Flat \n```\n\n#### For Sparse Retrieval Methods (BM25)\n\nIf building a bm25 index, there is no need to specify `model_path`.\n\n##### Building Index with BM25s\n\n```bash\npython -m flashrag.retriever.index_builder \\\n  --retrieval_method bm25 \\\n  --corpus_path indexes\u002Fsample_corpus.jsonl \\\n  --bm25_backend bm25s \\\n  --save_dir indexes\u002F \n```\n\n##### Building Index with Pyserini\n\n```bash\npython -m flashrag.retriever.index_builder \\\n  --retrieval_method bm25 \\\n  --corpus_path indexes\u002Fsample_corpus.jsonl \\\n  --bm25_backend pyserini \\\n  --save_dir indexes\u002F \n```\n\n### For Sparse Neural Retrieval Methods (SPLADE)\n\n##### Install Seismic Index:\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh # Install Rust for compiling\npip install pyseismic-lsr # Install Seismic\n```\n\n##### Then build the index with Seismic:\n```bash\npython -m flashrag.retriever.index_builder \\ # builder\n        --retrieval_method splade \\ # Model name to trigger seismic index (splade only available)\n        --model_path retriever\u002Fsplade-v3 \\ # Local path or repository path are both supported.\n        --corpus_embedded_path data\u002Fms_marco\u002Fms_marco_embedded_corpus.jsonl \\  # Use cached embedded corpus if corpus is already available in seismic expected format\n        --corpus_path data\u002Fms_marco\u002Fms_marco_corpus.jsonl \\ # Corpus path in format {id, contents} jsonl file to be embedded if not already built\n        --save_dir indexes\u002F \\ # save index directory\n        --use_fp16 \\ # tell to use fp16 for splade model\n        --max_length 512 \\ # max tokens for each document\n        --batch_size 4 \\ # batch size for splade model (4-5 seems the best size for Tesla T4 16GB)\n        --n_postings 1000 \\ # seismic number of posting lists\n        --centroid_fraction 0.2 \\ # seismic centroids\n        --min_cluster_size 2 \\ # seismic min cluster\n        --summary_energy 0.4 \\ # seismic energy\n        --batched_indexing 10000000 # seismic batch\n        --nknn 32 # Optional parameter. Tell to seismic to use also knn graph. if not present seismic will work without knn graph\n```\n### Using the ready-made pipeline\n\nYou can use the pipeline class we have already built (as shown in [\u003Cu>pipelines\u003C\u002Fu>](#pipelines)) to implement the RAG process inside. In this case, you just need to configure the config and load the corresponding pipeline.\n\nFirstly, load the entire process's config, which records various hyperparameters required in the RAG process. You can input yaml files as parameters or directly as variables.\n\nPlease note that **variables as input take precedence over files**.\n\n```python\nfrom flashrag.config import Config\n\n# hybrid load configs\nconfig_dict = {'data_dir': 'dataset\u002F'}\nmy_config = Config(\n    config_file_path = 'my_config.yaml',\n    config_dict = config_dict\n```\n\nWe provide comprehensive guidance on how to set configurations, you can see our [\u003Cu>configuration guidance\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fconfiguration.md).\nYou can also refer to the [\u003Cu>basic yaml file\u003C\u002Fu>](.\u002Fflashrag\u002Fconfig\u002Fbasic_config.yaml) we provide to set your own parameters.\n\nNext, load the corresponding dataset and initialize the pipeline. The components in the pipeline will be automatically loaded.\n\n```python\nfrom flashrag.utils import get_dataset\nfrom flashrag.pipeline import SequentialPipeline\nfrom flashrag.prompt import PromptTemplate\nfrom flashrag.config import Config\n\nconfig_dict = {'data_dir': 'dataset\u002F'}\nmy_config = Config(\n    config_file_path = 'my_config.yaml',\n    config_dict = config_dict\n)\nall_split = get_dataset(my_config)\ntest_data = all_split['test']\n\npipeline = SequentialPipeline(my_config)\n```\n\nYou can specify your own input prompt using `PromptTemplete`:\n\n```python\nprompt_templete = PromptTemplate(\n    config,\n    system_prompt = \"Answer the question based on the given document. Only give me the answer and do not output any other words.\\nThe following are given documents.\\n\\n{reference}\",\n    user_prompt = \"Question: {question}\\nAnswer:\"\n)\npipeline = SequentialPipeline(\n  my_config,\n  prompt_template = prompt_templete\n)\n```\n\nFinally, execute `pipeline.run` to obtain the final result.\n\n```python\noutput_dataset = pipeline.run(test_data, do_eval=True)\n```\n\nThe `output_dataset` contains the intermediate results and metric scores for each item in the input dataset.\nMeanwhile, the dataset with intermediate results and the overall evaluation score will also be saved as a file (if `save_intermediate_data` and `save_metric_score` are specified).\n\n### Build your own pipeline!\n\nSometimes you may need to implement more complex RAG process, and you can build your own pipeline to implement it.\nYou just need to inherit `BasicPipeline`, initialize the components you need, and complete the `run` function.\n\n```python\nfrom flashrag.pipeline import BasicPipeline\nfrom flashrag.utils import get_retriever, get_generator\n\nclass ToyPipeline(BasicPipeline):\n  def __init__(self, config, prompt_templete=None):\n    # Load your own components\n    pass\n\n  def run(self, dataset, do_eval=True):\n    # Complete your own process logic\n\n    # get attribute in dataset using `.`\n    input_query = dataset.question\n    ...\n    # use `update_output` to save intermeidate data\n    dataset.update_output(\"pred\",pred_answer_list)\n    dataset = self.evaluate(dataset, do_eval=do_eval)\n    return dataset\n```\n\nPlease first understand the input and output forms of the components you need to use from our [\u003Cu>documentation\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbasic_usage.md).\n\n### Just use components\n\nIf you already have your own code and only want to use our components to embed the original code, you can refer to the [\u003Cu>basic introduction of the components\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbasic_usage.md) to obtain the input and output formats of each component.\n\n## :gear: Components\n\nIn FlashRAG, we have built a series of common RAG components, including retrievers, generators, refiners, and more. Based on these components, we have assembled several pipelines to implement the RAG workflow, while also providing the flexibility to combine these components in custom arrangements to create your own pipeline.\n\n#### RAG-Components\n\n\u003Ctable>\n  \u003Cthead>\n    \u003Ctr>\n      \u003Cth>Type\u003C\u002Fth>\n      \u003Cth>Module\u003C\u002Fth>\n      \u003Cth>Description\u003C\u002Fth>\n    \u003C\u002Ftr>\n  \u003C\u002Fthead>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd rowspan=\"1\">Judger\u003C\u002Ftd>\n      \u003Ctd>SKR Judger\u003C\u002Ftd>\n      \u003Ctd>Judging whether to retrieve using \u003Ca href=\"https:\u002F\u002Faclanthology.org\u002F2023.findings-emnlp.691.pdf\">SKR\u003C\u002Fa> method\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd rowspan=\"4\">Retriever\u003C\u002Ftd>\n      \u003Ctd>Dense Retriever\u003C\u002Ftd>\n      \u003Ctd>Bi-encoder models such as dpr, bge, e5, using faiss for search\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>BM25 Retriever\u003C\u002Ftd>\n      \u003Ctd>Sparse retrieval method based on Lucene\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>Bi-Encoder Reranker\u003C\u002Ftd>\n      \u003Ctd>Calculate matching score using bi-Encoder\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>Cross-Encoder Reranker\u003C\u002Ftd>\n      \u003Ctd>Calculate matching score using cross-encoder\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd rowspan=\"5\">Refiner\u003C\u002Ftd>\n      \u003Ctd>Extractive Refiner\u003C\u002Ftd>\n      \u003Ctd>Refine input by extracting important context\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>Abstractive Refiner\u003C\u002Ftd>\n      \u003Ctd>Refine input through seq2seq model\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>LLMLingua Refiner\u003C\u002Ftd>\n      \u003Ctd>\u003Ca href=\"https:\u002F\u002Faclanthology.org\u002F2023.emnlp-main.825\u002F\">LLMLingua-series\u003C\u002Fa> prompt compressor\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>SelectiveContext Refiner\u003C\u002Ftd>\n      \u003Ctd>\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.06201\">Selective-Context\u003C\u002Fa> prompt compressor\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd> KG Refiner \u003C\u002Ftd>\n      \u003Ctd>Use \u003Ca hred='https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.11460'>Trace method to construct a knowledge graph\u003C\u002Ftd>\n    \u003Ctr>\n      \u003Ctd rowspan=\"4\">Generator\u003C\u002Ftd>\n      \u003Ctd>Encoder-Decoder Generator\u003C\u002Ftd>\n      \u003Ctd>Encoder-Decoder model, supporting \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2007.01282\">Fusion-in-Decoder (FiD)\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>Decoder-only Generator\u003C\u002Ftd>\n      \u003Ctd>Native transformers implementation\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>FastChat Generator\u003C\u002Ftd>\n      \u003Ctd>Accelerate with \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Flm-sys\u002FFastChat\">FastChat\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>vllm Generator\u003C\u002Ftd>\n      \u003Ctd>Accelerate with \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fvllm-project\u002Fvllm\">vllm\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n#### Pipelines\n\nReferring to a [\u003Cu>survey on retrieval-augmented generation\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2312.10997), we categorized RAG methods into four types based on their inference paths.\n\n- **Sequential**: Sequential execuation of RAG process, like Query-(pre-retrieval)-retriever-(post-retrieval)-generator\n- **Conditional**: Implements different paths for different types of input queries\n- **Branching** : Executes multiple paths in parallel, merging the responses from each path\n- **Loop**: Iteratively performs retrieval and generation\n\nIn each category, we have implemented corresponding common pipelines. Some pipelines have corresponding work papers.\n\n\u003Ctable>\n    \u003Cthead>\n        \u003Ctr>\n            \u003Cth>Type\u003C\u002Fth>\n            \u003Cth>Module\u003C\u002Fth>\n            \u003Cth>Description\u003C\u002Fth>\n        \u003C\u002Ftr>\n    \u003C\u002Fthead>\n    \u003Ctbody>\n        \u003Ctr>\n            \u003Ctd rowspan=\"1\">Sequential\u003C\u002Ftd>\n            \u003Ctd>Sequential Pipeline\u003C\u002Ftd>\n            \u003Ctd>Linear execution of query, supporting refiner, reranker\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd rowspan=\"1\">Conditional\u003C\u002Ftd>\n            \u003Ctd>Conditional Pipeline\u003C\u002Ftd>\n            \u003Ctd>With a judger module, distinct execution paths for various query types\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd rowspan=\"2\">Branching\u003C\u002Ftd>\n            \u003Ctd>REPLUG Pipeline\u003C\u002Ftd>\n            \u003Ctd>Generate answer by integrating probabilities in multiple generation paths\u003C\u002Ftd>\n        \u003C\u002Ftr>\n          \u003Ctd>SuRe Pipeline\u003C\u002Ftd>\n          \u003Ctd>Ranking and merging generated results based on each document\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd rowspan=\"6\">Loop\u003C\u002Ftd>\n            \u003Ctd>Iterative Pipeline\u003C\u002Ftd>\n            \u003Ctd>Alternating retrieval and generation\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Self-Ask Pipeline\u003C\u002Ftd>\n            \u003Ctd>Decompose complex problems into subproblems using \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2210.03350\">self-ask\u003C\u002Fa> \u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Self-RAG Pipeline\u003C\u002Ftd>\n            \u003Ctd>Adaptive retrieval, critique, and generation\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>FLARE Pipeline\u003C\u002Ftd>\n            \u003Ctd>Dynamic retrieval during the generation process\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>IRCoT Pipeline\u003C\u002Ftd>\n            \u003Ctd>Integrate retrieval process with CoT\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Reasoning Pipeline\u003C\u002Ftd>\n            \u003Ctd>Reasoning with retrieval\u003C\u002Ftd>\n        \u003C\u002Ftr>\n    \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## :art: FlashRAG-UI\n\u003Cp>With \u003Cstrong>FlashRAG-UI\u003C\u002Fstrong>, you can easily and quickly configure and experience the supported RAG methods through our meticulously designed visual interface, and evaluate these methods on benchmarks, making complex research work more efficient!\u003C\u002Fp>\n\n### :star2: Features\n- **One-Click Configuration Loading**\n  - You can load parameters and configuration files for various RAG methods through simple clicks, selections, and inputs.\u003C\u002Fli>\n  - Supports preview interface for intuitive parameter settings.\u003C\u002Fli>\n  - Provides save functionality to easily store configurations for future use.\u003C\u002Fli>\n- **Quick Method Experience**\n  - Quickly load corpora and index files to explore the characteristics and application scenarios of various RAG methods.\u003C\u002Fli>\n  - Supports loading and switching different components and hyperparameters, seamlessly connecting different RAG Pipelines to quickly experience their performance and differences!\u003C\u002Fli>\n- **Efficient Benchmark Reproduction**\n  - Easily reproduce the built-in baseline methods and carefully collected benchmarks on FlashRAG-UI.\u003C\u002Fli>\n  - Use cutting-edge research tools directly without complex settings, providing a smooth experience for your research work!\u003C\u002Fli>\n  \n\u003Cdetails>\n\u003Csummary>Show more\u003C\u002Fsummary>\n\u003Ctable align=\"center\">\n  \u003Ctr>\n    \u003Ctd align=\"center\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_0a1930e6bb7c.jpg\" alt=\"Image 1\" width=\"505\"\u002F>\n    \u003C\u002Ftd>\n    \u003Ctd align=\"center\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_f1e70bb39adc.jpg\" alt=\"Image 2\" width=\"505\"\u002F>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd align=\"center\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_46a9fd9f4c8f.png\" alt=\"Image 3\" width=\"500\"\u002F>\n    \u003C\u002Ftd>\n    \u003Ctd align=\"center\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_d09a05434c17.jpg\" alt=\"Image 4\" width=\"500\"\u002F>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fdetails>\n\n#### Experience our meticulously designed FlashRAG-UI—both user-friendly and visually appealing:\n```bash\ncd webui\npython interface.py\n```\n\n## :robot: Supporting Methods\n\nWe have implemented **23 works** with a consistent setting of:\n\n- **Generator:** LLAMA3-8B-instruct with input length of 2048\n- **Retriever:** e5-base-v2 as embedding model, retrieve 5 docs per query\n- **Prompt:** A consistent default prompt, template can be found in the [\u003Cu>method details\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbaseline_details.md).\n\nFor open-source methods, we implemented their processes using our framework. For methods where the author did not provide source code, we will try our best to follow the methods in the original paper for implementation.\n\nFor necessary settings and hyperparameters specific to some methods, we have documented them in the **specific settings** column. For more details, please consult our [\u003Cu>reproduce guidance\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Freproduce_experiment.md) and [\u003Cu>method details\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbaseline_details.md).\n\nIt's important to note that, to ensure consistency, we have utilized a uniform setting. However, this setting may differ from the original setting of the method, leading to variations in results compared to the original outcomes.\n\n| Method                                                                                    | Type        | NQ (EM) | TriviaQA (EM) | Hotpotqa (F1) | 2Wiki (F1) | PopQA (F1) | WebQA(EM) | Specific setting                                |\n| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |\n| Naive Generation                                                                          | Sequential  | 22.6    | 55.7          | 28.4          | 33.9       | 21.7       | 18.8      |                                                 |\n| Standard RAG                                                                              | Sequential  | 35.1    | 58.9          | 35.3          | 21.0       | 36.7       | 15.7      |                                                 |\n| [AAR-contriever-kilt](https:\u002F\u002Faclanthology.org\u002F2023.acl-long.136.pdf)                     | Sequential  | 30.1    | 56.8          | 33.4          | 19.8       | 36.1       | 16.1      |                                                 |\n| [LongLLMLingua](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.06839)                                         | Sequential  | 32.2    | 59.2          | 37.5          | 25.0       | 38.7       | 17.5      | Compress Ratio=0.5                              |\n| [RECOMP-abstractive](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2310.04408)                                    | Sequential  | 33.1    | 56.4          | 37.5          | 32.4       | 39.9       | 20.2      |                                                 |\n| [Selective-Context](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.06201)                                     | Sequential  | 30.5    | 55.6          | 34.4          | 18.5       | 33.5       | 17.3      | Compress Ratio=0.5                              |\n| [Trace](https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.11460)                                                 | Sequential  | 30.7    | 50.2          | 34.0          | 15.5       | 37.4       | 19.9      |                                                 |\n| [Spring](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.19670)                                                | Sequential  | 37.9    | 64.6          | 42.6          | 37.3       | 54.8       | 27.7      | Use Llama2-7B-chat with trained embedding table |\n| [SuRe](https:\u002F\u002Farxiv.org\u002Fabs\u002F2404.13081)                                                  | Branching   | 37.1    | 53.2          | 33.4          | 20.6       | 48.1       | 24.2      | Use provided prompt                             |\n| [REPLUG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.12652)                                                | Branching   | 28.9    | 57.7          | 31.2          | 21.1       | 27.8       | 20.2      |                                                 |\n| [SKR](https:\u002F\u002Faclanthology.org\u002F2023.findings-emnlp.691.pdf)                               | Conditional | 33.2    | 56.0          | 32.4          | 23.4       | 31.7       | 17.0      | Use infernece-time training data                |\n| [Adaptive-RAG](https:\u002F\u002Faclanthology.org\u002F2024.naacl-long.389.pdf)                          | Conditional | 35.1    | 56.6          | 39.1          | 28.4       | 40.4       | 16.0      |                                                 |\n| [Ret-Robust](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.01558)                                            | Loop        | 42.9    | 68.2          | 35.8          | 43.4       | 57.2       | 33.7      | Use LLAMA2-13B with trained lora                |\n| [Self-RAG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.11511)                                              | Loop        | 36.4    | 38.2          | 29.6          | 25.1       | 32.7       | 21.9      | Use trained selfrag-llama2-7B                   |\n| [FLARE](https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.06983)                                                 | Loop        | 22.5    | 55.8          | 28.0          | 33.9       | 20.7       | 20.2      |                                                 |\n| [Iter-Retgen](https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.15294), [ITRG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.05149) | Loop        | 36.8    | 60.1          | 38.3          | 21.6       | 37.9       | 18.2      |                                                 |\n| [IRCoT](https:\u002F\u002Faclanthology.org\u002F2023.acl-long.557.pdf)                                   | Loop        | 33.3    | 56.9          | 41.5          | 32.4       | 45.6       | 20.7      |                                                 |\n| [RQRAG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2404.00610)                                   | Loop        | 32.6    | 52.5          | 33.5          | 35.8       | 46.4       | 26.2      |  Use trained rqrag-llama2-7B                                               | \n\n#### 🚀 Reasoning-based Methods (NEW!)\n\nWe now support **7 reasoning-based methods** that combine reasoning ability with retrieval, achieving superior performance on complex multi-hop tasks:\n\n| Method                                                                                    | Type        | NQ (EM) | TriviaQA (EM) | PopQA (EM) | Hotpotqa (F1) | 2Wiki (F1) |  Musique (F1) | Bamboogle (F1) | Specific setting                             |\n| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |\n| [Search-R1](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.09516) | Reasoning | 45.2 | 62.2 | 49.2 | 54.5 | 42.6 | 29.2 |  59.9 | SearchR1-nq_hotpotqa_train-qwen2.5-7b-em-ppo |\n| [R1-Searcher](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2503.05592) | Reasoning | 36.9 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-2.5-7B-base-RAG-RL |\n| [O2-Searcher](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2505.16582) | Reasoning | 41.4 | 51.4 | 46.8 | 43.4 | 48.6 | 19.0 | 47.6 | O2-Searcher-Qwen2.5-3B-GRPO |\n| [AutoRefine](https:\u002F\u002Fwww.arxiv.org\u002Fpdf\u002F2505.11277) | Reasoning | 43.8 | 59.8 | 32.4 | 54.0 | 50.3 | 23.6 | 46.6 | AutoRefine-Qwen2.5-3B-Base |\n| [ReaRAG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.21729) | Reasoning | 26.3 | 51.8 | 24.6 | 42.9 | 41.6 | 21.2 | 41.9 | ReaRAG-9B |\n| [CoRAG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.21729) | Reasoning | 40.9 | 63.1 | 36.0 | 56.6 | 60.7 | 31.9 | 54.1 | CoRAG-Llama3.1-8B-MultihopQA |\n| [SimpleDeepSearcher](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2505.16834) | Reasoning | 36.1 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-7B-SimpleDeepSearcher |\n\n## :notebook: Supporting Datasets & Document Corpus\n\n### Datasets\n\nWe have collected and processed 36 datasets widely used in RAG research, pre-processing them to ensure a consistent format for ease of use. For certain datasets (such as Wiki-asp), we have adapted them to fit the requirements of RAG tasks according to the methods commonly used within the community. All datasets are available at [\u003Cu>Huggingface datasets\u003C\u002Fu>](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FRUC-NLPIR\u002FFlashRAG_datasets).\n\nFor each dataset, we save each split as a `jsonl` file, and each line is a dict as follows:\n\n```python\n{\n  'id': str,\n  'question': str,\n  'golden_answers': List[str],\n  'metadata': dict\n}\n```\n\nBelow is the list of datasets along with the corresponding sample sizes:\n\n| Task                      | Dataset Name    | Knowledge Source | # Train   | # Dev   | # Test |\n| ------------------------- | --------------- | ---------------- | --------- | ------- | ------ |\n| QA                        | NQ              | wiki             | 79,168    | 8,757   | 3,610  |\n| QA                        | TriviaQA        | wiki & web       | 78,785    | 8,837   | 11,313 |\n| QA                        | PopQA           | wiki             | \u002F         | \u002F       | 14,267 |\n| QA                        | SQuAD           | wiki             | 87,599    | 10,570  | \u002F      |\n| QA                        | MSMARCO-QA      | web              | 808,731   | 101,093 | \u002F      |\n| QA                        | NarrativeQA     | books and story  | 32,747    | 3,461   | 10,557 |\n| QA                        | WikiQA          | wiki             | 20,360    | 2,733   | 6,165  |\n| QA                        | WebQuestions    | Google Freebase  | 3,778     | \u002F       | 2,032  |\n| QA                        | AmbigQA         | wiki             | 10,036    | 2,002   | \u002F      |\n| QA                        | SIQA            | -                | 33,410    | 1,954   | \u002F      |\n| QA                        | CommonSenseQA   | -                | 9,741     | 1,221   | \u002F      |\n| QA                        | BoolQ           | wiki             | 9,427     | 3,270   | \u002F      |\n| QA                        | PIQA            | -                | 16,113    | 1,838   | \u002F      |\n| QA                        | Fermi           | wiki             | 8,000     | 1,000   | 1,000  |\n| multi-hop QA              | HotpotQA        | wiki             | 90,447    | 7,405   | \u002F      |\n| multi-hop QA              | 2WikiMultiHopQA | wiki             | 15,000    | 12,576  | \u002F      |\n| multi-hop QA              | Musique         | wiki             | 19,938    | 2,417   | \u002F      |\n| multi-hop QA              | Bamboogle       | wiki             | \u002F         | \u002F       | 125    |\n| multi-hop QA              | StrategyQA      | wiki             | 2290      | \u002F       | \u002F      |\n| Long-form QA              | ASQA            | wiki             | 4,353     | 948     | \u002F      |\n| Long-form QA              | ELI5            | Reddit           | 272,634   | 1,507   | \u002F      |\n| Long-form QA              | WikiPassageQA   | wiki             | 3,332     | 417     | 416    |\n| Open-Domain Summarization | WikiASP         | wiki             | 300,636   | 37,046  | 37,368 |\n| multiple-choice           | MMLU            | -                | 99,842    | 1,531   | 14,042 |\n| multiple-choice           | TruthfulQA      | wiki             | \u002F         | 817     | \u002F      |\n| multiple-choice           | HellaSWAG       | ActivityNet      | 39,905    | 10,042  | \u002F      |\n| multiple-choice           | ARC             | -                | 3,370     | 869     | 3,548  |\n| multiple-choice           | OpenBookQA      | -                | 4,957     | 500     | 500    |\n| multiple-choice           | QuaRTz          | -                | 2696      | 384     | 784    |\n| Fact Verification         | FEVER           | wiki             | 104,966   | 10,444  | \u002F      |\n| Dialog Generation         | WOW             | wiki             | 63,734    | 3,054   | \u002F      |\n| Entity Linking            | AIDA CoNll-yago | Freebase & wiki  | 18,395    | 4,784   | \u002F      |\n| Entity Linking            | WNED            | Wiki             | \u002F         | 8,995   | \u002F      |\n| Slot Filling              | T-REx           | DBPedia          | 2,284,168 | 5,000   | \u002F      |\n| Slot Filling              | Zero-shot RE    | wiki             | 147,909   | 3,724   | \u002F      |\n| In-domain QA              | DomainRAG       | Web pages of RUC | \u002F         | \u002F       | 485    |\n\n### Document Corpus\n\nOur toolkit supports jsonl format for retrieval document collections, with the following structure:\n\n```jsonl\n{\"id\":\"0\", \"contents\": \"...\"}\n{\"id\":\"1\", \"contents\": \"...\"}\n```\n\nThe `contents` key is essential for building the index. For documents that include both text and title, we recommend setting the value of `contents` to `{title}\\n{text}`. The corpus file can also contain other keys to record additional characteristics of the documents.\n\nIn the academic research, Wikipedia and MS MARCO are the most commonly used retrieval document collections. For Wikipedia, we provide a [\u003Cu>comprehensive script\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fprocess-wiki.md) to process any Wikipedia dump into a clean corpus. Additionally, various processed versions of the Wikipedia corpus are available in many works, and we have listed some reference links.\n\nFor MS MARCO, it is already processed upon release and can be directly downloaded from its [\u003Cu>hosting link\u003C\u002Fu>](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FTevatron\u002Fmsmarco-passage-corpus) on Hugging Face.\n\n### Index\n\nTo facilitate easier replication of the experiments, we now provide a preprocessed index available in the ModelScope dataset page: [FlashRAG_Dataset\u002Fretrieval_corpus\u002Fwiki18_100w_e5_index.zip](https:\u002F\u002Fwww.modelscope.cn\u002Fdatasets\u002Fhhjinjiajie\u002FFlashRAG_Dataset\u002Ffile\u002Fview\u002Fmaster?id=47985&status=2&fileName=retrieval_corpus%252Fwiki18_100w_e5_index.zip).\n\nThe index was created using the e5-base-v2 retriever on our uploaded wiki18_100w dataset, which is consistent with the index used in our experiments.\n\n## :lollipop: Awesome Work using FlashRAG\n\n- [R1-Searcher](https:\u002F\u002Fgithub.com\u002FSsmallSong\u002FR1-Searcher), a method that incentivizes the search capability in LLMs via reinforcement learning\n- [ReSearch](https:\u002F\u002Fgithub.com\u002FAgent-RL\u002FReSearch), a method that learns to reason with search for LLMs via reinforcement learning\n- [AutoCoA](https:\u002F\u002Fgithub.com\u002FADaM-BJTU\u002FAutoCoA), a method that internalizes chain-of-action generation into reasoning models\n\n## :raised_hands: Additional FAQs\n\n- [How should I set different experimental parameters?](.\u002Fdocs\u002Foriginal_docs\u002Fconfiguration.md)\n- [How to build my own corpus, such as a specific segmented Wikipedia?](.\u002Fdocs\u002Foriginal_docs\u002Fprocess-wiki.md)\n- [How to index my own corpus?](.\u002Fdocs\u002Foriginal_docs\u002Fbuilding-index.md)\n- [How to reproduce supporting methods?](.\u002Fdocs\u002Foriginal_docs\u002Freproduce_experiment.md)\n- [How can I debug common RAG failure modes when using FlashRAG?](.\u002Fdocs\u002Frag_failure_modes_and_debug_checklist.md)\n\n## :bookmark: License\n\nFlashRAG is licensed under the [\u003Cu>MIT License\u003C\u002Fu>](.\u002FLICENSE).\n\n## :star2: Citation\n\nPlease kindly cite our paper if helps your research:\n\n```BibTex\n@inproceedings{FlashRAG,\n  author       = {Jiajie Jin and\n                  Yutao Zhu and\n                  Zhicheng Dou and\n                  Guanting Dong and\n                  Xinyu Yang and\n                  Chenghao Zhang and\n                  Tong Zhao and\n                  Zhao Yang and\n                  Ji{-}Rong Wen},\n  editor       = {Guodong Long and\n                  Michale Blumestein and\n                  Yi Chang and\n                  Liane Lewin{-}Eytan and\n                  Zi Helen Huang and\n                  Elad Yom{-}Tov},\n  title        = {FlashRAG: {A} Modular Toolkit for Efficient Retrieval-Augmented Generation\n                  Research},\n  booktitle    = {Companion Proceedings of the {ACM} on Web Conference 2025, {WWW} 2025,\n                  Sydney, NSW, Australia, 28 April 2025 - 2 May 2025},\n  pages        = {737--740},\n  publisher    = {{ACM}},\n  year         = {2025},\n  url          = {https:\u002F\u002Fdoi.org\u002F10.1145\u002F3701716.3715313},\n  doi          = {10.1145\u002F3701716.3715313}\n}\n```\n\n\n## Star History\n\n[![Star History Chart](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_d3d9f62dd6a9.png)](https:\u002F\u002Fstar-history.com\u002F#RUC-NLPIR\u002FFlashRAG&Date)\n","# \u003Cdiv align=\"center\">⚡FlashRAG：高效的RAG研究Python工具包\u003Cdiv>\n\\[ 英文 | [中文](README_zh.md) \\]\n\u003Cdiv align=\"center\">\n\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.13576\" target=\"_blank\">\u003Cimg src=https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-b5212f.svg?logo=arxiv>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FRUC-NLPIR\u002FFlashRAG_datasets\u002F\" target=\"_blank\">\u003Cimg src=https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97%20HuggingFace%20Datasets-27b3b4.svg>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.modelscope.cn\u002Fdatasets\u002Fhhjinjiajie\u002FFlashRAG_Dataset\" target=\"_blank\">\u003Cimg src=https:\u002F\u002Fcustom-icon-badges.demolab.com\u002Fbadge\u002FModelScope%20Datasets-624aff?style=flat&logo=modelscope&logoColor=white>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdeepwiki.com\u002FRUC-NLPIR\u002FFlashRAG\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_1a081b2fa577.png\" alt=\"DeepWiki Document\" height=\"20\"\u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg alt=\"License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLICENSE-MIT-green\">\u003C\u002Fa>\n\u003Ca>\u003Cimg alt=\"Static Badge\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fmade_with-Python-blue\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Ch4 align=\"center\">\n\n\u003Cp>\n\u003Ca href=\"#wrench-installation\">安装\u003C\u002Fa> |\n\u003Ca href=\"#sparkles-features\">特性\u003C\u002Fa> |\n\u003Ca href=\"#rocket-quick-start\">快速入门\u003C\u002Fa> |\n\u003Ca href=\"#gear-components\">组件\u003C\u002Fa> |\n\u003Ca href=\"#art-flashrag-ui\">FlashRAG-UI\u003C\u002Fa> |\n\u003Ca href=\"#robot-supporting-methods\">支持方法\u003C\u002Fa> |\n\u003Ca href=\"#notebook-supporting-datasets--document-corpus\">支持数据集与文档语料库\u003C\u002Fa> |\n\u003Ca href=\"#raised_hands-additional-faqs\">常见问题解答\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003C\u002Fh4>\n\n\nFlashRAG是一个用于复现和开发检索增强生成（RAG）研究的Python工具包。我们的工具包包含36个预处理过的基准RAG数据集和**23种最先进的RAG算法**，其中包括**7种结合推理能力与检索的推理型方法**。\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_a5b3f114cfae.jpg\">\n\u003C\u002Fp>\n\n借助FlashRAG及提供的资源，您可以轻松复现RAG领域的现有SOTA成果，或实现您自定义的RAG流程和组件。此外，我们还提供了一个易于使用的UI：\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F8ca00873-5df2-48a7-b853-89e7b18bc6e9\n\n\u003Cp>\n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F10454\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_1145cd82417e.png\" alt=\"RUC-NLPIR%2FFlashRAG | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n## :link: 导航\n- [特性](#sparkles-features)\n- [路线图](#mag_right-roadmap)\n- [更新日志](#page_with_curl-changelog)\n- [安装](#wrench-installation)\n- [快速入门](#rocket-quick-start)\n- [组件](#gear-components)\n- [FlashRAG-UI](#art-flashrag-ui)\n- [支持方法](#robot-supporting-methods)\n- [支持数据集与文档语料库](#notebook-supporting-datasets--document-corpus)\n- [附加FAQ](#raised_hands-additional-faqs)\n- [许可证](#bookmark-license)\n- [引用](#star2-citation)\n\n## :sparkles: 特性\n\n- **广泛且可定制的框架**：包含RAG场景中的核心组件，如检索器、重排序器、生成器和压缩器，允许灵活地组装复杂的流水线。\n\n- **全面的基准数据集**：汇集了36个预处理过的RAG基准数据集，用于测试和验证RAG模型的性能。\n\n- **预实现的先进RAG算法**：基于我们的框架，提供了**23种具有已发表结果的前沿RAG算法**，可在不同设置下轻松复现实验结果。\n\n- **🚀 推理型方法**：**新增！** 我们现在支持**7种结合推理能力与检索的推理型方法**，在复杂的多跳任务中表现出色。\n\n- **高效的预处理阶段**：通过提供多种脚本，如用于检索的语料处理、检索索引构建以及文档的预检索等，简化了RAG工作流的准备工作。\n\n- **优化的执行效率**：该库通过vLLM、FastChat等工具加速LLM推理，并利用Faiss进行向量索引管理，从而提升了整体效率。\n\n- **易用的UI**：我们开发了一个非常易用的界面，方便用户快速配置和体验我们实现的RAG基线模型，并在可视化界面上运行评估脚本。\n\n## :mag_right: 路线图\n\nFlashRAG目前仍在开发中，仍有许多待改进之处。我们将持续更新，并诚挚欢迎各位对这一开源工具包的贡献。\n\n- [x] 支持OpenAI模型\n- [x] 提供各组件的使用说明\n- [x] 集成Sentence Transformers\n- [x] 支持多模态RAG\n- [x] 支持推理型方法\n- [ ] 包含更多RAG方法\n- [ ] 提升代码的适应性和可读性\n- [ ] 增加对基于API的检索器（vllm服务器）的支持\n\n## :page_with_curl: 更改日志\n[25\u002F11\u002F06] 🎯 新增检索器！我们集成了一款基于网络搜索引擎的检索器，它可以与现有方法无缝衔接，只需一个 Serper API 密钥即可快速启用。这一增强显著扩展了检索覆盖范围和实时性，支持动态信息获取和外部知识增强。立即体验更加灵活强大的检索工作流吧！\n\n[25\u002F08\u002F06] 🎯 **新增！** 我们新增了对**推理流水线**的支持，这是一种结合推理能力和检索的新范式，相关工作包括 [R1-Searcher](https:\u002F\u002Fgithub.com\u002FSsmallSong\u002FR1-Searcher)、[Search-R1](https:\u002F\u002Fgithub.com\u002FPeterGriffinJin\u002FSearch-R1) 等等。我们在多种 RAG 基准上评估了该流水线的性能，在 HotpotQA 等多跳推理数据集上可达到接近 60 的 F1 分数。详情请参见[**结果表**](#robot-supporting-methods)。\n\n[25\u002F03\u002F21] 🚀 **重大更新！** 我们已将工具包扩展至支持**23种最先进的RAG算法**，其中包括**7种基于推理的方法**，这些方法在复杂推理任务上的表现显著提升。这标志着我们的工具包发展迈出了重要一步！\n\n[25\u002F02\u002F24] 🔥🔥🔥 我们新增了对**多模态RAG**的支持，包括[**如Llava、Qwen、InternVL等MLLM**](https:\u002F\u002Fruc-nlpir.github.io\u002FFlashRAG\u002F#\u002Fzh-cn\u002Fcomponent\u002Fgenerator?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e7%94%9f%e6%88%90%e5%99%a8)，以及各种[**基于Clip架构的多模态检索器**](https:\u002F\u002Fruc-nlpir.github.io\u002FFlashRAG\u002F#\u002Fzh-cn\u002Fcomponent\u002Fretriever?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e6%a3%80%e7%b4%a2%e5%99%a8)。更多信息请参阅我们最新版本的arXiv论文及文档。快来试试吧！\n\n[25\u002F01\u002F21] 我们的科技论文《FlashRAG：用于高效RAG研究的Python工具包》(https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.13576)荣幸地被2025年**ACM万维网大会（WWW 2025）**资源赛道录用。欢迎查阅！\n\n[25\u002F01\u002F12] 推出\u003C强>FlashRAG-UI\u003C\u002F强>，一个易于使用的界面。您可以轻松快速地配置并体验支持的RAG方法，并在基准测试上进行评估。\n\n[25\u002F01\u002F11] 我们新增了对一种新方法[\u003Cu>RQRAG\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2404.00610)的支持，详情请参见[**复现实验**](docs\u002Foriginal_docs\u002Freproduce_experiment.md)。\n\n[25\u002F01\u002F07] 目前我们已支持多检索器的聚合功能，详情请参见[**多检索器使用说明**](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fblob\u002Fmain\u002Fdocs\u002Foriginal_docs\u002Fmulti_retriever_usage.md)。\n\n[25\u002F01\u002F07] 我们集成了一款非常灵活轻量的语料分块库[**Chunkie**](https:\u002F\u002Fgithub.com\u002Fchonkie-ai\u002Fchonkie?tab=readme-ov-file#usage)，它支持多种自定义分块方式（按token、句子、语义等）。可在[\u003Cu>文档语料分块\u003C\u002Fu>](docs\u002Foriginal_docs\u002Fchunk-doc-corpus.md)中使用。\n\n[24\u002F10\u002F21] 我们发布了一个基于Paddle框架的版本，支持中文硬件平台。详情请参阅[FlashRAG Paddle](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG-Paddle)。\n\n[24\u002F10\u002F13] 数据集方面新增了一个域内数据集和语料——[DomainRAG](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2406.05654)。该数据集基于中国人民大学的内部招生数据，涵盖七类任务，可用于开展特定领域的RAG测试。\n\n[24\u002F09\u002F24] 我们发布了一个基于MindSpore框架的版本，支持中文硬件平台。详情请参阅[FlashRAG MindSpore](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG-MindSpore)。\n\n\u003Cdetails>\n\u003Csummary>展开更多\u003C\u002Fsummary>\n\n[24\u002F09\u002F18] 由于在某些环境中安装Pyserini较为复杂且存在限制，我们推出了一款轻量级的`BM25s`包作为替代方案（速度更快、使用更便捷）。未来版本中基于Pyserini的检索器将被弃用。若要使用`bm25s`检索器，只需在配置中将`bm25_backend`设置为`bm25s`即可。\n\n[24\u002F09\u002F09] 我们新增了对一种新方法[\u003Cu>Adaptive-RAG\u003C\u002Fu>](https:\u002F\u002Faclanthology.org\u002F2024.naacl-long.389.pdf)的支持，该方法可根据查询类型自动选择执行的RAG流程。结果请参见[\u003Cu>结果表\u003C\u002Fu>](#robot-supporting-methods)。\n\n[24\u002F08\u002F02] 我们新增了对一种新方法[\u003Cu>Spring\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.19670)的支持，仅通过添加少量token嵌入即可显著提升LLM性能。结果请参见[\u003Cu>结果表\u003C\u002Fu>](#robot-supporting-methods)。\n\n[24\u002F07\u002F17] 由于HuggingFace出现了一些未知问题，我们原有的数据集链接已失效。现已更新。如有问题，请查看[新链接](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FRUC-NLPIR\u002FFlashRAG_datasets\u002F)。\n\n[24\u002F07\u002F06] 我们新增了对一种新方法的支持：[\u003Cu>Trace\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.11460)，该方法通过构建知识图谱来精炼文本。结果请参见[\u003Cu>结果\u003C\u002Fu>](#robot-supporting-methods)和[\u003Cu>详细信息\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbaseline_details.md)。\n\n[24\u002F06\u002F19] 我们新增了对一种新方法的支持：[\u003Cu>IRCoT\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2212.10509)，并更新了[\u003Cu>结果表\u003C\u002Fu>](#robot-supporting-methods)。\n\n[24\u002F06\u002F15] 我们提供了一个[\u003Cu>示例\u003C\u002Fu>](.\u002Fexamples\u002Fquick_start\u002Fdemo_en.py)，演示如何使用我们的工具包完成RAG流程。\n\n[24\u002F06\u002F11] 我们在检索模块中集成了`sentence transformers`，现在无需设置池化方法即可更方便地使用检索器。\n\n[24\u002F06\u002F05] 我们提供了详细的文档，用于复现现有方法（详见[如何复现](.\u002Fdocs\u002Foriginal_docs\u002Freproduce_experiment.md)、[基线详情](.\u002Fdocs\u002Foriginal_docs\u002Fbaseline_details.md)），以及[\u003Cu>配置设置\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fconfiguration.md)。\n\n[24\u002F06\u002F02] 我们为初学者提供了FlashRAG的入门介绍，详情请参见[\u003Cu>FlashRAG入门\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fintroduction_for_beginners_en.md)（[\u003Cu>中文版\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fintroduction_for_beginners_zh.md)、[\u003Cu>韩语版\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fintroduction_for_beginners_kr.md)）。\n\n[24\u002F05\u002F31] 我们增加了对OpenAI系列模型作为生成器的支持。\n\n\u003C\u002Fdetails>\n\n## :wrench: 安装\n![PyPI - 版本](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fflashrag-dev) \n![PyPI - 下载量](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdw\u002Fflashrag-dev) \n![PyPI - 下载量](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002Fflashrag-dev)\n\n要开始使用FlashRAG，您只需通过pip安装即可：\n\n```base\npip install flashrag-dev --pre\n```\n\n或者您可以从Github克隆并安装（需Python 3.10及以上版本）：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG.git\ncd FlashRAG\npip install -e .\n```\n\n如果您希望使用vllm、sentence-transformers或pyserini，可以安装可选依赖项：\n\n```bash\n# 安装所有额外依赖\npip install flashrag-dev[full]\n\n# 安装vllm以提高速度\npip install vllm>=0.4.1\n\n# 安装sentence-transformers\npip install sentence-transformers\n\n# 安装 pyserini 用于 BM25\npip install pyserini\n```\n\n由于使用 `pip` 安装 `faiss` 时存在兼容性问题，因此需要使用以下 `conda` 命令进行安装。\n\n```bash\n# 仅 CPU 版本\nconda install -c pytorch faiss-cpu=1.8.0\n\n# GPU(+CPU) 版本\nconda install -c pytorch -c nvidia faiss-gpu=1.8.0\n```\n\n注意：在某些系统上无法安装最新版本的 `faiss`。\n\n根据 Faiss 官方仓库（[来源](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Ffaiss\u002Fblob\u002Fmain\u002FINSTALL.md)）：\n\n> - 仅 CPU 的 `faiss-cpu` conda 包目前适用于 Linux（x86_64 和 arm64）、OSX（仅 arm64）以及 Windows（x86_64）\n> - 包含 CPU 和 GPU 索引的 `faiss-gpu` 则仅适用于运行 CUDA 11.4 和 12.1 的 Linux（x86_64）\n\n## :rocket: 快速入门\n\n### 语料库构建\n要构建索引，首先需要将你的语料库保存为 `jsonl` 文件，每行代表一个文档。\n\n```jsonl\n{\"id\": \"0\", \"contents\": \"...\"}\n{\"id\": \"1\", \"contents\": \"...\"}\n```\n\n如果你想使用维基百科作为语料库，可以参考我们的文档 [处理维基百科](.\u002Fdocs\u002Foriginal_docs\u002Fprocess-wiki.md)，将其转换为可索引的格式。\n\n### 索引构建\n\n你可以使用以下代码来构建自己的索引。\n\n* 对于 **密集检索方法**，尤其是流行的嵌入模型，我们使用 `faiss` 来构建索引。\n\n* 对于 **稀疏检索方法（BM25）**，我们使用 `Pyserini` 或 `bm25s` 将语料库构建为 Lucene 倒排索引。构建的索引包含原始文档。\n\n#### 密集检索方法\n\n请根据自身情况修改以下代码中的参数。\n\n```bash\npython -m flashrag.retriever.index_builder \\\n  --retrieval_method e5 \\\n  --model_path \u002Fmodel\u002Fe5-base-v2\u002F \\\n  --corpus_path indexes\u002Fsample_corpus.jsonl \\\n  --save_dir indexes\u002F \\\n  --use_fp16 \\\n  --max_length 512 \\\n  --batch_size 256 \\\n  --pooling_method mean \\\n  --faiss_type Flat \n```\n\n* ```--pooling_method```：如果未指定此参数，我们将根据模型名称和模型文件自动选择。然而，不同的嵌入模型使用不同的池化方法，**我们可能尚未完全实现所有方法**。为了确保准确性，你可以**指定与所用检索模型相对应的池化方法**（`mean`、`pooler` 或 `cls`）。\n\n* ```---instruction```：某些嵌入模型在编码查询之前需要附加额外的指令，这些指令可以在这里指定。目前，我们会自动为 **E5** 和 **BGE** 模型填写指令，而其他模型则需要手动补充。\n\n如果检索模型支持 `sentence transformers` 库，你可以使用以下代码构建索引（**无需考虑池化方法**）。\n\n```bash\npython -m flashrag.retriever.index_builder \\\n  --retrieval_method e5 \\\n  --model_path \u002Fmodel\u002Fe5-base-v2\u002F \\\n  --corpus_path indexes\u002Fsample_corpus.jsonl \\\n  --save_dir indexes\u002F \\\n  --use_fp16 \\\n  --max_length 512 \\\n  --batch_size 256 \\\n  --pooling_method mean \\\n  --sentence_transformer \\\n  --faiss_type Flat \n```\n\n#### 稀疏检索方法（BM25）\n\n如果要构建 BM25 索引，则无需指定 `model_path`。\n\n##### 使用 BM25s 构建索引\n\n```bash\npython -m flashrag.retriever.index_builder \\\n  --retrieval_method bm25 \\\n  --corpus_path indexes\u002Fsample_corpus.jsonl \\\n  --bm25_backend bm25s \\\n  --save_dir indexes\u002F \n```\n\n##### 使用 Pyserini 构建索引\n\n```bash\npython -m flashrag.retriever.index_builder \\\n  --retrieval_method bm25 \\\n  --corpus_path indexes\u002Fsample_corpus.jsonl \\\n  --bm25_backend pyserini \\\n  --save_dir indexes\u002F \n```\n\n### 稀疏神经检索方法（SPLADE）\n\n##### 安装 Seismic Index：\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh # 安装 Rust 用于编译\npip install pyseismic-lsr # 安装 Seismic\n```\n\n##### 然后使用 Seismic 构建索引：\n```bash\npython -m flashrag.retriever.index_builder \\ # 构建器\n        --retrieval_method splade \\ # 触发 Seismic 索引的模型名称（仅 SPLADE 可用）\n        --model_path retriever\u002Fsplade-v3 \\ # 支持本地路径或仓库路径。\n        --corpus_embedded_path data\u002Fms_marco\u002Fms_marco_embedded_corpus.jsonl \\  # 如果语料库已按 Seismic 预期格式缓存嵌入，则使用该缓存\n        --corpus_path data\u002Fms_marco\u002Fms_marco_corpus.jsonl \\ # 以 {id, contents} 格式的 jsonl 文件形式提供的语料库路径，若尚未构建则需嵌入\n        --save_dir indexes\u002F \\ # 保存索引的目录\n        --use_fp16 \\ # 告诉 SPLADE 模型使用 fp16\n        --max_length 512 \\ # 每个文档的最大标记数\n        --batch_size 4 \\ # SPLADE 模型的批次大小（对于 Tesla T4 16GB 显卡，4-5 似乎是最优尺寸）\n        --n_postings 1000 \\ # Seismic 的帖子列表数量\n        --centroid_fraction 0.2 \\ # Seismic 的质心比例\n        --min_cluster_size 2 \\ # Seismic 的最小聚类规模\n        --summary_energy 0.4 \\ # Seismic 的能量\n        --batched_indexing 10000000 # Seismic 的批量索引\n        --nknn 32 # 可选参数。告诉 Seismic 同时使用 knn 图。如果不提供此参数，Seismic 将不使用 knn 图工作\n```\n### 使用现成的流水线\n\n你可以使用我们已经构建好的流水线类（如 [\u003Cu>流水线\u003C\u002Fu>](#pipelines) 所示）来实现 RAG 流程。在这种情况下，你只需配置相应的设置并加载对应的流水线即可。\n\n首先，加载整个流程的配置文件，其中记录了 RAG 流程中所需的各种超参数。你可以将 YAML 文件作为参数输入，也可以直接以变量形式输入。\n\n请注意，**以变量形式输入的优先级高于文件**。\n\n```python\nfrom flashrag.config import Config\n\n# 混合加载配置\nconfig_dict = {'data_dir': 'dataset\u002F'}\nmy_config = Config(\n    config_file_path = 'my_config.yaml',\n    config_dict = config_dict\n```\n\n我们提供了详尽的配置指南，您可以查看我们的[\u003Cu>配置指南\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fconfiguration.md)。\n您也可以参考我们提供的[\u003Cu>基础 YAML 文件\u003C\u002Fu>](.\u002Fflashrag\u002Fconfig\u002Fbasic_config.yaml)，以设置您自己的参数。\n\n接下来，加载相应的数据集并初始化流水线。流水线中的各个组件将被自动加载。\n\n```python\nfrom flashrag.utils import get_dataset\nfrom flashrag.pipeline import SequentialPipeline\nfrom flashrag.prompt import PromptTemplate\nfrom flashrag.config import Config\n\nconfig_dict = {'data_dir': 'dataset\u002F'}\nmy_config = Config(\n    config_file_path = 'my_config.yaml',\n    config_dict = config_dict\n)\nall_split = get_dataset(my_config)\ntest_data = all_split['test']\n\npipeline = SequentialPipeline(my_config)\n```\n\n您可以使用 `PromptTemplete` 指定您自己的输入提示：\n\n```python\nprompt_templete = PromptTemplate(\n    config,\n    system_prompt = \"请根据给定的文档回答问题。只给出答案，不要输出任何其他文字。\\n以下是给定的文档。\\n\\n{reference}\",\n    user_prompt = \"问题: {question}\\n答案:\"\n)\npipeline = SequentialPipeline(\n  my_config,\n  prompt_template = prompt_templete\n)\n```\n\n最后，执行 `pipeline.run` 以获得最终结果。\n\n```python\noutput_dataset = pipeline.run(test_data, do_eval=True)\n```\n\n`output_dataset` 包含输入数据集中每条记录的中间结果和指标分数。\n同时，如果指定了 `save_intermediate_data` 和 `save_metric_score`，包含中间结果和总体评估分数的数据集也会被保存为文件。\n\n### 构建您自己的流水线！\n\n有时您可能需要实现更复杂的 RAG 流程，这时可以构建自己的流水线来完成。\n您只需继承 `BasicPipeline`，初始化所需的组件，并完成 `run` 函数。\n\n```python\nfrom flashrag.pipeline import BasicPipeline\nfrom flashrag.utils import get_retriever, get_generator\n\nclass ToyPipeline(BasicPipeline):\n  def __init__(self, config, prompt_templete=None):\n    # 加载您自己的组件\n    pass\n\n  def run(self, dataset, do_eval=True):\n    # 完成您自己的流程逻辑\n\n    # 使用 `.` 获取数据集中属性\n    input_query = dataset.question\n    ...\n    # 使用 `update_output` 保存中间数据\n    dataset.update_output(\"pred\",pred_answer_list)\n    dataset = self.evaluate(dataset, do_eval=do_eval)\n    return dataset\n```\n\n请先从我们的[\u003Cu>文档\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbasic_usage.md)中了解您需要使用的组件的输入和输出格式。\n\n### 直接使用组件\n\n如果您已经有自己的代码，只想使用我们的组件来嵌入原有代码，可以参考[\u003Cu>组件基础介绍\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbasic_usage.md)，以获取每个组件的输入和输出格式。\n\n## :gear: 组件\n\n在 FlashRAG 中，我们构建了一系列常用的 RAG 组件，包括检索器、生成器、精炼器等。基于这些组件，我们组装了多条流水线来实现 RAG 工作流，同时也提供了灵活的组合方式，允许用户自定义组件排列以创建自己的流水线。\n\n#### RAG 组件\n\n\u003Ctable>\n  \u003Cthead>\n    \u003Ctr>\n      \u003Cth>类型\u003C\u002Fth>\n      \u003Cth>模块\u003C\u002Fth>\n      \u003Cth>描述\u003C\u002Fth>\n    \u003C\u002Ftr>\n  \u003C\u002Fthead>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd rowspan=\"1\">判断器\u003C\u002Ftd>\n      \u003Ctd>SKR 判断器\u003C\u002Ftd>\n      \u003Ctd>使用 \u003Ca href=\"https:\u002F\u002Faclanthology.org\u002F2023.findings-emnlp.691.pdf\">SKR\u003C\u002Fa> 方法判断是否进行检索\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd rowspan=\"4\">检索器\u003C\u002Ftd>\n      \u003Ctd>密集检索器\u003C\u002Ftd>\n      \u003Ctd>使用 bi-encoder 模型如 dpr、bge、e5，并通过 faiss 进行搜索\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>BM25 检索器\u003C\u002Ftd>\n      \u003Ctd>基于 Lucene 的稀疏检索方法\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>双编码器重排序器\u003C\u002Ftd>\n      \u003Ctd>使用双编码器计算匹配分数\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>交叉编码器重排序器\u003C\u002Ftd>\n      \u003Ctd>使用交叉编码器计算匹配分数\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd rowspan=\"5\">精炼器\u003C\u002Ftd>\n      \u003Ctd>抽取式精炼器\u003C\u002Ftd>\n      \u003Ctd>通过抽取重要上下文对输入进行精炼\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>摘要式精炼器\u003C\u002Ftd>\n      \u003Ctd>通过 seq2seq 模型对输入进行精炼\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>LLMLingua 精炼器\u003C\u002Ftd>\n      \u003Ctd>\u003Ca href=\"https:\u002F\u002Faclanthology.org\u002F2023.emnlp-main.825\u002F\">LLMLingua 系列\u003C\u002Fa> 提示压缩器\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>SelectiveContext 精炼器\u003C\u002Ftd>\n      \u003Ctd>\u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.06201\">Selective-Context\u003C\u002Fa> 提示压缩器\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>KG 精炼器\u003C\u002Ftd>\n      \u003Ctd>使用 \u003Ca hred='https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.11460'>Trace 方法构建知识图谱\u003C\u002Ftd>\n    \u003Ctr>\n      \u003Ctd rowspan=\"4\">生成器\u003C\u002Ftd>\n      \u003Ctd>编码器-解码器生成器\u003C\u002Ftd>\n      \u003Ctd>编码器-解码器模型，支持 \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2007.01282\">解码器内融合 (FiD)\u003C\u002Fa>\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>仅解码器生成器\u003C\u002Ftd>\n      \u003Ctd>原生 transformer 实现\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>FastChat 生成器\u003C\u002Ftd>\n      \u003Ctd>通过 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Flm-sys\u002FFastChat\">FastChat\u003C\u002Fa> 加速\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>vllm 生成器\u003C\u002Ftd>\n      \u003Ctd>通过 \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fvllm-project\u002Fvllm\">vllm\u003C\u002Fa> 加速\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n#### 流水线\n\n参考 [\u003Cu>关于检索增强生成的综述\u003C\u002Fu>](https:\u002F\u002Farxiv.org\u002Fabs\u002F2312.10997)，我们根据推理路径将 RAG 方法分为四类：\n\n- **顺序型**：按顺序执行 RAG 流程，例如查询-(预检索)-检索器-(后检索)-生成器\n- **条件型**：针对不同类型的输入查询执行不同的路径\n- **分支型**：并行执行多个路径，并合并各路径的响应\n- **循环型**：迭代地进行检索和生成\n\n在每一类中，我们都实现了相应的常用流水线。部分流水线还配有相关的研究论文。\n\n\u003Ctable>\n    \u003Cthead>\n        \u003Ctr>\n            \u003Cth>类型\u003C\u002Fth>\n            \u003Cth>模块\u003C\u002Fth>\n            \u003Cth>描述\u003C\u002Fth>\n        \u003C\u002Ftr>\n    \u003C\u002Fthead>\n    \u003Ctbody>\n        \u003Ctr>\n            \u003Ctd rowspan=\"1\">顺序型\u003C\u002Ftd>\n            \u003Ctd>顺序流水线\u003C\u002Ftd>\n            \u003Ctd>线性执行查询，支持精炼器、重排序器\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd rowspan=\"1\">条件型\u003C\u002Ftd>\n            \u003Ctd>条件流水线\u003C\u002Ftd>\n            \u003Ctd>配备判断器模块，针对不同类型的查询采用不同的执行路径\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd rowspan=\"2\">分支型\u003C\u002Ftd>\n            \u003Ctd>REPLUG 流水线\u003C\u002Ftd>\n            \u003Ctd>通过整合多条生成路径的概率来生成答案\u003C\u002Ftd>\n        \u003C\u002Ftr>\n          \u003Ctd>SuRe 流水线\u003C\u002Ftd>\n          \u003Ctd>根据每篇文档对生成结果进行排名并合并\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd rowspan=\"6\">循环型\u003C\u002Ftd>\n            \u003Ctd>迭代流水线\u003C\u002Ftd>\n            \u003Ctd>交替进行检索和生成\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Self-Ask 流水线\u003C\u002Ftd>\n            \u003Ctd>利用 \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2210.03350\">self-ask\u003C\u002Fa> 将复杂问题分解为子问题\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>Self-RAG 流水线\u003C\u002Ftd>\n            \u003Ctd>自适应的检索、批判与生成\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>FLARE 流水线\u003C\u002Ftd>\n            \u003Ctd>在生成过程中动态进行检索\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>IRCoT 流水线\u003C\u002Ftd>\n            \u003Ctd>将检索过程与 CoT 结合\u003C\u002Ftd>\n        \u003C\u002Ftr>\n        \u003Ctr>\n            \u003Ctd>推理流水线\u003C\u002Ftd>\n            \u003Ctd>结合检索进行推理\u003C\u002Ftd>\n        \u003C\u002Ftr>\n    \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## :art: FlashRAG-UI\n\u003Cp>借助 \u003Cstrong>FlashRAG-UI\u003C\u002Fstrong>,您可以通过我们精心设计的可视化界面，轻松快速地配置并体验支持的 RAG 方法，并在基准测试上评估这些方法，从而让复杂的研究工作更加高效！\u003C\u002Fp>\n\n### :star2: 功能\n- **一键加载配置**\n  - 您可以通过简单的点击、选择和输入，加载各种 RAG 方法的参数和配置文件。\u003C\u002Fli>\n  - 支持预览界面，直观设置参数。\u003C\u002Fli>\n  - 提供保存功能，方便存储配置以备将来使用。\u003C\u002Fli>\n- **快速体验方法**\n  - 快速加载语料库和索引文件，探索各类 RAG 方法的特点及应用场景。\u003C\u002Fli>\n  - 支持加载和切换不同的组件与超参数，无缝连接不同的 RAG 流水线，快速体验它们的性能与差异！\u003C\u002Fli>\n- **高效复现基准**\n  - 在 FlashRAG-UI 上轻松复现内置的基线方法以及精心收集的基准数据集。\u003C\u002Fli>\n  - 直接使用前沿的研究工具，无需复杂的设置，为您的研究工作提供流畅的体验！\u003C\u002Fli>\n  \n\u003Cdetails>\n\u003Csummary>查看更多\u003C\u002Fsummary>\n\u003Ctable align=\"center\">\n  \u003Ctr>\n    \u003Ctd align=\"center\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_0a1930e6bb7c.jpg\" alt=\"Image 1\" width=\"505\"\u002F>\n    \u003C\u002Ftd>\n    \u003Ctd align=\"center\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_f1e70bb39adc.jpg\" alt=\"Image 2\" width=\"505\"\u002F>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd align=\"center\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_46a9fd9f4c8f.png\" alt=\"Image 3\" width=\"500\"\u002F>\n    \u003C\u002Ftd>\n    \u003Ctd align=\"center\">\n      \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_d09a05434c17.jpg\" alt=\"Image 4\" width=\"500\"\u002F>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fdetails>\n\n#### 体验我们精心设计的 FlashRAG-UI——既友好又美观：\n```bash\ncd webui\npython interface.py\n```\n\n## :robot: 支持的方法\n\n我们已实现了 **23 篇论文**，统一采用以下设置：\n\n- **生成器:** LLAMA3-8B-instruct，输入长度为2048\n- **检索器:** 使用e5-base-v2作为嵌入模型，每次查询检索5篇文档\n- **提示词:** 一致的默认提示词，模板可在[\u003Cu>方法详情\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbaseline_details.md)中找到。\n\n对于开源方法，我们使用我们的框架实现了它们的流程。对于作者未提供源代码的方法，我们会尽力按照原始论文中的方法进行实现。\n\n对于某些方法所需的特定设置和超参数，我们已在“特定设置”列中进行了记录。更多详细信息，请参阅我们的[\u003Cu>复现指南\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Freproduce_experiment.md)和[\u003Cu>方法详情\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fbaseline_details.md)。\n\n需要注意的是，为了保证一致性，我们采用了统一的设置。然而，这一设置可能与方法的原始设置有所不同，从而导致结果与原始结果存在差异。\n\n| 方法                                                                                    | 类型        | NQ (EM) | TriviaQA (EM) | Hotpotqa (F1) | 2Wiki (F1) | PopQA (F1) | WebQA(EM) | 特定设置                                |\n| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |\n| 简单生成                                                                          | 顺序式  | 22.6    | 55.7          | 28.4          | 33.9       | 21.7       | 18.8      |                                                 |\n| 标准RAG                                                                              | 顺序式  | 35.1    | 58.9          | 35.3          | 21.0       | 36.7       | 15.7      |                                                 |\n| [AAR-contriever-kilt](https:\u002F\u002Faclanthology.org\u002F2023.acl-long.136.pdf)                     | 顺序式  | 30.1    | 56.8          | 33.4          | 19.8       | 36.1       | 16.1      |                                                 |\n| [LongLLMLingua](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.06839)                                         | 顺序式  | 32.2    | 59.2          | 37.5          | 25.0       | 38.7       | 17.5      | 压缩比例=0.5                              |\n| [RECOMP-abstractive](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2310.04408)                                    | 顺序式  | 33.1    | 56.4          | 37.5          | 32.4       | 39.9       | 20.2      |                                                 |\n| [Selective-Context](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.06201)                                     | 顺序式  | 30.5    | 55.6          | 34.4          | 18.5       | 33.5       | 17.3      | 压缩比例=0.5                              |\n| [Trace](https:\u002F\u002Farxiv.org\u002Fabs\u002F2406.11460)                                                 | 顺序式  | 30.7    | 50.2          | 34.0          | 15.5       | 37.4       | 19.9      |                                                 |\n| [Spring](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.19670)                                                | 顺序式  | 37.9    | 64.6          | 42.6          | 37.3       | 54.8       | 27.7      | 使用经过训练的嵌入表的Llama2-7B-chat |\n| [SuRe](https:\u002F\u002Farxiv.org\u002Fabs\u002F2404.13081)                                                  | 分支式   | 37.1    | 53.2          | 33.4          | 20.6       | 48.1       | 24.2      | 使用提供的提示词                             |\n| [REPLUG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.12652)                                                | 分支式   | 28.9    | 57.7          | 31.2          | 21.1       | 27.8       | 20.2      |                                                 |\n| [SKR](https:\u002F\u002Faclanthology.org\u002F2023.findings-emnlp.691.pdf)                               | 条件式 | 33.2    | 56.0          | 32.4          | 23.4       | 31.7       | 17.0      | 使用推理时的训练数据                        |\n| [Adaptive-RAG](https:\u002F\u002Faclanthology.org\u002F2024.naacl-long.389.pdf)                          | 条件式 | 35.1    | 56.6          | 39.1          | 28.4       | 40.4       | 16.0      |                                                 |\n| [Ret-Robust](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.01558)                                            | 循环式 | 42.9    | 68.2          | 35.8          | 43.4       | 57.2       | 33.7      | 使用经过训练的lora的LLAMA2-13B               |\n| [Self-RAG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.11511)                                              | 循环式 | 36.4    | 38.2          | 29.6          | 25.1       | 32.7       | 21.9      | 使用经过训练的selfrag-llama2-7B                   |\n| [FLARE](https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.06983)                                                 | 循环式 | 22.5    | 55.8          | 28.0          | 33.9       | 20.7       | 20.2      |                                                 |\n| [Iter-Retgen](https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.15294), [ITRG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2310.05149) | 循环式 | 36.8    | 60.1          | 38.3          | 21.6       | 37.9       | 18.2      |                                                 |\n| [IRCoT](https:\u002F\u002Faclanthology.org\u002F2023.acl-long.557.pdf)                                   | 循环式 | 33.3    | 56.9          | 41.5          | 32.4       | 45.6       | 20.7      |                                                 |\n| [RQRAG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2404.00610)                                   | 循环式 | 32.6    | 52.5          | 33.5          | 35.8       | 46.4       | 26.2      | 使用经过训练的rqrag-llama2-7B                                               | \n\n#### 🚀 基于推理的方法（新！）\n\n我们现在支持**7种基于推理的方法**，这些方法将推理能力与检索相结合，在复杂的多跳任务上表现出色：\n\n| 方法                                                                                    | 类型        | NQ (EM) | TriviaQA (EM) | PopQA (EM) | Hotpotqa (F1) | 2Wiki (F1) |  Musique (F1) | Bamboogle (F1) | 具体设置                             |\n| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |\n| [Search-R1](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.09516) | 理性推理 | 45.2 | 62.2 | 49.2 | 54.5 | 42.6 | 29.2 |  59.9 | SearchR1-nq_hotpotqa_train-qwen2.5-7b-em-ppo |\n| [R1-Searcher](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2503.05592) | 理性推理 | 36.9 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-2.5-7B-base-RAG-RL |\n| [O2-Searcher](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2505.16582) | 理性推理 | 41.4 | 51.4 | 46.8 | 43.4 | 48.6 | 19.0 | 47.6 | O2-Searcher-Qwen2.5-3B-GRPO |\n| [AutoRefine](https:\u002F\u002Fwww.arxiv.org\u002Fpdf\u002F2505.11277) | 理性推理 | 43.8 | 59.8 | 32.4 | 54.0 | 50.3 | 23.6 | 46.6 | AutoRefine-Qwen2.5-3B-Base |\n| [ReaRAG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.21729) | 理性推理 | 26.3 | 51.8 | 24.6 | 42.9 | 41.6 | 21.2 | 41.9 | ReaRAG-9B |\n| [CoRAG](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.21729) | 理性推理 | 40.9 | 63.1 | 36.0 | 56.6 | 60.7 | 31.9 | 54.1 | CoRAG-Llama3.1-8B-MultihopQA |\n| [SimpleDeepSearcher](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2505.16834) | 理性推理 | 36.1 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-7B-SimpleDeepSearcher |\n\n\n\n## :notebook: 支撑数据集与文档语料库\n\n### 数据集\n\n我们收集并处理了RAG研究中广泛使用的36个数据集，对它们进行了预处理以确保格式一致，便于使用。对于某些数据集（如Wiki-asp），我们根据社区内常用的方法对其进行了调整，使其符合RAG任务的要求。所有数据集均可在[\u003Cu>Huggingface 数据集\u003C\u002Fu>](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FRUC-NLPIR\u002FFlashRAG_datasets)上获取。\n\n对于每个数据集，我们将每个划分保存为一个`jsonl`文件，每行是一个如下所示的字典：\n\n```python\n{\n  'id': str,\n  'question': str,\n  'golden_answers': List[str],\n  'metadata': dict\n}\n```\n\n以下是数据集列表及其对应的样本量：\n\n| 任务                      | 数据集名称    | 知识来源 | 训练集数量   | 验证集数量   | 测试集数量 |\n| ------------------------- | --------------- | ---------------- | --------- | ------- | ------ |\n| QA                        | NQ              | wiki             | 79,168    | 8,757   | 3,610  |\n| QA                        | TriviaQA        | wiki & web       | 78,785    | 8,837   | 11,313 |\n| QA                        | PopQA           | wiki             | \u002F         | \u002F       | 14,267 |\n| QA                        | SQuAD           | wiki             | 87,599    | 10,570  | \u002F      |\n| QA                        | MSMARCO-QA      | web              | 808,731   | 101,093 | \u002F      |\n| QA                        | NarrativeQA     | books and story  | 32,747    | 3,461   | 10,557 |\n| QA                        | WikiQA          | wiki             | 20,360    | 2,733   | 6,165  |\n| QA                        | WebQuestions    | Google Freebase  | 3,778     | \u002F       | 2,032  |\n| QA                        | AmbigQA         | wiki             | 10,036    | 2,002   | \u002F      |\n| QA                        | SIQA            | -                | 33,410    | 1,954   | \u002F      |\n| QA                        | CommonSenseQA   | -                | 9,741     | 1,221   | \u002F      |\n| QA                        | BoolQ           | wiki             | 9,427     | 3,270   | \u002F      |\n| QA                        | PIQA            | -                | 16,113    | 1,838   | \u002F      |\n| QA                        | Fermi           | wiki             | 8,000     | 1,000   | 1,000  |\n| 多跳问答                  | HotpotQA        | wiki             | 90,447    | 7,405   | \u002F      |\n| 多跳问答                  | 2WikiMultiHopQA | wiki             | 15,000    | 12,576  | \u002F      |\n| 多跳问答                  | Musique         | wiki             | 19,938    | 2,417   | \u002F      |\n| 多跳问答                  | Bamboogle       | wiki             | \u002F         | \u002F       | 125    |\n| 多跳问答                  | StrategyQA      | wiki             | 2290      | \u002F       | \u002F      |\n| 长篇问答                  | ASQA            | wiki             | 4,353     | 948     | \u002F      |\n| 长篇问答                  | ELI5            | Reddit           | 272,634   | 1,507   | \u002F      |\n| 长篇问答                  | WikiPassageQA   | wiki             | 3,332     | 417     | 416    |\n| 开放域摘要生成            | WikiASP         | wiki             | 300,636   | 37,046  | 37,368 |\n| 多选题                    | MMLU            | -                | 99,842    | 1,531   | 14,042 |\n| 多选题                    | TruthfulQA      | wiki             | \u002F         | 817     | \u002F      |\n| 多选题                    | HellaSWAG       | ActivityNet      | 39,905    | 10,042  | \u002F      |\n| 多选题                    | ARC             | -                | 3,370     | 869     | 3,548  |\n| 多选题                    | OpenBookQA      | -                | 4,957     | 500     | 500    |\n| 多选题                    | QuaRTz          | -                | 2696      | 384     | 784    |\n| 事实核查                  | FEVER           | wiki             | 104,966   | 10,444  | \u002F      |\n| 对话生成                  | WOW             | wiki             | 63,734    | 3,054   | \u002F      |\n| 实体链接                  | AIDA CoNll-yago | Freebase & wiki  | 18,395    | 4,784   | \u002F      |\n| 实体链接                  | WNED            | Wiki             | \u002F         | 8,995   | \u002F      |\n| 填槽                      | T-REx           | DBPedia          | 2,284,168 | 5,000   | \u002F      |\n| 填槽                      | Zero-shot RE    | wiki             | 147,909   | 3,724   | \u002F      |\n| 固定领域问答              | DomainRAG       | RUC 的网页       | \u002F         | \u002F       | 485    |\n\n### 文档语料库\n\n我们的工具包支持使用 jsonl 格式来存储检索文档集合，其结构如下：\n\n```jsonl\n{\"id\":\"0\", \"contents\": \"...\"}\n{\"id\":\"1\", \"contents\": \"...\"}\n```\n\n`contents` 键是构建索引所必需的。对于同时包含文本和标题的文档，我们建议将 `contents` 的值设置为 `{title}\\n{text}`。语料文件还可以包含其他键，用于记录文档的额外特征。\n\n在学术研究中，维基百科和 MS MARCO 是最常用的检索文档集合。对于维基百科，我们提供了一个[\u003Cu>全面的脚本\u003C\u002Fu>](.\u002Fdocs\u002Foriginal_docs\u002Fprocess-wiki.md)，可以将任何维基百科转储文件处理成干净的语料库。此外，在许多研究工作中也提供了经过处理的维基百科语料库版本，我们列出了一些参考链接。\n\n至于 MS MARCO，它在发布时就已经被处理过了，可以直接从 Hugging Face 上的[\u003Cu>托管链接\u003C\u002Fu>](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FTevatron\u002Fmsmarco-passage-corpus)下载。\n\n### 索引\n\n为了便于实验的复现，我们现在在 ModelScope 数据集页面上提供了一个预处理好的索引：[FlashRAG_Dataset\u002Fretrieval_corpus\u002Fwiki18_100w_e5_index.zip](https:\u002F\u002Fwww.modelscope.cn\u002Fdatasets\u002Fhhjinjiajie\u002FFlashRAG_Dataset\u002Ffile\u002Fview\u002Fmaster?id=47985&status=2&fileName=retrieval_corpus%252Fwiki18_100w_e5_index.zip)。\n\n该索引是使用 e5-base-v2 检索器在我们上传的 wiki18_100w 数据集上创建的，与我们在实验中使用的索引一致。\n\n## :lollipop: 使用 FlashRAG 的优秀工作\n\n- [R1-Searcher](https:\u002F\u002Fgithub.com\u002FSsmallSong\u002FR1-Searcher)，一种通过强化学习激励大模型搜索能力的方法\n- [ReSearch](https:\u002F\u002Fgithub.com\u002FAgent-RL\u002FReSearch)，一种通过强化学习让大模型学会结合搜索进行推理的方法\n- [AutoCoA](https:\u002F\u002Fgithub.com\u002FADaM-BJTU\u002FAutoCoA)，一种将行动链生成内化到推理模型中的方法\n\n## :raised_hands: 其他常见问题解答\n\n- [如何设置不同的实验参数？](.\u002Fdocs\u002Foriginal_docs\u002Fconfiguration.md)\n- [如何构建自己的语料库，例如特定分段的维基百科？](.\u002Fdocs\u002Foriginal_docs\u002Fprocess-wiki.md)\n- [如何为自己的语料库建立索引？](.\u002Fdocs\u002Foriginal_docs\u002Fbuilding-index.md)\n- [如何复现支持性方法？](.\u002Fdocs\u002Foriginal_docs\u002Freproduce_experiment.md)\n- [在使用 FlashRAG 时，如何调试常见的 RAG 失败模式？](.\u002Fdocs\u002Frag_failure_modes_and_debug_checklist.md)\n\n## :bookmark: 许可证\n\nFlashRAG 采用 [\u003Cu>MIT 许可证\u003C\u002Fu>](.\u002FLICENSE) 许可。\n\n## :star2: 引用\n\n如果您觉得我们的论文对您的研究有所帮助，请引用：\n\n```BibTex\n@inproceedings{FlashRAG,\n  author       = {Jiajie Jin and\n                  Yutao Zhu and\n                  Zhicheng Dou and\n                  Guanting Dong and\n                  Xinyu Yang and\n                  Chenghao Zhang and\n                  Tong Zhao and\n                  Zhao Yang and\n                  Ji{-}Rong Wen},\n  editor       = {Guodong Long and\n                  Michale Blumestein and\n                  Yi Chang and\n                  Liane Lewin{-}Eytan and\n                  Zi Helen Huang and\n                  Elad Yom{-}Tov},\n  title        = {FlashRAG: {一个}用于高效检索增强生成研究的模块化工具包},\n  booktitle    = {2025 年 ACM 网络大会配套论文集，WWW 2025，澳大利亚新南威尔士州悉尼，2025 年 4 月 28 日至 5 月 2 日},\n  pages        = {737--740},\n  publisher    = {{ACM}},\n  year         = {2025},\n  url          = {https:\u002F\u002Fdoi.org\u002F10.1145\u002F3701716.3715313},\n  doi          = {10.1145\u002F3701716.3715313}\n}\n```\n\n\n## 星标历史\n\n[![星标历史图表](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_readme_d3d9f62dd6a9.png)](https:\u002F\u002Fstar-history.com\u002F#RUC-NLPIR\u002FFlashRAG&Date)","# FlashRAG 快速上手指南\n\nFlashRAG 是一个用于检索增强生成（RAG）研究与复现的高效 Python 工具包。它内置了 36 个预处理基准数据集和 23 种前沿 RAG 算法（含 7 种基于推理的方法），支持灵活组装检索、重排序、生成等组件，并提供易用的可视化界面（FlashRAG-UI）。\n\n## 环境准备\n\n- **操作系统**：Linux \u002F macOS \u002F Windows\n- **Python 版本**：3.10 或更高\n- **推荐包管理器**：`pip` 或 `conda`\n- **可选加速依赖**：\n  - `vllm`：加速大模型推理\n  - `sentence-transformers`：简化嵌入模型使用\n  - `faiss-cpu` 或 `faiss-gpu`：向量索引管理（需通过 conda 安装）\n  - `pyserini` 或 `bm25s`：BM25 检索后端（推荐 `bm25s`，更轻量）\n\n> 💡 国内用户可使用清华、阿里等镜像源加速 pip 安装：\n> ```bash\n> pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple ...\n> ```\n\n## 安装步骤\n\n### 方式一：通过 PyPI 安装（推荐）\n\n```bash\npip install flashrag-dev --pre\n```\n\n### 方式二：从源码安装（适合开发贡献）\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG.git\ncd FlashRAG\npip install -e .\n```\n\n### 安装可选依赖（按需）\n\n```bash\n# 安装全部额外依赖\npip install flashrag-dev[full]\n\n# 单独安装 vLLM（加速推理）\npip install vllm>=0.4.1\n\n# 安装 Sentence Transformers\npip install sentence-transformers\n\n# 安装 BM25 后端（推荐 bm25s）\npip install bm25s\n\n# 安装 Faiss（必须通过 conda）\nconda install -c pytorch faiss-cpu\n# 或使用 GPU 版本\nconda install -c pytorch faiss-gpu\n```\n\n## 基本使用\n\n以下是最简单的 RAG 流程示例：加载配置 → 初始化流程 → 执行查询。\n\n```python\nfrom flashrag.config import Config\nfrom flashrag.pipeline import BasicPipeline\n\n# 加载配置文件（可自定义路径）\nconfig = Config('config\u002Fdemo_config.yaml')\n\n# 初始化基础 RAG 流程\npipeline = BasicPipeline(config)\n\n# 执行查询\nquery = \"Who invented the telephone?\"\nresponse = pipeline.run(query)\n\nprint(response)\n```\n\n### 配置文件说明\n\n默认配置文件位于 `config\u002Fdemo_config.yaml`，你可复制并修改以定制：\n- 检索器类型（如 `bm25`, `dense`, `hybrid`）\n- 生成模型（如 `llama3`, `qwen`, `openai`）\n- 数据集与语料路径\n- 是否启用重排序、压缩等模块\n\n### 使用 FlashRAG-UI（可视化界面）\n\n启动本地 UI 服务，无需编码即可配置和测试不同 RAG 方法：\n\n```bash\nflashrag-ui\n```\n\n浏览器访问 `http:\u002F\u002Flocalhost:7860` 即可图形化选择算法、数据集并运行评估。\n\n---\n\n现在你已准备好使用 FlashRAG 进行 RAG 实验、复现论文或构建自定义流程。更多高级用法请参考官方文档或组件说明。","某金融科技公司研发团队正致力于构建一个能处理复杂多跳推理的合规问答系统，需从海量监管文档中精准提取关联信息。\n\n### 没有 FlashRAG 时\n- **算法复现成本极高**：团队需手动重写论文代码来验证最新的推理增强检索（Reasoning-based RAG）方法，耗时数周且极易出错。\n- **数据预处理繁琐**：面对 36 种不同的基准数据集，工程师需自行编写脚本进行清洗、分块和索引构建，重复劳动占据了 80% 的开发时间。\n- **组件组装困难**：缺乏统一框架，尝试组合不同的检索器、重排序器和生成器时，接口不兼容导致频繁调试，难以快速搭建实验流水线。\n- **复杂任务表现不佳**：传统简单检索方案无法有效处理需要多步逻辑推导的合规问题，导致回答准确率远低于预期。\n\n### 使用 FlashRAG 后\n- **一键复现 SOTA 算法**：直接调用 FlashRAG 内置的 23 种先进算法（含 7 种推理增强方法），几分钟内即可完成基线对比，大幅加速技术选型。\n- **开箱即用的数据支持**：利用预处理的 36 个基准数据集和自动化脚本，瞬间完成语料加工与索引构建，团队可立即聚焦核心逻辑优化。\n- **灵活高效的管道编排**：借助其模块化设计，像搭积木般自由组合检索、重排序及生成组件，快速定制出适配金融场景的专属 RAG 流程。\n- **显著提升推理能力**：启用内置的推理增强方法后，系统在处理多跳合规查询时的准确率大幅提升，轻松攻克复杂逻辑难题。\n\nFlashRAG 将原本数月的研发周期压缩至数天，让团队能专注于业务逻辑创新而非底层基建重复造轮子。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FRUC-NLPIR_FlashRAG_0a1930e6.jpg","RUC-NLPIR","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FRUC-NLPIR_de7305eb.jpg","",null,"https:\u002F\u002Fruc-nlpir.github.io\u002F","https:\u002F\u002Fgithub.com\u002FRUC-NLPIR",[79,83],{"name":80,"color":81,"percentage":82},"Python","#3572A5",99.8,{"name":84,"color":85,"percentage":86},"Shell","#89e051",0.2,3456,297,"2026-04-15T19:26:24","MIT","Linux, macOS, Windows","非必需（支持 CPU 模式），若使用 vLLM 加速或大型模型推理则推荐 NVIDIA GPU；具体显存和 CUDA 版本取决于所选模型，文中未明确限定最低要求","未说明（建议根据数据集大小和模型规模配置，通常 RAG 任务推荐 16GB+）",{"notes":95,"python":96,"dependencies":97},"1. FAISS 无法通过 pip 直接安装，必须使用 conda 命令（如 'conda install -c pytorch faiss-cpu' 或 gpu 版本）。2. 项目支持多种硬件框架，另有基于 Paddle 和 MindSpore 的版本以支持国产硬件。3. 默认 BM25 检索器推荐使用轻量级的 'bm25s' 后端，Pyserini 后端将在未来版本弃用。4. 支持多模态 RAG（如 Llava, Qwen 等）及基于推理的 RAG 方法。","3.10+",[98,99,100,101,102,103,104,105],"flashrag-dev","vllm>=0.4.1 (可选)","sentence-transformers (可选)","pyserini (可选)","faiss-cpu\u002Ffaiss-gpu (需通过 conda 安装)","bm25s (可选，作为 Pyserini 的轻量替代)","chonkie (文档分块)","FastChat (可选，用于加速推理)",[107,16,35,14],"其他",[109,110,111,112],"benchmark","datasets","large-language-models","retrieval-augmented-generation","2026-03-27T02:49:30.150509","2026-04-16T08:17:10.404420",[116,121,126,131,136,141,146],{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},35594,"如何更换生成模型（例如使用 Llama3 70B 或 Qwen）？需要修改哪些配置？","在配置字典（config_dict）中修改 `generator_model` 参数为所需的模型名称（如 'llama3-70b' 或 'Qwen1.5-0.5B-Chat'），并确保 `model2path` 中包含该模型对应的本地路径。如果更换数据集，还需确保数据文件格式为 `jsonl`（HuggingFace 提供的标准格式），如果是 `json` 格式可能会读取失败。","https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fissues\u002F41",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},35595,"运行 Wiki 数据实验时遇到 GPU 设备错误或特殊 token 错误，如何解决？","这通常是因为配置文件中的 `gpu_id` 设置不当。可以在 `config_dict` 中添加 `gpu_id` 参数并设置为正确的值（例如 \"0\" 或 \"0,1,2,3\"），这将覆盖默认设置。也可以直接修改 `flashrag\u002Fconfig\u002Fbasic_config.yaml` 文件第 31 行的 `gpu_id` 字段。代码逻辑会自动根据此设置环境变量 `CUDA_VISIBLE_DEVICES`。","https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fissues\u002F42",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},35596,"复现论文结果时，为什么我的实验结果与论文汇报相差很大（例如低 10 个点）？","请检查以下关键设置是否与论文一致：\n1. 检索文档应使用 HuggingFace 仓库提供的文档，建立 index 时 `max_length` 设为 512 并开启 `fp16`。\n2. 生成模型必须设置 `do_sample=False`。\n3. 测试数据应选取前 1000 条，且未开启 `random_sample`。\n4. 尝试切换 vllm 和 fschat 框架，不同机器上结果可能有差异。\n5. 对于 LongLLMLingua 等方法，最新代码已优化显存占用（先加载 refiner 再加载 generator），请拉取最新代码。","https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fissues\u002F40",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},35597,"Wiki 数据集的 index 文件加载速度非常慢（甚至超过 1 小时），是否正常？如何加速？","默认使用的是 Flat index，由于 Wiki 数据量大，加载确实较慢（通常 1-2 分钟，全量数据在普通磁盘上可能更久）。加速方法包括：\n1. 使用全闪存 NVMe 硬盘可显著提升读写速度。\n2. 考虑使用带有压缩的 Faiss index 类型（如 PQ），但这会轻微影响检索精度。\n3. 参考 Faiss 官方文档选择适合硬件的 index 类型。在单张 A100 上，NQ 全流程通常在 20 分钟内完成，其中检索耗时约 2-3 分钟。","https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fissues\u002F25",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},35598,"实际推理时的检索速度是多少？为什么我测试的速度比官方提到的慢很多？","官方优化的 CPU 检索速度较快，但如果你通过 `pip` 安装 faiss-cpu，速度可能会慢 30 倍左右。建议通过 conda 安装特定版本以获得最佳性能：`conda install -c pytorch faiss-cpu=1.8.0`。此外，项目已修复了重复调用的问题并优化了 GPU 用法，请确保使用最新代码。正常情况下的 CPU 速度应在合理范围内，若仍慢请检查系统负载。","https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fissues\u002F4",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},35599,"如何替换自定义数据集？对文件格式有什么要求？","FlashRAG 支持的数据文件标准格式为 `jsonl`（每行一个 JSON 对象）。HuggingFace 上提供的数据集（如 wiki_qa）均为 `jsonl` 格式。如果使用 `json` 格式的文件会导致读取问题，需要将其转换为 `jsonl` 格式。在配置中指定数据集路径时，确保文件名正确（例如将示例中的文件改为 `test.jsonl`）。","https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fissues\u002F46",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},35600,"如何使用 SelfAsk 或 Judger 相关方法？对模型有什么要求？","SelfAsk 等方法需要模型具备较强的指令跟随能力。普通的 7B 参数模型可能无法很好地完成此类任务，建议使用更强的模型（如 Ret-Robust 中提供的模型或更大参数的模型）。如果在运行中遇到 `format_reference` 返回类型问题，注意它应返回字符串（str），某些内部函数如 `get_string` 的行为是正常的。","https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fissues\u002F21",[152,157,162,167,172,177,182],{"id":153,"version":154,"summary_zh":155,"released_at":156},280761,"v0.3.0","## 变更内容\n* 📖 @YeFD 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F156 中修复了 `basic_usage.md` 中的错别字\n* @chonknick 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F158 中进行了小幅改动，以支持 Chonkie `v1.0.2`\n* @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F184 中更新了 `base_prompt.py`\n* @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F183 中更新了 `run_exp.py`\n* @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F188 中再次更新了 `base_prompt.py`\n* @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F191 中再次更新了 `base_prompt.py`\n* @GR0ZA 通过升级 `bm25s` 并正确导入，修复了 `Tokenizer.save_vocab` 的问题，并在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F195 中完成了首次贡献\n* @DiVitoTommaso 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F201 中添加了对使用 SEISMIC 索引的神经稀疏检索（SPLADE）的支持\n* @throne-developer 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F203 中增加了对 CPU 环境的支持，便于个人学习\n* @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F205 中更新了推理方法\n* @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F207 中更新了 `utils.py`\n\n## 新贡献者\n* @YeFD 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F156 中完成了首次贡献\n* @chonknick 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F158 中完成了首次贡献\n* @GR0ZA 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F195 中完成了首次贡献\n* @DiVitoTommaso 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F201 中完成了首次贡献\n* @throne-developer 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F203 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcompare\u002Fv0.2.0...v0.3.0","2025-08-18T09:22:42",{"id":158,"version":159,"summary_zh":160,"released_at":161},280762,"v0.2.0","## 变更内容\n* chore: 修复运行实验，由 @DingYuanhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F130 中完成\n* chore(deps): 将 Gradio 从 5.9.1 升级至 5.11.0，由 @dependabot 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F131 中完成\n* 更新 README_zh.md，由 @Decem-Y 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F136 中完成\n* 提交 mm_exp，由 @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F143 中完成\n* 添加 mathvista_prompt，由 @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F144 中完成\n\n## 新贡献者\n* @DingYuanhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F130 中完成了首次贡献\n* @dependabot 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F131 中完成了首次贡献\n* @Decem-Y 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F136 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcompare\u002Fv0.1.4...v0.2.0","2025-03-10T02:14:46",{"id":163,"version":164,"summary_zh":165,"released_at":166},280763,"v0.1.4","## 变更内容\n* @YuyaoZhangQAQ 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F108 中添加了 rqrag 支持\n* @dongguanting 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F110 中更新了 README.md\n* @Ariya12138 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F111 中更新了 evaluator\u002Fmetrics.py\n* [文档] @bhavnicksm 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F117 中修复了 README.md 的导航链接\n* [功能] @bhavnicksm 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F119 中将 Chonkie Chunkers 添加到 `process_wiki.py`\n* [功能] @ignorejjj 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F123 中优化了整体代码功能及多模态实现\n* @YuyaoZhangQAQ 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F125 中更新了 README.md\n* @YuyaoZhangQAQ 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F127 中引入了 FlashRAG-UI\n\n## 新贡献者\n* @YuyaoZhangQAQ 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F108 中完成了首次贡献\n* @dongguanting 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F110 中完成了首次贡献\n* @Ariya12138 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F111 中完成了首次贡献\n* @bhavnicksm 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F117 中完成了首次贡献\n* @ignorejjj 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F123 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcompare\u002Fv0.1.3...v0.1.4","2025-01-13T02:25:28",{"id":168,"version":169,"summary_zh":170,"released_at":171},280764,"v0.1.3","## 变更内容\n* [修复] 由 @yeahjack 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F100 中修复了演示运行问题\n* 由 @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F98 中更新了 ircot_pipeline，增加了批处理方法\n\n## 新贡献者\n* @lihai-zhao 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F98 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcompare\u002Fv0.1.2...v0.1.3","2024-11-25T10:17:33",{"id":173,"version":174,"summary_zh":175,"released_at":176},280765,"v0.1.2","\u003C!-- 使用 .github\u002Frelease.yml 配置生成的发布说明 -->\n\n## 变更内容\n* 增加复现实验的中文文档，由 @aJupyter 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F83 中完成\n* 修复 tiktoken.encoding_for_mode 的 bug，由 @toughhou 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F91 中完成\n* 【编辑】在 trace 中添加框架规范，由 @yeahjack 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F92 中完成\n* 更新检索器，由 @plageon 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F93 中完成\n\n## 新贡献者\n* @aJupyter 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F83 中完成了首次贡献\n* @toughhou 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F91 中完成了首次贡献\n* @yeahjack 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F92 中完成了首次贡献\n* @plageon 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F93 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcompare\u002Fv0.1.1...v0.1.2","2024-10-29T06:23:09",{"id":178,"version":179,"summary_zh":180,"released_at":181},280766,"v0.1.1","\u003C!-- 使用 .github\u002Frelease.yml 中的配置在 main 分支上生成的发布说明 -->\n\n### 新特性\n\n- 增加了对 Azure OpenAI 模型的支持。([cbd4c8d](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002Fcbd4c8d))\n- 新增了一个方法：`trace`。该功能被两次实现，表明它可能在第二次提交中得到了增强或修正。([b9d6fa1](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002Fb9d6fa1), [7a728a2](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F7a728a2))\n- 将 Sentence Transformers 集成到检索模块中。([12e330e](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F12e330e))\n\n### 新模型\n\n- 针对百川模型优化了生成器设置。([7e0f124](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F7e0f124))\n\n### Bug 修复\n\n- 修复了检索缓存保存机制中的一个 bug。([18a727e](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F18a727e), [45662e3](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F45662e3))\n- 修复了评估指标中的一个错误。([d0f403e](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002Fd0f403e))\n- 解决了缓存管理器的相关问题。([8277011](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F8277011))\n- 修复了句子转换器编码器中的一个 bug。([b0fdfbb](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002Fb0fdfbb))\n- 解决了单 GPU 推理中的一个 bug。([982d433](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F982d433))\n- 修复了 BM25 功能中的一个 bug。([5009089](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F5009089))\n- 解决了 DataParallel 下加载基于 T5 的模型时的一个 bug。([6666b4a](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F6666b4a))\n- 修复了 EncoderDecoder 生成器中与最大 token 设置相关的 bug。([96b20c8](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F96b20c8))\n\n### 功能增强\n\n- 优化了生成器的实现。([d7a7136](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002Fd7a7136))\n- 优化了生成器类型的检测。([ed7ef8e](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002Fed7ef8e), [72c831d](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F72c831d))\n- 优化了精炼器的内存使用。([1984ca8](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F1984ca8))\n- 优化了生成器设置以提升性能。([7e0f124](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F7e0f124))\n- 修改了 VLLM 设置下生成器的 LoRA 加载方式。([c55ea39](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002Fc55ea39))\n- 在指标中增加了对多选题数据集的支持。([95d9fcc](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F95d9fcc))\n- 修改了评估器中的数据路径设置。([70e739e](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F70e739e))\n- 将指标名称从 `sub_em` 改为 `acc`。([15de563](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F15de563))\n- 将示例数据更改为通用知识。([3d20a75](https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommit\u002F3d20a75))\n- 更新了默认配置设置。","2024-08-03T01:38:41",{"id":183,"version":184,"summary_zh":185,"released_at":186},280767,"v0.1.0","## 功能特性\n\n- 实现 12 种 RAG 算法\n- 多种 RAG 组件\n- 发布 32 个 FlashRAG 数据集和维基语料库\n- 支持 vllm、FastChat 和 faiss\n\n## 新贡献者\n* @BUAADreamer 在 https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fpull\u002F6 中完成了首次贡献\n\n**完整更新日志**: https:\u002F\u002Fgithub.com\u002FRUC-NLPIR\u002FFlashRAG\u002Fcommits\u002Fv0.1.0","2024-05-31T02:25:50"]