From chatbot to agent: the ReAct loop
A chatbot answers once and stops. An agent keeps going. It thinks about what to do, calls a tool, reads the result and decides again, until the job is done. That loop, a few lines of code around the tool calling you already know, is what every agent product is built on.
In this lesson you'll learn to
- Explain what makes a system an agent rather than a chatbot or a single tool call.
- Describe the ReAct loop of reasoning, acting and observing, and why interleaving thought with action helps.
- Write a minimal agent loop around a tool-calling API, with a step limit and a clear stopping rule.
- Name the common ways an agent loop fails and the first guard for each.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.