PyTerrier RAG¶
pyterrier-rag is an extension for PyTerrier that makes it easier to produce retrieval augmented generation pipelines. PyTerrier-RAG supports:
Easy access to common QA datasets
Pre-built indices for common corpora
Popular reader models, such as Fusion-in-Decoder, LLama
Evaluation measures
As well as access to all of the retrievers (sparse, learned sparse, and dense) and rerankers (from MonoT5 to RankGPT) accessible through the wider PyTerrier ecosystem.
Example Notebooks¶
Try out the following example notebooks to get started with PyTerrier RAG:
Sparse Retrieval on Natural Questions with FiD and FlanT5 readers: sparse_retrieval_FiD_FlanT5.ipynb
Sparse Retrieval on Natural Questions with Mistral: sparse_retrieval_Mistral.ipynb
E5 Dense Retrieval with FiD on Natural Questions: dense_e5_retrieval_FiD.ipynb
KG-augmented RAG with TRACE on HotpotQA: trace.ipynb
Agentic RAG: R1-Searcher r1searcher.ipynb
Agentic RAG: Search-R1 search-r1.ipynb
Agentic RAG: Search-O1 search-o1.ipynb
Credits¶
Craig Macdonald, University of Glasgow
Jinyuan Fang, University of Glasgow
Andrew Parry, University of Glasgow
Zaiqiao Meng, University of Glasgow
Sean MacAvaney, University of Glasgow