Agents & tools
AI agent
Definition
An AI agent is a system where a model plans and takes actions through tools in a loop, rather than producing a single response. It decides what to do next, does it, observes the result, and continues until the goal is met.
The distinguishing feature is the loop. A chatbot answers; an agent reasons about what it needs, calls a tool, reads the output, and reasons again. That loop is what lets it complete multi-step work like researching a topic across several sources or fixing a failing test.
Agents introduce failure modes that single prompts do not have. They can loop indefinitely, take costly wrong turns, and compound early mistakes across subsequent steps. Every production agent therefore needs explicit limits: a maximum number of steps, a budget, and a clear stopping condition.
The most reliable agents today are narrow. Broad autonomy remains unreliable; a well-scoped agent with three good tools and a clear success criterion works.
Related terms
ReAct pattern
ReAct (Reason + Act) is the core agent loop: the model reasons about what to do, takes an action via a tool, observes the result, then reasons again. It repeats until it can answer.
Function calling
Function calling lets a model request that your code run a specific function with specific arguments. You expose tool definitions; the model returns a structured call, your code executes it, and the result goes back into the conversation.
MCP (Model Context Protocol)
MCP is an open standard for connecting AI models to external tools and data sources. It replaces bespoke per-integration code with one protocol any compatible client can use.
Prompt chaining
Prompt chaining splits a complex task into a sequence of focused prompts, where each step's output feeds the next. Chains are easier to debug and more reliable than one large prompt.
Tool use
Tool use is a model invoking external capabilities — search, code execution, database queries, APIs — to do things it cannot do from parameters alone, such as fetching current data or performing exact arithmetic.
Guardrails
Guardrails are the constraints that keep an AI system inside acceptable behaviour — input validation, output filtering, topic restrictions, action limits and human approval gates.
Put this into practice
Understanding the term is step one. Our free courses and tools let you actually use it.