AI agent
An AI agent is a system where a language model autonomously plans and executes a sequence of tool calls to accomplish a goal.
An agent loops: the LLM observes its state, decides on an action (usually a tool call), executes it via developer-supplied functions, observes the result, and decides the next step until the goal is reached or a stop condition fires. Frameworks like LangGraph, OpenAI Agents SDK, Claude Agent SDK, CrewAI, and AutoGen formalize this pattern. Reliability is the hard problem — agents fail on long horizons, drift off task, and burn tokens. Best practices in 2026: keep each step's context tight, use a planner-executor split, add deterministic guardrails (max steps, budget caps), and evaluate end-to-end success rates, not single-step quality.
When to use ai agent
- Tasks that need real-time tool use (web search, code execution, browser).
- Workflows with branching that depend on intermediate results.
Common mistakes
- Shipping a 50-step agent loop without budget caps or evals.
- Letting the agent's own context grow unbounded — it loses focus by step 15.
- Skipping a planner — pure ReAct loops drift.
FAQ
What is ai agent?
An AI agent is a system where a language model autonomously plans and executes a sequence of tool calls to accomplish a goal.
When should I use ai agent?
Tasks that need real-time tool use (web search, code execution, browser). Workflows with branching that depend on intermediate results.
What are the most common mistakes with ai agent?
Shipping a 50-step agent loop without budget caps or evals. Letting the agent's own context grow unbounded — it loses focus by step 15. Skipping a planner — pure ReAct loops drift.
Related terms
- Function calling (tool use) — Function calling lets a language model emit a structured request to invoke a developer-defined tool, enabling reliable JSON output and agent workflows.
- ReAct pattern — ReAct interleaves Reasoning + Acting in an agent loop — the model writes a thought, then decides to call a tool, then observes the result, then thinks again.
- Reasoning model — A reasoning model is an LLM trained to produce extensive internal chain-of-thought before its final answer, trading latency for higher accuracy on hard problems.
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/agent.md.