Skip to main content
ModelTerms

Agents & Tools · intermediate

ReAct (Reasoning and Acting)

ReAct is a prompting pattern that interleaves reasoning ("Thought:") with actions ("Action:") and observations ("Observation:"). It is the foundation of most tool-using agents.

Explanation

In a ReAct loop the model outputs a thought (free-form reasoning), then an action (e.g., a tool call), receives an observation (the tool's output), then thinks again. This continues until the model decides it has enough information to answer.

The pattern's power is that the model's reasoning steers tool use rather than tool use being hard-coded. Most modern agents — from search-augmented chat to coding agents — are ReAct or ReAct-flavored under the hood.

Examples

  • A search-augmented assistant: Thought, Search, Observation, Thought, Answer.
  • A coding agent: Thought, Read file, Edit, Run tests, Thought, Done.

Frequently asked

What is ReAct?

ReAct is a prompting pattern that interleaves reasoning ("Thought:") with actions ("Action:") and observations ("Observation:"). It is the foundation of most tool-using agents.

What is an example of react?

A search-augmented assistant: Thought, Search, Observation, Thought, Answer.

How is ReAct related to Agent?

ReAct and Agent are both agents & tools concepts. An AI agent is an LLM-driven system that decides which actions to take, executes them via tools, observes the results, and iterates until a goal is met.

Is ReAct considered intermediate?

ReAct is generally considered intermediate-level material in the AI and LLM space.

AgentAgents & Tools

An AI agent is an LLM-driven system that decides which actions to take, executes them via tools, observes the results, and iterates until a goal is met.

Tool UseAgents & Tools

Tool use is when an LLM can call external functions — APIs, code interpreters, databases, web fetchers — and read their results. The mechanism that turns chat into action.

Function CallingAgents & Tools

Function calling is the specific API mechanism by which an LLM emits a structured request to invoke a named function with typed arguments. The OpenAI-popularized way to do tool use.

Chain-of-ThoughtPrompting

Chain-of-thought prompting asks the model to show its reasoning step by step before giving a final answer. It dramatically improves performance on multi-step problems.

ReflexionAgents & Tools

Reflexion is a pattern where an agent runs, observes failures, generates a short natural-language "reflection" on what went wrong, and retries with that reflection appended to its prompt — improving via self-critique without weight updates.

Plan-and-ExecuteAgents & Tools

Plan-and-execute splits agent loops into a planning step (produce the full step list up front) and an execution step (run each step). Cheaper than per-step ReAct and easier to inspect.

Workflow vs AgentAgents & Tools

A workflow is a deterministic pipeline where humans hard-code the LLM call sequence. An agent lets the LLM decide which steps to take. Anthropic's recommended default is workflow first, agent only when needed.

Side-by-side comparisons

Sources