Interface QueryRouter

  • All Implemented Interfaces:

    
    public interface QueryRouter
    
                        

    Routes the given 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 (see LanguageModelQueryRouter)
    - Using an EmbeddingModel (aka "semantic routing", see 
    EmbeddingModelTextClassifier
    in the
    langchain4j
    module) - Using keyword-based routing - Route depending on the user (
    query.metadata().chatMemoryId()
    ) and/or permissions
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Collection<ContentRetriever> route(Query query) Routes the given Query to one or multiple ContentRetrievers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait