Package dev.langchain4j.rag.query.router
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 ContentRetriever
s.
The goal is to ensure that
Content
is retrieved only from relevant data sources.
Some potential approaches include:
- Utilizing a Large Language Model (LLM) (seeLanguageModelQueryRouter
) - Employing aTextClassifier
(aka "semantic routing")
- See Also:
-
Method Summary
-
Method Details
-
route
Routes the givenQuery
to one or multipleContentRetriever
s.- Parameters:
query
- TheQuery
to be routed.- Returns:
- A collection of one or more
ContentRetriever
s to which theQuery
should be routed.
-