Agents & Tools
Letting your AI take actions, not just generate text. Tool use, chains, multi-agent patterns.
An agent is an LLM that can reason about how to accomplish a goal, plan steps, take actions by calling tools, observe results, and adjust. The key difference from a simple API call: agents operate in a loop.
The ReAct pattern
- Think. Reason about the current state and what to do next.
- Act. Choose and execute a tool.
- Observe. See the result.
- Repeat or finish.
When NOT to use agents
- Single-step tasks. If you can do it in one API call, an agent loop is overhead.
- No external actions needed. If you just need to answer from documents, use RAG.
- Deterministic output required. Agents are unpredictable by nature.
Agents break in ways that prompts don't. If you build an agent, you need guardrails: maximum step limits, cost controls, and confirmation gates for any action that changes data or costs money. Log everything. And before you build any of this: have you validated that users actually need this level of automation?
Multi-agent systems
Common patterns: Supervisor (one agent coordinates others), Pipeline (agents process in sequence), Debate (agents argue different perspectives). For most products, a single agent with well-designed tools is more than enough.