Find answers from the community

s
F
Y
a
P
Updated 4 months ago

please tell me about query response modes that are available:- refine- compact- tree_s

@kapa.ai please tell me about query response modes that are available:

  • refine
  • compact
  • tree_summarize
  • accumulate
k
3 comments
Please stand by @SeaBerg as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
Sure, here's a brief overview of the response modes you asked about in LlamaIndex:

  • Refine: This is an iterative way of generating a response. The context in the first node, along with the query, is used to generate an initial answer. This answer, the query, and the context of the second node are then used as input into a “refine prompt” to generate a refined answer. This process is repeated through N-1 nodes, where N is the total number of nodes. source ()
  • Compact: This mode first combines text chunks into larger consolidated chunks that more fully utilize the available context window, then refines answers across them. This mode is faster than refine since fewer calls are made to the LLM. source ()
  • Tree Summarize: This mode builds a tree index over the set of candidate nodes, with a summary prompt seeded with the query. The tree is built in a bottoms-up fashion, and in the end, the root node is returned as the response. source ()
  • Accumulate: This mode synthesizes a response for each text chunk, and then returns the concatenation. source ()
Please note that the accumulate mode is still in beta and requires extra parsing to convert to objects. source ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord