AI / LlamaIndex Interview Questions
What are the response modes available in LlamaIndex query engines?
The response_mode parameter controls how a response synthesizer turns retrieved Nodes into a final answer, and LlamaIndex offers several depending on how much thoroughness versus speed you need.
| Mode | Behavior |
refine | Processes Nodes one at a time, updating the answer sequentially with one LLM call per Node |
compact | Packs as many Nodes as fit into the context window per call, reducing LLM calls versus refine |
tree_summarize | Recursively summarizes Nodes bottom-up like a tree until one final answer remains |
simple_summarize | Truncates and stuffs Nodes into a single prompt in one shot |
accumulate | Generates a separate answer per Node and concatenates them, without merging |
compact is the default for most query engines because it balances answer quality against LLM call count reasonably well.
More Related questions...