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

Four-panel comic about AI agent: Asha asks Bit: why is checkout slow? One question, but nobody knows how many steps the answer takes; The agent loop: the model picks a tool, the app runs it, the result goes back to the model, repeat until it answers; With max_turns = 3: auth finishes in 2 turns,...