The Agent Loop: Think, Try, Learn
How Agents Solve Problems Step by Step
AI agents don't just guess once — they work through problems in a loop: think about what to do, try an action, see what happens, then think again. This is called the "agent loop."
- Think: "What's the best next step to solve this problem?"
- Act: try something — search the web, run some code, read a file
- Observe: see what the result was
- Repeat until the job is done (or until they give up!)
- It's like how you work through a difficult puzzle — step by step
The Birthday Party Agent (That's You!)
Imagine you're planning your best friend's surprise birthday party. Watch yourself become an agent! Think: "What do I need? Guests, cake, a place, games." Do: message the guests. Check: three said yes, two haven't replied — better remind them tomorrow. Think again: "Cake next. Chocolate or vanilla?" Do: secretly ask their sister. Check: chocolate it is! You didn't plan every step at the start — you did one thing, looked at what happened, and let that decide your next move. That think → do → check rhythm is exactly the agent loop. AI agents tackle a research task or a coding job the very same way.
- Think: break the big goal into the next small step
- Do: take one action — send the message, ask the question
- Check: did it work? Let the answer shape your next move
- You already run the agent loop every time you plan something big
Prefer slides, quizzes, and saved progress? Read this lesson in the library — free, no sign-up.