Perceive, reason, act, observe, repeat
A single call to a language model, no matter how good the prompt, is not an agent. It's a one-shot function: input in, text out, done. What turns a model into an agent is wrapping it in a loop that repeats four steps: perceive the current state of the world, reason about what to do given that state and the goal, act by taking a concrete step (usually calling a tool or API), and observe the result of that action. That observation becomes the new state, and the loop runs again.
This loop is the actual architectural difference between a chatbot and an agent. A chatbot produces a response and stops, leaving a human to read it, decide what's true, and take the next step. An agent takes its own output, feeds it back through the tools available to it, and reacts to what actually happened, not what it predicted would happen. That feedback path is what lets an agent recover from a bad search result, retry a failed API call, or adjust course when a file doesn't exist where it expected.
