An AI agent is an LLM in a loop with tools: the model emits structured tool calls against typed tool definitions, a runtime executes them, and the results feed back into the context until the task is done.
Sign in to save progress
An agent repeats four steps until its goal is reached. Press Start to animate the cycle.
Goal: Find the cheapest hotel in Paris under $100
ReAct = Reasoning + Acting interleaved. In modern APIs each ACTION line is a structured function call the runtime executes. Step through each agent move.
Press Next Step or Auto-Play to begin the trace.
Each tool is a typed function definition the model can call. Click a card to see an example call and result.
Complex tasks get broken into parallel subtasks, each handled by a specialist agent.
Orchestrator
Agent
Research Agent
task ↓ / result ↑
Code Agent
task ↓ / result ↑
Writing Agent
task ↓ / result ↑
Arrow labels: task delegation + result return
Autonomy introduces failure modes that don't exist in single-shot LLM calls.
Infinite Loops
Agent keeps searching without a stopping condition, burning tokens indefinitely.
Tool Misuse
Selecting the wrong tool, e.g. web search when precise arithmetic is needed.
Compounding Errors
A small mistake in step 2 gets passed through all subsequent steps.
Prompt Injection
An agent that reads untrusted content (web pages, emails, files) can have its instructions hijacked by text planted in that content.
See the Prompt Injection guide →Key Insight
Modern agents are function calling in a loop: the model emits a structured call against a typed tool definition, and your runtime executes it and returns the result. Because that loop is ordinary code you own, stop conditions, permission checks, and human approval gates belong in the code, not in the model.
Up Next
Structured Output Reliability
Learn how to make model outputs match a schema you can trust.