Interface QueryRouter
- All Known Implementing Classes:
DefaultQueryRouter, LanguageModelQueryRouter
public interface QueryRouter
Routes the given
The goal is to ensure that
Some potential approaches include:
Query to one or multiple ContentRetrievers.
The goal is to ensure that
Content is retrieved only from relevant data sources.
Some potential approaches include:
- Using an LLM (seeLanguageModelQueryRouter) - Using anEmbeddingModel(aka "semantic routing", seeEmbeddingModelTextClassifierin thelangchain4jmodule) - Using keyword-based routing - Route depending on the user (query.metadata().chatMemoryId()) and/or permissions
- See Also:
-
Method Summary
-
Method Details
-
route
Routes the givenQueryto one or multipleContentRetrievers.- Parameters:
query- TheQueryto be routed.- Returns:
- A collection of one or more
ContentRetrievers to which theQueryshould be routed.
-