Interface QueryRouter
- All Superinterfaces:
Function<Query,
List<DocumentRetriever>>
- All Known Implementing Classes:
AllRetrieversQueryRouter
A component for routing a query to one or more document retrievers. It provides a
decision-making mechanism to support various scenarios and making the Retrieval
Augmented Generation flow more flexible and extensible. It can be used to implement
routing strategies using metadata, large language models, tools (the foundation of
Agentic RAG), and other techniques.
When retrieving documents from multiple sources, you'll need to join the results before
concluding the retrieval stage. For this purpose, you can use the
DocumentJoiner
.
- Since:
- 1.0.0
- Author:
- Thomas Vitale
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<DocumentRetriever>
Routes a query to one or more document retrievers.
-
Method Details
-
route
Routes a query to one or more document retrievers.- Parameters:
query
- the query to route- Returns:
- a list of document retrievers
-
apply
- Specified by:
apply
in interfaceFunction<Query,
List<DocumentRetriever>>
-