Skip to content
Lees in het Nederlands

How an AI agent decides what to do

An AI agent works in a loop: read the task, pick a tool, read the result, decide again. What shapes each step, where the loop stops, and what is recorded.

Basics · 6 of 93 min readUpdated

In 30 seconds

  1. 1It works in steps: read, pick a tool, read the result, decide again.
  2. 2Its instructions, knowledge and memory shape every step it takes.
  3. 3Each AI agent has a step limit, and every run is recorded step by step.

On this page

  1. What the model sees
  2. The loop
  3. Where it stops
  4. What gets recorded
On this page4 sections · 3 min
  1. What the model sees
  2. The loop
  3. Where it stops
  4. What gets recorded

The short answer

An AI agent decides what to do next in a loop. It reads the task and everything it has been given, chooses a step (usually a tool call such as a search or a lookup), reads what came back, and decides again, until it can answer or runs out of steps. The choice at each step comes from the model, and what the model sees is something you control.

What the model sees

Before the first step, the platform assembles one set of instructions for the model. In Infinized that is, in order:

  • The colleague's own instructions, marked as ranking below the platform's rules, so they cannot override those rules.
  • The team's playbook, when the work is a team task.
  • Business context: the passages from its knowledge sources that are relevant to the question.
  • Relevant memories: what this colleague learned before and kept.
  • The rules that always apply: outside content is data, not instructions, facts are never invented, and the platform's own protection rules come last.

Then the task itself, and who is asking.

The loop

At each step the model either answers or asks for a tool. The platform runs the tool, hands the result back, and the model decides again. When a tool fails, the error goes back to the model as text, so it can try another way instead of stopping.

The tools on offer are the colleague's own: memory, knowledge, the web if it is switched on, and the integration accounts assigned to it. A lead or manager working on a team task also gets the tools to split the work and hand pieces to its team.

Where it stops

A colleague has a step limit. In Infinized the default is five steps per turn, and the reasoning-effort setting changes it: three on low, six on medium, ten on high. If a colleague uses every step and has results but no answer yet, it gets one last turn without tools to answer from what it found.

Separately, anything that changes a system waits for approval, and a monthly budget can stop a run before it starts.

What gets recorded

Every call to a model is a run on the record: the provider and model, the tokens in and out, the estimated cost, how long it took, whether it succeeded, and a trace of the tool calls, step by step. When a provider fails and the run moves on to the next model in its chain, the failed attempt is recorded too.

See what to record about every run and writing instructions.

Task · ticket #20417Example

Run receipt · 14:10:31Succeeded

Provider · model
Anthropic · claude-sonnet-5
Tokens in / out
3,412 / 286
Estimated cost
$0.0097
Duration
2.1 s
Served
Task · ticket #20417

Tool calls

  1. 1zendesk_get_ticket#20417 · “Invoice paid twice”
  2. 2search_knowledge3 passages · Refund policy
  3. 3create_subtask“Check the payment” → Otis

Task total $0.0220Subtask, its own total: $0.0003

See it at work in your organisation.

We start by listening to your question. Then we show you a demo that fits your organisation.

  • Approvals from the first run
  • Budgets that stop
  • Hosting in the Netherlands