Router Query Engine
- class llama_index.query_engine.router_query_engine.RetrieverRouterQueryEngine(retriever: BaseRetriever, node_to_query_engine_fn: Callable)
Retriever-based router query engine.
Use a retriever to select a set of Nodes. Each node will be converted into a ToolMetadata object, and also used to retrieve a query engine, to form a QueryEngineTool.
NOTE: this is a beta feature. We are figuring out the right interface between the retriever and query engine.
selector (BaseSelector) – A selector that chooses one out of many options based on each candidate’s metadata and query.
query_engine_tools (Sequence[QueryEngineTool]) – A sequence of candidate query engines. They must be wrapped as tools to expose metadata to the selector.
- class llama_index.query_engine.router_query_engine.RouterQueryEngine(selector: BaseSelector, query_engine_tools: Sequence[QueryEngineTool])
Router query engine.
Selects one out of several candidate query engines to execute a query.