An agentic system runs a loop: the model reasons about what to do next, acts by calling a tool, then observes the real result. The observation is appended to the context, so the next reason step is better informed. The loop repeats until the model replies with an answer instead of a tool call.
while True:
step = model(messages) # reason: decide the next action
if not step.tool_calls:
return step.text # model answers -> loop ends
result = run_tool(step.tool_calls) # act
messages += [step, result] # observe: real output back into context
Two things make this agentic. The observation is ground truth from a live system, not the model's guess. And the model, not your code, picks each next step. An error is just another observation, so the model can retry with different arguments.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
The diagram below the answer is the concept . Jump to it ↓