# RAG-Retrieval

A Python framework for end-to-end fine-tuning, inference and distillation of RAG retrieval models, covering embedding, ColBERT-style late-interaction, and reranker models.

RAG-Retrieval provides end-to-end code for training, inference, and distillation of retrieval-augmented-generation retrieval models. For training, it supports fine-tuning of open-source embedding models (both BERT-based and LLM-based), late-interaction models such as ColBERT, and reranker models (BERT-based and LLM-based). For inference, it focuses on reranking and ships a lightweight companion Python library, rag-retrieval, that provides a single, unified way to call different RAG ranking models.

For distillation, it supports distilling both embedding and reranker models from a larger model down to a smaller one, such as a 0.5-billion-parameter LLM or a BERT-base model. The project has also published research and implementation notes on topics such as positional bias across a full retrieval pipeline, MRL loss for embedding models, and LLM-based reranking distilled into BERT.

It is released under the MIT license.

Website: https://github.com/NovaSearch-Team/RAG-Retrieval
