FlexRAG is a highly reproducible, easy-to-use, and high-performance RAG framework designed for both research and application scenarios. It supports text, multimodal, and web-based RAG, providing a complete RAG pipeline and evaluation process. With built-in asynchronous processing and persistent caching, it ensures efficiency and scalability. Easily load retrievers from Hugging Face and quickly build powerful RAG solutions out of the box.
FlexRAG.mp4
- π Table of Contents
- β¨ Key Features
- π’ News
- π Getting Started
- ποΈ Architecture
- π Benchmarks
- π·οΈ License
- ποΈ Citation
- β€οΈ Acknowledgements
- π― High Reproducibility: FlexRAG comes with a companion repository, flexrag_examples, providing comprehensive reproduction cases for various RAG algorithms. Additionally, unified retrievers available on the HuggingFace Hub ensure easy replication of experimental results under the same environment.
- β Low Learning Curve: Download and load retrievers from the HuggingFace Hub with a single command, eliminating complex setup processes. Moreover, FlexRAG offers carefully optimized default configurations, allowing you to achieve excellent performance right out of the box and streamlining the development process.
- π Diverse Application Scenarios: FlexRAG supports not only text-based RAG but also multimodal and network-based RAG, enabling broad applications across different data types.
- π§ͺ Research-Oriented: Provides a unified evaluation process for various RAG tasks, making it easy to test across different datasets. Official benchmark tests are also available for convenient comparison and reference.
- β‘ Superior Performance: Leverages persistent caching and asynchronous functions to enhance high-performance RAG development.
- π End-to-End Support: From document information extraction and segmentation to retrieval, generation, and evaluation of output quality, FlexRAG fully supports every stage of the RAG lifecycle.
- π οΈ Modular & Flexible Design: With a lightweight modular architecture, FlexRAG accommodates multiple development modes, helping you quickly build customized RAG solutions.
- 2025-03-24: The Chinese documentation is now available! Please visit the documentation for more details.
- 2025-02-25: FlexRAG's LocalRetriever now supports loading from the HuggingFace Hub.
- 2025-01-22: A new entrypoint
run_retriever
and four new information retrieval metrics (e.g.,RetrievalMAP
) are now available. Check out the documentation for more details. - 2025-01-08: We provide Windows wheels for FlexRAG. You can install FlexRAG via pip on Windows now.
- 2025-01-08: The benchmark of FlexRAG on Single-hop QA tasks is now available. Check out the benchmarks for more details.
- 2025-01-05: Documentation for FlexRAG is now available. Check out the documentation for more details.
To install FlexRAG via pip:
pip install flexrag
Visit our documentation to learn more.
FlexRAG is designed with a modular architecture, allowing you to easily customize and extend the framework to meet your specific needs. The following diagram illustrates the architecture of FlexRAG:
We have conducted extensive benchmarks using the FlexRAG framework. For more details, please refer to the benchmarks page.
This repository is licensed under the MIT License. See the LICENSE file for details.
If you use FlexRAG in your research, please cite our project:
@software{Zhang_FlexRAG_2025,
author = {Zhang, Zhuocheng and Feng, Yang and Zhang, Min},
doi = {10.5281/zenodo.14593327},
month = jan,
title = {{FlexRAG}},
url = {https://github.com/ictnlp/FlexRAG},
year = {2025}
}
This project benefits from the following open-source projects: