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.
翻译:检索模型是检索增强生成(RAG)系统的关键组成部分,负责生成搜索查询、处理返回的文档并生成响应。RAG系统通常是动态的,可能涉及多轮检索。尽管许多先进的检索方法可通过学术信息检索平台获取,但这些平台通常为Cranfield范式设计,即所有查询预先已知且可离线批量处理。这种简化加速了研究进程,但导致先进的检索模型无法支持需要在线服务的下游应用,例如涉及循环、反馈甚至自组织代理的任意动态RAG管道。本研究提出RoutIR——一个Python软件包,通过简洁高效的HTTP API封装任意检索方法,包括首阶段检索、重排序、查询扩展和结果融合。用户仅需提供指定待服务检索模型的最小化JSON配置文件,即可使用可用模型的任意排列(例如融合多个首阶段检索方法的结果后进行重排序)动态构建并查询检索管道。该API默认自动执行异步查询批处理并缓存结果。虽然该软件包已支持多种先进检索方法,但通过实现Engine抽象类可轻松扩展功能。本软件包已在GitHub开源发布:http://github.com/hltcoe/routir。