AI agent
An AI that can take actions, not just answer. Agents use LLMs with tool access (search, code execution, APIs) to complete multi-step tasks autonomously. Examples: Claude Code, Cursor, AutoGPT. The shift from 'chatbot' to 'doer' AI.
- Automated workflows (research, coding, data processing).
- Complex tasks needing multiple steps.
- When human oversight is possible.
- Simple Q&A (use a chatbot).
- When reliability is critical.
- When actions can't be reversed.
- Cost-sensitive applications.
Definition
An AI agent is an LLM with tools and a goal. It plans, executes actions (calls APIs, writes code, searches), observes results, and iterates — often in a loop until the task is done. Frameworks: LangChain, LangGraph, CrewAI, AutoGen. Agents can use MCP tools.
Why it exists
Chatbots answer questions but can't do things. Agents can act — write and run code, call APIs, browse the web — making AI useful for real tasks, not just information.
How it works
User gives a goal. The LLM plans, picks a tool (function call), executes it, sees the result, plans the next step. Loop until done. Tools: search, code exec, API calls, file ops. Frameworks manage the loop, memory, and tool use.
Scaling limits
Unreliable (LLMs hallucinate, make wrong tool calls). Expensive (many LLM calls). Security risk (agents can take harmful actions). Debugging complex multi-step chains is hard.
Cost shape
Expensive — multiple LLM calls per task. Cost scales with task complexity and model choice.
Alternatives
- Single LLM call — Simpler, cheaper, but no tool use or iteration.
- Traditional automation — Reliable, deterministic, but no AI reasoning.
Failure modes
- Hallucinated tool calls.
- Infinite loops.
- Security risks (unauthorized actions).
- Cost overruns.
- Unpredictable behavior.
Related terms
LLM (Large Language Model), MCP (Model Context Protocol), Function calling, LangChain, Claude Code