Catalog / Single agent

Reflection

The agent reviews its own draft before answering, writes down what to fix, and tries again with that note in its context.

Reference task used across all patterns: "My order arrived damaged. Can I get a refund?"

Topology

ActorLead agentStore

Run

08 steps

Ready to run

Play runs the whole scenario. Step advances one event at a time so you can read what happens.

Metrics

Wall-clock time0.0 s
Tokens processed0
Estimated cost$0.000
Reflections
0
Illustrative values. They show proportions between patterns, not benchmarks.

All steps

Normal run

  1. Request arrives. One agent, no second model. What it adds is a second look at its own work.
  2. First attempt. The agent drafts an approval. The draft states that the damage is confirmed, although the agent never checked the carrier's record.
  3. Save the draft. The draft is set aside instead of being sent.
  4. Read it back. The agent rereads the draft with a different prompt, a reviewer's checklist. Is every claim backed by evidence it has actually seen?
  5. Reflect. Against the checklist the gap is obvious. “Damage confirmed” has no source. The checklist is what supplied the new angle.
  6. Write the lesson down. The reflection becomes a short, concrete note. It will sit in the context of the next attempt.
  7. Second attempt. With the note in context, the agent checks the carrier's record first. The damage is confirmed, and this time the claim has a source.
  8. Respond. Refund approved. The answer is the same as the first draft, and now it is justified.

Outcome: correct answer, now justified. Reflection worked because the second look brought something the first attempt lacked, a checklist and then a tool result. Roughly double the cost bought an answer that can be defended.

Failure mode

  1. Request arrives. Identical start to the normal run.
  2. A misread date. The agent reads the delivery date as 12 Aug instead of 12 Sep and concludes that the 30-day window has passed.
  3. Save the draft. The draft says the refund is denied.
  4. Read it back. This build's reflection prompt is only “review your answer and improve it”. No checklist, no tools, no new information.
  5. Reflect. The same model with the same context rereads its own reasoning and finds it convincing. The wrong date looks as right the second time.
  6. A confident note. The reflection does not merely miss the error. It adds a second voice agreeing with it.
  7. Incorrect response. Refund denied, for an order delivered well inside the window. The extra pass cost time and tokens and only raised confidence.

Failure: reflection without new information. A model rereading itself shares its own blind spots. Mitigation: ground every reflection in something external, such as a tool result, a test or a rule check, or hand the review to a separate evaluator.

Execution trace

Model workingSending a message

Reference

Problem
A first answer often contains an error that is easy to spot on review, but it is sent before anyone looks.
Analogy
Proofreading your own email before sending. It works when you check it against a list, and fails when you just nod along.
Use when
A review can bring in something new, such as a checklist, test results, tool output or an error message from a failed attempt.
Avoid when
The review has nothing to check against. Without an external signal the second pass mostly repeats the first, at double the cost.
Typical failure
Self-confirmation: the model reviews its own reasoning, shares its own blind spot, and approves the error.
Also known as
Reflexion (Shinn et al.)Self-Refine (Madaan et al., related)Reflection (LangGraph)
Related patterns

Space play or pause   next step   previous step  R reset   F failure mode