ReAct: reason then act
The ReAct pattern interleaves reasoning and action:
Thought: "I need the order status."
Action: call get_order()
Observation: "shipped"
Thought: "Now email the tracking."
Each Thought-Action-Observation cycle moves the agent closer. It is the backbone of modern agents.
Reflection and self-critique
Add a second pass where the agent reviews its own work:
first = model.generate(solution)
critique = model.generate(
"Find bugs in:", solution=first
)
final = model.generate(
"Fix:", solution=first, feedback=critique
)
Generate -> critique -> fix. The critique is worth its weight in gold.
Self-critique consistently raises quality without extra tools.