AI / LlamaIndex Interview Questions
What is the difference between a query engine and a chat engine?
A query engine is stateless: each call to .query() is handled independently, with no memory of previous questions. It's built for single-turn, programmatic Q&A, such as answering one lookup at a time from an API.
A chat engine is stateful: it holds a memory buffer of the conversation and can resolve references like "what about the second one?" by considering earlier turns before retrieving and answering. Internally, many chat engine modes are built on top of a query engine, adding a step that rewrites or augments the query using chat history first.
The practical rule of thumb is to use a query engine for backend automation or one-shot lookups, and a chat engine when building an interactive assistant a user talks to over multiple turns.
More Related questions...