AI / LlamaIndex Interview Questions
What is a query engine in LlamaIndex?
A query engine is the object you actually call to ask a question against an index. It's created by calling index.as_query_engine() and packages together a retriever and a response synthesizer into a single, easy-to-use interface.
When you call query_engine.query("your question"), it retrieves the relevant Nodes for that question, optionally runs them through node postprocessors, then hands them to the response synthesizer, which prompts the LLM to produce a final grounded answer along with the source Nodes it used.
Query engines are stateless, meaning each call is independent and doesn't remember previous questions, which distinguishes them from chat engines.
More Related questions...