How an AI agent works
An AI agent works in a loop rather than along a script: on each turn it reads the current state of the job, decides a single next step, carries that step out with one of the tools it has been given, then reads what changed and decides again — until the job is done, or it reaches a limit someone set for it.
On this page
- What happens between a trigger and a result
- One turn of the loop, in order
- The jobs this way of working actually suits
- What the loop does on a turn it cannot finish
- The three ways a loop goes wrong
- What running the loop costs in the UK
- Frequently asked questions
- Sources
- Related terms
What happens between a trigger and a result
Most explanations of this start with the technology. It is more useful to start with the ten seconds you are actually buying.
A call comes in at 4.52pm and nobody picks it up. The agent answers. The caller says their boiler is leaking and they are in Walthamstow. Nothing about that sentence was written down in advance — not the words, not the postcode, not the fact that the boiler is the urgent part and the address is the part that decides who goes. The agent has to work out, in that moment, that this is an emergency job, that the diary needs checking for the engineer who covers east London, and that the caller needs a time rather than a promise to call back. Then it has to do those things, in your diary, and leave a record of what it did.
That is the whole of it. An agent is a piece of software that is given a goal and a set of tools, and works out its own steps towards the goal one at a time, checking after each step what actually happened. It is not following a path somebody drew. There is no branch in a flowchart labelled "leaking boiler, Walthamstow, 4.52pm".
The industry's own descriptions agree on that much even when they agree on nothing else. Anthropic, which builds the models a great many agents run on, defines an agent as a system where language models "dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks", and adds the plainest sentence written about agent mechanics anywhere: agents "are typically just LLMs using tools based on environmental feedback in a loop". IBM describes the same shape as three stages — a goal and rules set by people, reasoning with the tools available, then reflection on what came back.
The jobs that shape fits are the ones that arrive in no fixed form and need something looked up or written down before anyone can answer. Taking the calls nobody gets to after five. Reading the enquiry that came in through the website and qualifying it against the questions you would have asked. Chasing the quote that has gone quiet for nine days. Reading an invoice that arrived as a photograph and coding it. Each of those is one job, with a trigger, a boundary and a result you can check at the end of the week — which is what makes it an agent's job rather than a project. They are also, as it happens, the jobs the agents we build are each pointed at, one apiece.
One turn of the loop, in order
A turn is the unit to think in. Everything an agent does is one of these, repeated until the job is finished.
- It reads the state. What just happened, plus whatever it is allowed to remember from earlier in the same job. In the classical framing this is a percept: Russell and Norvig's textbook definition, as the Intelligent agent encyclopaedia entry has it, is that an agent "is anything that perceives its environment through sensors and acts upon that environment through actuators". The sensors here are your phone line, your inbox, your forms.
- It decides one step. Not the plan for the whole job — the next move only. IBM calls the deciding part task decomposition: "the agent creates a plan of specific tasks and subtasks to accomplish the complex goal", and for simple work notes that planning is not a necessary step at all.
- It uses one tool. A tool is a thing the agent is allowed to do: look a customer up, read the diary, write a booking, send a text, raise a ticket. The model cannot reach anything you have not handed it, which is why the list of tools is the real specification of an agent and the first thing to ask a supplier for.
- It reads what changed. The result of the tool call — the slot was free, the record did not exist, the API refused — goes back in as the next turn's input. This is the feedback part of "feedback in a loop", and it is what separates an agent from a single clever answer. Microsoft's architecture guidance describes a single agent with tools as one that "can loop through multiple model calls and tool invocations to refine results", and calls that "often the right default for enterprise use cases".
- It stops. Because the job is done, because a limit was reached, or because it has hit something it is not allowed to decide. Stopping well is a design decision, not an afterthought; the next two sections are about it.
The named version of this loop, for anyone who wants to look it up, is ReAct — reasoning and acting, from a 2022 paper by Yao and colleagues that is now the common pattern underneath most production agents. Its contribution was to interleave the two rather than separate them: reasoning traces "help the model induce, track, and update action plans as well as handle exceptions", while the actions let it "interface with external sources, such as knowledge bases or environments, to gather additional information". IBM's name for the same thing is blunter and easier to hold: Think-Act-Observe.
The jobs this way of working actually suits
A flowchart and a loop are both automation, and they fail at opposite ends.
A flowchart is written in advance by a person. Every input it will ever see has to be anticipated, and when one arrives that nobody anticipated, it stops, or worse, it carries on down the nearest branch. The upside is that it does the same thing every time, which is exactly what you want for the steps that never vary — raising the invoice, sending the reminder, moving the file. Anthropic's term for this is a workflow, "systems where LLMs and tools are orchestrated through predefined code paths", and its advice is to prefer them: find "the simplest solution possible, and only increasing complexity when needed".
A loop is written by nobody. It handles the sentence it has never seen, because deciding is what it does on every turn — and the price is that you cannot list in advance what it will do. Microsoft puts the trade in two words, deterministic against dynamic: a fixed order gives "deterministic, reproducible results", and an agent is for the work where "some requests require dynamic tool use".
So the test for which one you want is about the work rather than the technology, and it is a question you can answer about your own business in a sentence. Does the work arrive in a predictable shape. Invoices in the same format from the same twelve suppliers: that is a flowchart, and buying a loop for it means paying for judgement you did not need. Calls, emails and enquiries in a person's own words, where the first job is working out what the thing even is: that needs a loop, and a flowchart will keep breaking in a way nobody can quite fix.
Most real businesses want one agent wrapped around some fixed steps — a loop that decides, and ordinary scripted automation doing the parts where nothing is ever in doubt. The point of knowing the difference is not to choose a camp. It is to be able to tell, when a supplier shows you a diagram, which parts of it are deciding and which are just plumbing.
What the loop does on a turn it cannot finish
The turn that matters commercially is the one where the agent does not know.
A loop with nowhere to stop is the thing everyone is right to be nervous about. So the parts of an agent build that take the longest are not the parts that work: they are the boundary conditions. Anthropic describes the shape plainly — agents "plan and operate independently, potentially returning to the human for further information or judgement", can "pause for human feedback at checkpoints or when encountering blockers", and should carry "stopping conditions (such as a maximum number of iterations) to maintain control".
In a small business that translates into a short, specific list, and it is worth writing yours down before anyone builds anything:
- The things it may never decide. Price outside the published range, a refund, a credit note, a promise about a date no engineer has confirmed.
- The things it must escalate on sight. A complaint. A solicitor's letter. Anyone who says the word "emergency". A caller who asks for a named person.
- The line past which it stops trying. A turn limit, so a job it cannot finish becomes a queued case with a note, rather than a loop that runs all night.
- Who picks the handed-back job up, and where they see it. This is the one most often left out, and it is the one that decides whether the agent helps. A hand-off into nobody's inbox is not a safeguard.
Done properly, a hand-off is not a failure of the agent. It is the agent doing the most valuable thing it does all day — recognising that the next step belongs to a person, and leaving them everything it already knows about the job.
The three ways a loop goes wrong
Three failures account for nearly everything that goes wrong inside the loop, and all three are structural rather than bad luck.
It goes round and round. An agent that cannot make progress and has no limit will keep calling the same tool. IBM names it exactly: agents "unable to create a comprehensive plan or reflect on their findings, might find themselves repeatedly calling the same tools, causing infinite feedback loops". Microsoft's guidance gives the fix in one line — "to guard against infinite tool-call loops, set iteration limits" — which is why the turn limit above is not a detail.
Small errors compound. Each turn takes the last turn's output as its input, so a wrong reading on turn two is treated as fact on turn three. Anthropic is explicit that "the autonomous nature of agents means higher costs, and the potential for compounding errors", and recommends "extensive testing in sandboxed environments, along with the appropriate guardrails". In practice this is why a new agent is worth watching for a few weeks on real work before anyone trusts its weekly numbers.
It states something that is not true. The model underneath writes fluent sentences whether or not it has the fact, so an agent that has not been made to look things up will answer from nowhere. The honest mitigation is mechanical and has nothing to do with intelligence: give it the lookup, make it use the lookup, and keep the record of what it read. The ReAct paper found exactly that in the lab — its agent "overcomes issues of hallucination and error propagation prevalent in chain-of-thought reasoning by interacting with a simple Wikipedia API". An agent that can check is a different animal from one that cannot.
None of the three is a reason not to run an agent. They are the reasons an agent build is mostly boundaries, logging and testing, and why a demo that answers three questions beautifully tells you very little about the twentieth of the month.
What running the loop costs in the UK
Here is the part a loop changes about the bill, and it is the one thing worth knowing before you read any price list: in most of this market, you pay for how much the loop runs.
We can show that rather than assert it. On 29 October 2026 we read the published pricing page of every UK AI phone-answering supplier we could find — 29 plans across 18 vendors, 27 of which published a monthly price, from £9.99 to £250 a month — and the metering is the pattern underneath. Eighteen of the 29 plans cap usage with a numeric allowance in minutes or calls. Fourteen publish the rate charged past it, between £0.10 and £0.40 a minute on the minute-priced plans, and £0.39 to £0.49 a call on the call-priced ones. Six say unlimited. Two published no price at all.
A metered price is not a trick, and in the one category where pricing is public at all it is the norm. But it does mean the quote you compare on is a forecast of your own call volume, made before the agent has taken a single call — and that busy months, which are the months the agent is worth most, are also the months it costs most. Allowances also sit lower than people expect: a 150-minute month is about five minutes a day.
Agent Place is one flat monthly fee for unlimited agents instead, so the number of agents you run and the amount they run do not change the bill. The reason that is possible is in this page: once one loop is built, the second agent is mostly boundaries and tools rather than new machinery.
What an AI agent costs goes through the build side of that in more detail. The other half of the cost is the half nobody meters. Somebody has to read the handed-back cases, watch the log for the first few weeks, and own the question of whether the thing is still right about your business after your prices change. That work is small, real and permanent, and a quote that does not mention it is quoting half the job.
Frequently asked questions
- How do AI agents work, in one sentence?
It reads the current state of the job, decides one next step, carries that step out with one of the tools it has been given, then reads what changed and decides again, until the job is done or it reaches a limit. A language model does the deciding; the tools do the acting; the result of each action is what the next decision is made on.
- Do AI agents follow rules, or decide for themselves?
Both, and the split is the thing to get clear in a quote. People set the goal, the tools it may use, what it may never decide and when it must stop. Inside those boundaries the agent chooses its own steps, which is the whole reason it can handle an enquiry nobody anticipated.
- What can AI agents do, and what are they used for in a small business?
The work that arrives unpredictably and needs a lookup before it can be answered: calls nobody picks up, website enquiries that need qualifying, quotes that have gone quiet, appointment changes, invoices that arrive as photographs. Work that always takes the same steps is cheaper and safer as ordinary automation.
- How does an AI agent reach your diary and your records?
Through tools you grant it, one at a time, each one a specific permitted action rather than general access. The list of tools is the real specification of an agent, so ask for it in writing: what it can read, what it can write, and what it cannot touch.
- What stops an AI agent running forever?
A turn limit, and escalation rules that end the loop by handing the job to a person. Microsoft's architecture guidance states the rule directly — "to guard against infinite tool-call loops, set iteration limits" — and a job that hits one should arrive in a named person's queue with a note, not disappear.
- How long does one turn of the loop take?
Seconds, and several turns fit inside a natural pause in a phone call. The thing that makes an agent feel slow is rarely the model: it is a tool call waiting on a system that is itself slow, which is worth testing against your own software rather than in a demo.
Sources
The outside descriptions quoted on this page, each read on 23 November 2026, in full rather than summarised.
- Anthropic, Building effective agents — "Workflows are systems where LLMs and tools are orchestrated through predefined code paths", while agents "are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks"; agents "are typically just LLMs using tools based on environmental feedback in a loop"; they can "pause for human feedback at checkpoints or when encountering blockers" and should carry "stopping conditions (such as a maximum number of iterations) to maintain control"; "the autonomous nature of agents means higher costs, and the potential for compounding errors". anthropic.com/research/building-effective-agents
- IBM, What are AI agents? — the three stages of operation, "goal initialization and planning", "reasoning with available tools" and learning through reflection; "the agent creates a plan of specific tasks and subtasks to accomplish the complex goal"; the ReAct loops "known as Think-Act-Observe"; and the warning that agents "might find themselves repeatedly calling the same tools, causing infinite feedback loops". ibm.com/think/topics/ai-agents
- Shunyu Yao and colleagues, ReAct: Synergizing Reasoning and Acting in Language Models, arXiv:2210.03629, submitted 6 October 2022 and revised to the ICLR camera-ready version on 10 March 2023 — reasoning and acting generated "in an interleaved manner", where reasoning traces "help the model induce, track, and update action plans as well as handle exceptions" and actions "interface with external sources, such as knowledge bases or environments"; ReAct "overcomes issues of hallucination and error propagation prevalent in chain-of-thought reasoning by interacting with a simple Wikipedia API". arxiv.org/abs/2210.03629
- Wikipedia, Intelligent agent — the textbook framing it attributes to Russell and Norvig, that an agent "is anything that perceives its environment through sensors and acts upon that environment through actuators", and that a rational agent "selects the action expected to maximize its performance measure, given its percept sequence, prior knowledge, and available actions". en.wikipedia.org/wiki/Intelligent_agent
- Microsoft Learn, Azure Architecture Center, AI agent orchestration patterns — a single agent with tools is one that "can loop through multiple model calls and tool invocations to refine results" and is "often the right default for enterprise use cases", "simpler to debug and test than multiagent setups"; "to guard against infinite tool-call loops, set iteration limits". learn.microsoft.com/en-us/azure/architecture/ai-ml/guide/ai-agent-design-patterns
- UK AI phone-answering prices, read from each supplier's own pricing page on 29 October 2026 — 29 plans across 18 vendors, 27 of them publishing a monthly price, 18 plans capped by a minute or call allowance and 14 publishing the rate beyond it. Our own research, held as a dated source file.
Free consultation
The useful version of this conversation is about one job rather than about loops. Tell us the thing that arrives every week in somebody's own words and gets dealt with late, and we will tell you on the call what the agent would be allowed to do, where it would stop and hand back, what it needs to reach in your systems, and the price. How a build runs is written up if you would rather read first.
We build unlimited agents. For one flat monthly fee. Fully functioning and delivering value in 30 days guaranteed, or you pay nothing more until your agents are.
Written by Kole Ogundipe for Agent Place, an AI automation agency and consultancy based in the UK which builds bespoke agents for operations, sales and marketing.