Reflection is an agentic workflow strategy in which an output or intermediate step is reviewed before being passed onward. The reviewing component may be the same model or a separate evaluator, and the goal is to catch errors, refine reasoning, or improve task performance.
A strategy for improving the quality of an agentic workflow by examining (reflecting on) a step's output before passing that output to the next step. The examiner is often the same LLM that generated the response (though it could be a different LLM). How could the same LLM that generated a response be a fair judge of its own response? The "trick" is to put the LLM in a critical (reflective) mindset. This process is analogous to a writer who uses a creative mindset to write a first draft and then switches to a critical mindset to edit it. For example, imagine an agentic workflow whose first step is to create text for coffee mugs. The prompt for this step might be: You are a creative. Generate humorous, original text of less than 50 characters suitable for a coffee mug. Now imagine the following reflective prompt: You are a coffee drinker. Would you find the preceding response humorous? The workflow might then only pass text that receives a high reflection score to the next stage.