rag-fusion

RAG-Fusion: multi-query generation + Reciprocal Rank Fusion for better retrieval-augmented generation. Includes evaluation harness with NFCorpus/BEIR.

What is rag-fusion?

RAG-Fusion: multi-query generation + Reciprocal Rank Fusion for better retrieval-augmented generation. Includes evaluation harness with NFCorpus/BEIR.

Overview of rag-fusion

What it is

RAG-Fusion is a search methodology that aims to bridge the gap between traditional search paradigms and the multifaceted dimensions of human queries. It employs multiple query generation and Reciprocal Rank Fusion to re-rank search results, aiming to surface relevant material that a single phrasing of the query would miss, particularly when the user's vocabulary doesn't match how the corpus is indexed. The project includes an evaluation harness with NFCorpus/BEIR.

Key features

  • Multi-query generation: an LLM writes several rewrites of the user's query from different angles (synonyms, narrower and broader framings, related sub-topics).
  • Hybrid search: the original query and every rewrite are searched twice, with BM25 (keywords) and with vector search.
  • Reciprocal Rank Fusion: the lists are merged, and each document scores 1 / (60 + rank) summed over every list it appears in.
  • Reranking: a reranker (cross-encoder or decision model such as Jev) re-scores the fused pool.
  • Evaluation harness: includes NFCorpus dataset, IR metrics (Precision, Recall, NDCG, MRR), and CLI for baseline and fusion variants.
  • Experiments: includes write-ups on Jev, OpenAI Decisions API, Microsoft-Decision-1, and replication of arXiv 2603.02153v1.

Use cases

Strong-fit examples include academic/scientific literature search, biomedical research, patent prior-art search, legal e-discovery, regulatory review, long-tail e-commerce, cold-start retrieval over specialist corpora, and exploratory workflows. Poor-fit examples include FAQ chatbots, latency-critical retrieval, high-volume consumer search, code or identifier search, and structured data retrieval.

Getting started

See the repository README for installation instructions.

License and pricing

MIT license. Open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/raudaschlrag-fusion.svg)](https://yunodb.com/tools/raudaschlrag-fusion?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/raudaschlrag-fusion?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/raudaschlrag-fusion.svg" alt="Featured on YunoDB" height="20"></a>