Services

Resources

Company

AI agent

An AI agent is software that uses a large language model (LLM) to decide its own next steps toward a goal. It runs a loop: the model picks a tool call, the application runs it, and the result goes back to the model. The loop ends when the model answers or a limit is hit.

How it works

Each pass through the loop is a turn: one model call plus the tool calls it asked for. The number of turns is decided at runtime, so the same endpoint can be cheap or expensive. In the triage agent from One2N's AI observability workshop, max_turns is 3. A question about auth finishes in 2 turns, catalog takes 3, and checkout hits the cap, so the run fails with no answer.

Why it matters in production

Agents fail in new ways: loops, wrong tool choices and confident answers built on weak evidence. A run that loops three times costs three times as much. Teams cap turns, scope tool permissions and add agent observability for turns, tool latency and cost per completed run.

See also

On the One2N blog

Further reading

Comic about an AI agent: Asha asks an agent why checkout is slow, with three tools and max_turns 3; turn 1 reads p99 1.8 s; turns 2 and 3 find a slow payment span and a 14:00 deploy; the cap stops it before it answers; raised to 5 it answers; Noor sees 9,600 tokens because every turn resends history.