An ordinary chat model answers a single message and stops there. An AI agent receives the whole task and decides for itself what to do next: break the work into steps, call the right tool, look at the intermediate result and adjust the plan if needed. This is how multi-step processes are automated — handling requests, triaging incidents, maintaining code.
What it consists of
- The model — the “brain” that understands the task, plans and decides which action comes next; usually a large language model (LLM).
- Tools — actions outside the model: search, an SQL query to a database, an API call, running code, reading files.
- Memory — what the agent has already done and learned: the history of steps, search results, intermediate files.
- The orchestrator — the code that runs the “model → action → result” loop: developers write this logic, not the model itself.
The action loop
Every agent step looks the same: the model receives the task and the current state, decides on the next action, the orchestrator executes it and returns the real result to the model — tool output, an API response, the log of a code run. Based on this response the model assesses progress and decides what to do next. The loop repeats until the model decides the goal has been reached — or until a stopping condition triggers, such as a step limit.
{ "step": 3, "thought": "order 42 is not in the main database, checking the archive", "tool": "sql", "arguments": {"query": "SELECT status FROM orders_archive WHERE id = 42"}, "result": "order found, status = cancelled"}How much freedom the agent gets
Agency is not a switch but a scale: the more decisions are handed to the model, the more flexible the system — and the more expensive and unpredictable. If the path to the solution is known in advance, a rigid workflow with the steps written in code is more reliable.
| Level | What the model decides | Example |
|---|---|---|
| Single request | nothing: it answers straight away, with no actions | question — answer in a chat |
| Workflow | nothing along the way: the steps are fixed in code in advance | RAG pipeline: search → reranking → answer |
| Agentic loop | which steps to take and when to stop | process a product return according to the shop’s rules |
| Multi-agent system | how to distribute the work between agents | a coordinator assigns tasks to a coder agent and a reviewer agent |
Risks
- Errors accumulate: one wrong step spoils all the steps after it, so agents are tested in an isolated environment and given limited permissions.
- Every step is a paid model call, and the number of steps is unknown in advance: without a limit the task may never finish.
- Hallucinations and prompt injection do not disappear: the results of an agent’s actions should be checked, and tools should be given only the data and permissions they need.
Sources
the term is written from these pagesVerified 18 Nov