RAGatouille
Open-source Python library for local document retrieval with ColBERT. Train models and search disk-backed indexes under the Apache 2.0 license.
RAGatouille is a Python library for developers building retrieval-augmented generation (RAG) applications with ColBERT. It builds and searches document indexes on your own hardware or server, with compressed indexes stored on disk that your application can query directly.
Its main distinction is ColBERT's late-interaction retrieval, which compares individual terms using multiple embeddings rather than representing a document with a single dense vector. It gives developers a way to try this approach in specialized domains or non-English retrieval tasks without implementing the underlying research themselves. You can use pretrained ColBERTv2 models or train a model for your own collection.
The library handles document splitting, embedding and index compression. Search results include ranked passages, scores and document IDs, plus metadata when supplied. It also supports querying several questions at once.
For training, RAGatouille accepts query-document pairs and triplets, removes duplicates and mines difficult negative examples. It can fine-tune an existing ColBERT model or train one starting from another transformer's weights. Its data processing and negative-mining components can also be used independently.
RAGatouille is open source under Apache 2.0. Windows isn't supported natively; some users report success with WSL2. The official ColBERT Flask query server can serve its indexes, and Intel's FastRAG supports models trained with the library.