What problem does LlamaIndex's `RouterQueryEngine` solve that a single `QueryEngine` cannot?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
RouterQueryEngine picks among several sub-engines (vector, SQL, summary) per query so one front door can serve structurally different question types.
Picture the front desk at a hospital. A single QueryEngine is one specialist with one toolkit. Great for the questions they know, useless for the rest. RouterQueryEngine is a triage nurse. You arrive with any question; she listens, decides whether you need radiology, the pharmacy, or general practice, and sends you to the right room. The departments have completely different tools, X-ray machines, pill counters, stethoscopes, but the patient only sees one front door. The router does not retrieve anything itself. It picks the engine that should retrieve, and that engine handles the rest.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: why one Index cannot serve all shapes, how the Selector picks, what differentiates LLM-based from embedding-based, and how to calibrate sub-engine descriptions.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Building one fat vector index for every kind of question, summarisation, lookup, structured query, and getting bad answers because the index shape only fits one question type.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.