Agents & tools
ReAct pattern
Definition
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.
ReAct interleaves thinking and doing. Each cycle produces a thought ("I need the current price"), an action (call the search tool), and an observation (the result), which feeds the next thought.
Making reasoning explicit helps in two ways: the model chooses tools more sensibly, and you get a readable trace for debugging. When an agent goes wrong, the trace usually shows exactly which reasoning step was flawed.
It underpins most agent frameworks, including n8n's AI Agent node and LangChain's agent executors. The essential safeguard is a hard step limit — open-ended ReAct loops are the classic cause of runaway API bills.
Related terms
AI agent
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.
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.
Chain-of-thought prompting
Chain-of-thought prompting asks a model to work through its reasoning step by step before answering. It measurably improves accuracy on maths, logic, and multi-step problems by forcing intermediate steps instead of an immediate guess.
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.
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.