Reflection¶
The Reflection block uses an LLM-as-a-judge to critique or synthesize outputs of another block (the “generator” block).
There are three modes:
Critique and Improve - The generator block runs, and its output is critiqued against an expectations prompt. If the output does not meet expectations, the generator block re-runs with the provided critiques as input. This repeats up to a configurable maximum number of iterations.
Critique or Retry - Similar to Critique and Improve, but the critiques are not provided to the generator block. The generator block is retried from scratch if the critique fails.
Synthesize - The generator block runs several times in parallel, and an LLM then synthesizes the results into a single, consolidated output.