TheLord of the Retrievers (LOTR), also known asMergerRetriever, takes a list of retrievers as input and merges the results of their get_relevant_documents() methods into a single list. The merged results will be a list of documents that are relevant to the query and that have been ranked by the different retrievers.
MergerRetriever class can be used to improve the accuracy of document retrieval in a number of ways. First, it can combine the results of multiple retrievers, which can help to reduce the risk of bias in the results. Second, it can rank the results of the different retrievers, which can help to ensure that the most relevant documents are returned first.
Remove redundant results from the merged retrievers
Pick a representative sample of documents from the merged retrievers
Re-order results to avoid performance degradation
No matter the architecture of your model, there is a substantial performance degradation when you include 10+ retrieved documents. In brief: When models must access relevant information in the middle of long contexts, then tend to ignore the provided documents. See: arxiv.org/abs//2307.03172Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.