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: an engineer asks an AI helper with charts and logs why checkout is slow; it works in turns where the AI decides, a tool runs and the result comes back; with a 3 turn limit it finds slow payments and a new release, then stops with no answer; with the limit raised to 5 it says to roll back the release, and turns stay capped because each one costs money.