Learn · AI Engineering
What is an AI agent?
An AI agent is software that uses a language model to plan and take multi-step actions toward a goal, calling tools (APIs, databases, other systems) along the way. The minimal pattern: a model + a set of tools + a control loop. The model decides which tool to call next based on what it has seen so far.
Updated · 2026-05-04 · 6 min read
An agent vs. a chatbot
Chatbots respond and wait. Agents take action. A chatbot answering "where is my order?" reads from a knowledge base and replies with a generic delivery-time line. An agent handling the same query queries the orders API, checks the shipping system, identifies a delay, drafts a refund offer, posts it to the ticket queue, and emails the customer.
Same input — fundamentally different system. The agent's output is not just text; it's text plus a sequence of side-effecting actions.
The minimal pattern
Strip every popular framework — LangGraph, AutoGPT, CrewAI, Pydantic AI — back to the essentials, and you find three components running in a loop:
- 01A model. Usually a frontier-tier LLM (Claude, GPT, Gemini) for tool-using reasoning.
- 02A set of tools. Typed function definitions the model can invoke. Each tool has a name, description, JSON-schema input, and a runtime that returns a result.
- 03A control loop. Call the model with the conversation history; if the model requests a tool, run it and append the result; loop until the model produces a final answer or hits a termination condition.
Production agents add evaluation, guardrails, observability, and human-in-the-loop checkpoints around that core loop.
Real examples
Customer-support deflection agent
Reads the ticket, queries orders/shipping/billing APIs, drafts a reply, and either posts directly (low stakes) or queues for human review (refunds, escalations). Typical AISD outcome: 25–40% auto-resolution.
Document processing pipeline
Inbound contracts/claims/invoices → OCR → schema-validated extraction → routing. Exceptions go to a human queue. 30–50% reduction in human review time is typical.
Sales-research agent
For each lead: gather a recent news angle, identify the buyer persona, draft a personalized opener, write back to the CRM with a confidence score. 2–4× research throughput per SDR.
When to use an agent (and when not to)
Use an agent when the task involves multi-step reasoning + side-effecting actions — looking up data, deciding what to do with it, then doing it. Use a simpler pattern (a single LLM call, RAG over a knowledge base, a deterministic workflow) when the task is one-shot.
Agents add cost (more tokens per task, more failure modes) and complexity (eval harness, observability, prompt-injection defense). They earn that cost when the workflow has high volume and structured outputs — and don't when the workflow is rare or the output is hard to validate.