AI systemsagentLLM agentagent loopagentic

AI agent

Definition

An AI agent is an application in which a language model repeatedly chooses the next action, usually a tool call, while a runtime executes the action, feeds the observation back and enforces limits until the task is done.

In practice

Agents handle tasks with unknown steps: chained lookups, comparisons, multi-step changes to real systems. The runtime owns everything outside the model: executing tools with the user's permissions, memory (trimmed history plus retrieved facts), budgets, checkpoints and approvals. Long-running tasks belong on a queue with durable state, not inside a web request.

Each turn is a full model call that re-reads the growing context, so latency, tokens and cost grow with the number of steps, and one failing tool can make a loop consume shared model capacity. Enforce step, token, cost and time budgets in code. When the steps are known in advance, a fixed workflow is cheaper, faster and easier to test than an agent.

Example

An agent answering "Which of my three open orders ships last?" calls list_orders, then get_shipment three times, then answers: five model calls and about 18,000 input tokens in total.