Favicon of FlashRAG

FlashRAG

A Python RAG research toolkit for local models and OpenAI generators, with reusable pipelines, benchmark datasets and an MIT license.

FlashRAG is an open source Python toolkit for researchers and developers comparing retrieval-augmented generation (RAG) methods or building their own. It combines implemented research methods with prepared benchmark datasets and reported results, so experiments don't have to start with a separate codebase for each approach. It uses the MIT license.

Its components cover document retrieval, reranking, context compression and answer generation. You can combine them into custom pipelines, including methods that decide when to retrieve, merge parallel answers or repeat retrieval and generation. Reasoning methods such as R1-Searcher and Search-R1 address questions that require several retrieval steps.

Local model inference uses backends including vLLM and FastChat; OpenAI models are also supported as external generators. Retrieval works with DPR, BGE and E5 embeddings through Faiss, alongside BM25 and SPLADE. Faiss indexing has CPU and NVIDIA GPU options. An optional web search retriever uses the external Serper API, so that retrieval path requires an internet connection and an API key.

FlashRAG-UI provides a visual interface for comparing methods, switching components and evaluating benchmarks. Evaluation can retain intermediate outputs and metric scores for inspecting where a pipeline succeeds or fails. The toolkit also supports multimodal RAG with Llava, Qwen and InternVL models and CLIP-based retrievers, plus context compression through LLMLingua and SelectiveContext.

Similar to FlashRAG