AI / LlamaIndex Interview Questions
Explain the execution flow of a query in a VectorStoreIndex-based query engine?
When you call query_engine.query("...") on a VectorStoreIndex-backed engine, several distinct steps run in a fixed order before you get a final answer back.
- The query string is optionally rewritten by a query transform, such as HyDE.
- The (possibly transformed) query is embedded using the same embedding model used for the Nodes.
- The retriever performs a similarity search in the vector store and returns the top-
kcandidate Nodes. - Node postprocessors filter, rerank, or reorder that candidate set.
- The response synthesizer assembles a prompt from the remaining Nodes and the original query, using the configured
response_mode. - The LLM generates the final answer, returned as a
Responseobject that includes both the text and thesource_nodesused, for traceability.
More Related questions...