AI Glossary / Core concepts
Agent loop.
Also known as: observe think act, observe-think-act, the agent loop
The agent loop is how an AI agent works through a task. It runs in a cycle: observe, think, act. It observes by reading all the context it has, your prompt plus any results from earlier steps, then it thinks about what to do next, then it acts, usually a Tool calls like searching the web or editing a file. Then it observes again, and around it goes.
Think of it like ping pong, back and forth, except the agent plays both sides until the goal is met. It keeps looping, making tool calls and reading the results, until it decides the task is done.
For builders, this is the mental model that makes agents click. The model isn't doing it all in one shot. It takes one step, looks at what came back, and decides the next step from there. That's why good context and clean tool results matter so much: every loop is only as good as what the agent can see when it observes.