RoutIR: Fast Serving of Retrieval Pipelines for Retrieval-Augmented Generation
Eugene Yang, Andrew Yates, Dawn Lawrie, James Mayfield, Trevor Adriaanse
TL;DR
RoutIR tackles the challenge of serving retrieval pipelines online in retrieval-augmented generation by wrapping diverse retrieval methods behind a lightweight HTTP API. It introduces three architectural layers—Engines, Processors, and Pipelines—with a Relay Engine for distributed deployment and an on-demand pipeline language for dynamic composition. Empirical evaluation on NeuCLIR and RAG-related tracks shows strong throughput (3 to 10 queries per second) and CPU-only latency around 600 ms, with substantial gains from batching and caching. The work provides an open-source, easily extensible framework that lowers engineering barriers for integrating state-of-the-art retrieval methods into real-time RAG systems.
Abstract
Retrieval models are key components of Retrieval-Augmented Generation (RAG) systems, which generate search queries, process the documents returned, and generate a response. RAG systems are often dynamic and may involve multiple rounds of retrieval. While many state-of-the-art retrieval methods are available through academic IR platforms, these platforms are typically designed for the Cranfield paradigm in which all queries are known up front and can be batch processed offline. This simplification accelerates research but leaves state-of-the-art retrieval models unable to support downstream applications that require online services, such as arbitrary dynamic RAG pipelines that involve looping, feedback, or even self-organizing agents. In this work, we introduce RoutIR, a Python package that provides a simple and efficient HTTP API that wraps arbitrary retrieval methods, including first stage retrieval, reranking, query expansion, and result fusion. By providing a minimal JSON configuration file specifying the retrieval models to serve, RoutIR can be used to construct and query retrieval pipelines on-the-fly using any permutation of available models (e.g., fusing the results of several first-stage retrieval methods followed by reranking). The API automatically performs asynchronous query batching and caches results by default. While many state-of-the-art retrieval methods are already supported by the package, RoutIR is also easily expandable by implementing the Engine abstract class. The package is open-sourced and publicly available on GitHub: http://github.com/hltcoe/routir.
