How to design a reflection loop in an agentic workflow?

Hi everyone!
I’m learning about agentic workflows and I’m confused about how to design a reflection loop. For example, should the same agent critique its own output, or is it better to use a separate agent as the critic? How do you decide when the loop should stop iterating? Any best practices or course recommendations would be appreciated. Thanks!

Hi!

The Agentic AI course by DeepLearning.AI is a good resource for understanding agentic workflows and reflection loops. I would recommend checking it out.

Regarding your question, you can certainly use the same model to critique its own output. For example, a general-purpose LLM or a model particularly good at writing and evaluating essays can review its own responses and suggest improvements. You don’t necessarily need a separate critic agent, although using a different model can sometimes provide a more independent perspective.

As for stopping criteria, I was recently going through the Agentic AI course on DeepLearning.AI, and I recall that they use a max_iterations variable to limit the number of reflection cycles. This is a practical way to prevent an endless loop. You can also introduce quality-based stopping criteria, where the process terminates once the output meets predefined requirements.

I’d recommend going through the course, as it provides practical examples of these concepts.