TL;DR
This paper introduces ROUTIR, a Python package that provides a flexible HTTP API for serving state-of-the-art retrieval models. It addresses the challenge of integrating dynamic, multi-round retrieval pipelines, common in Retrieval-Augmented Generation (RAG) systems, with existing offline-focused IR tools by enabling on-the-fly pipeline construction and online querying.
What Problem Does This Paper Address?
Retrieval-Augmented Generation (RAG) systems, which combine large language models (LLMs) with information retrieval, are becoming increasingly complex. These systems often involve dynamic, multi-turn interactions where queries are generated on the fly, and retrieval might happen iteratively. However, most existing Information Retrieval (IR) research platforms are designed for the "Cranfield paradigm," where all queries are known upfront and processed in batches offline. This setup is insufficient for the dynamic nature of RAG, as it doesn't support online querying or the flexible composition of retrieval steps needed for these advanced applications. Researchers and developers need a way to easily serve and compose various retrieval models (like first-stage retrieval, reranking, query expansion, and result fusion) in an online, API-driven manner to build and experiment with these dynamic RAG systems.
Methods
ROUTIR is presented as a Python package that acts as a lightweight wrapper around retrieval models, providing an HTTP API for online access. Its core components are:
- Engines: These are the fundamental units that encapsulate retrieval capabilities. An Engine can implement first-stage retrieval, query-passage scoring (for reranking), query rewriting, or result fusion. The system is designed to be extensible, allowing users to wrap new models by implementing an
Engineabstract class. - Processors: These components handle tasks like caching results and batching incoming queries before they are sent to an Engine. This is crucial for improving throughput, especially when dealing with asynchronous requests common in RAG.
- Pipelines: ROUTIR allows users to define retrieval pipelines dynamically using a simple, context-free grammar. This enables the composition of multiple Engines on the fly, such as fusing results from several retrieval methods and then reranking them. The user specifies the pipeline in a JSON request.
Key features include asynchronous query batching, in-memory and Redis caching, and a minimal JSON configuration for defining services and collections.
Datasets
The paper mentions experiments conducted using the TREC 2023 NeuCLIR MLIR task dataset. This dataset consists of 76 queries and approximately 10 million web documents in Chinese, Persian, and Russian, extracted from Common Crawl News.
Key Insights and Ideas
- Bridging the Gap: ROUTIR effectively bridges the gap between offline IR research tools and the demands of online, dynamic RAG systems by providing a unified HTTP API.
- Dynamic Pipeline Construction: The ability to construct complex retrieval pipelines on-the-fly via a simple grammar is a significant advantage for RAG systems that require flexible retrieval strategies.
- Throughput vs. Latency: For RAG, where multiple queries might be issued concurrently, maximizing throughput is often more critical than minimizing individual query latency. ROUTIR's batching and asynchronous processing are optimized for this.
- Extensibility: The design emphasizes ease of integration for new retrieval models, reducing the engineering overhead for researchers.
- Practical Deployment: The package has been deployed in real-world research settings, including the JHU SCALE 2025 workshop and the TREC RAGTIME track, demonstrating its robustness and reliability.
Key Results
The paper reports on experiments using three multilingual models on the TREC 2023 NeuCLIR MLIR task, evaluating effectiveness (nDCG@20) and efficiency (Batched Throughput and Sequential Latency).
- Throughput: All tested models (PLAID-X, MILCO, Qwen3 Embedding) demonstrated strong batched throughput. Qwen3 Embedding achieved the highest throughput at 9.60 queries/sec, while PLAID-X was close behind at 7.05 queries/sec.
- Latency: PLAID-X showed significantly lower sequential latency (0.24 sec/query) compared to Qwen3 Embedding (1.23 sec/query) and MILCO (2.46 sec/query).
- RAG Integration: The paper highlights an example of integrating ROUTIR with the GPT Researcher RAG toolkit, requiring minimal code (21 lines) due to ROUTIR's HTTP API interface.
Limitations and Future Work
- Asynchronous Operations: While ROUTIR supports asynchronous operations, the paper notes that standalone Lucene instances searching batches might block the Python process if not handled carefully, suggesting that users might need to manage concurrency for certain models.
- Future Plans: The authors mention ongoing development plans, including integration of LLM rerankers, a Model Context Protocol (MCP) interface, and improved resource management. They also welcome community contributions for feature requests and pull requests.
Summary updated