AI Glossary / Agents and automation / Intermediate

ReAct

ReAct (Agents and automation)

Definition

ReAct is a prompting and agent design pattern in which a language model alternates between reasoning steps and actions. The name joins the words reasoning and acting. The model writes a short thought, calls a tool such as a search or a database lookup, reads the result, and repeats until it can answer. It is a pattern, not a product, and implementations differ in detail.

What it means

A plain language model answers from what it learned in training. It cannot check today's price list or open a customer record. It may also produce a confident answer that is wrong. ReAct gives the model a way to look things up before it commits to an answer, and it makes the steps visible so a person can follow them.

In business terms, ReAct turns a one-shot question into a short working session. The model plans a step, takes it, looks at what came back, and decides what to do next. This is the core loop behind many tool-using AI agents. If you can read the log of thoughts and actions, you can audit the work.

How it works

A ReAct setup starts with a prompt that describes the task and lists the tools the model may use, for example search_orders or read_policy. The prompt also shows the format to follow, usually a line starting with Thought, then a line starting with Action and its input, then a line the system fills in with Observation.

The model writes the first Thought and Action. The surrounding program, not the model, runs the action and appends the result as an Observation. The model then reads the whole transcript so far and writes the next Thought and Action. This cycle repeats. When the model decides it has enough, it writes a final answer instead of another action.

The program around the model must set limits. Typical limits include a maximum number of steps, a list of allowed tools, and rules for what happens when a tool fails. Without limits, the loop can run on, repeat the same call, or act on a bad observation. Many current products use built-in tool calling rather than the exact Thought and Action text format, but the loop of reason, act, observe is the same idea.

Three practical examples

  • Finance team: An analyst asks why travel spending rose last quarter. The agent reasons that it needs the expense totals, queries the ledger by category, sees that one month is high, queries that month by employee group, and then writes a summary naming the group. Each query is logged so the analyst can verify it.
  • Retailer: A shopper asks whether a jacket is in stock in a nearby store. The agent reasons that it needs the product ID, looks it up, checks inventory for that store, finds zero, checks a second store, and replies with the closest location that has the item.
  • Support desk: A customer reports a late refund. The agent reads the ticket, looks up the order, checks the refund policy document, sees the refund was approved but not issued, and drafts a reply for a human agent to review before sending.

Think of it this way

Think of a new employee solving a problem with a notepad. They write what they plan to check, check it, write what they found, then decide the next check. The notepad is the transcript. The analogy stops working because a person knows when a result looks odd and stops, while the model follows the loop even when an observation is wrong, unless the system around it forces a stop.

Worked example

A small distributor wants to estimate the cost of a rush order. The agent has two tools: get_unit_cost and get_shipping_rate.

Step 1 Thought: I need the unit cost of part A. Action: get_unit_cost(A). Observation: $12.50.

Step 2 Thought: I need the rush shipping rate for 200 units. Action: get_shipping_rate(200, rush). Observation: $180 flat.

Step 3 Thought: I can now compute the total. Parts cost 200 x $12.50 = $2,500. Add shipping of $180. Total = $2,500 + $180 = $2,680. Cost per unit = $2,680 / 200 = $13.40.

The agent used two tool calls and one calculation, and the transcript shows every number it relied on. If the shipping rate had been wrong in the source system, a reviewer could see exactly which observation caused the error.

Illustrative case study

Fictional case: Larkspur Home Supply, a regional hardware wholesaler, built a ReAct-style assistant to answer questions from its sales staff about stock and delivery dates. Early tests looked good. Then staff noticed the assistant sometimes quoted a delivery date after a single inventory lookup, even when the warehouse system showed the item was on backorder.

The team read the transcripts and found the cause. The model sometimes treated an empty search result as proof that no backorder existed. They changed three things. The inventory tool now returned an explicit status field instead of a blank. The prompt told the model to state when a tool returned no data rather than guess. The system capped each question at six steps and flagged any answer that skipped the backorder check. Over the next month the team reviewed a weekly sample of transcripts. Wrong delivery quotes fell to a level the sales manager accepted, and the transcripts became the main way the team found new problems.

Common misconceptions and mistakes

ReAct makes the model's answers correct. It makes them checkable, not correct, because the model can still misread a tool result or pick the wrong tool, so review of the transcript still matters.

ReAct is a product you buy. It is a design pattern, and you can build it yourself or find it inside agent frameworks under different names.

The visible thoughts show exactly how the model decided. The written thoughts are text the model generated, and they are a useful trace but not a guaranteed account of its internal process.

More steps always give better answers. Long loops can compound errors, raise cost and wander off task, so a step limit is a safety feature.

Business use

Start with a narrow, low-risk task that needs two or three lookups, such as answering internal policy questions or checking order status. Give the agent read-only tools first. Write the tool descriptions clearly, set a step limit, and log every thought, action and observation. Have a person review a sample of transcripts each week before widening the scope or adding tools that can change data.

Measure the share of answers judged correct on a fixed test set, the average number of steps and tool calls per task, the rate of tasks that hit the step limit, and how often a reviewer overrides the result. Costs come from model usage on every loop pass and from building and maintaining the tools. The main risks are acting on wrong observations, tools with too much permission, and sensitive data appearing in logs. Require human approval for any action that spends money, sends messages or edits records.

People also ask

What does ReAct stand for?

It stands for reasoning and acting. The model alternates between writing a reasoning step and taking an action with a tool.

Is ReAct the same as an AI agent?

Not exactly. An agent is a broader idea of a system that pursues a goal with tools. ReAct is one common way to structure how such an agent thinks and acts.

Do I need ReAct for a simple chatbot?

Usually not. If a question can be answered from a prompt or a single retrieved document, a loop adds cost and complexity without much benefit.

Check your understanding

What are the three parts that repeat in a ReAct loop?

Answer: A thought, an action, and an observation. The model writes the thought and action, and the system supplies the observation.

In the worked example, what was the total cost and the cost per unit?

Answer: The total was $2,680, from 200 x $12.50 = $2,500 plus $180 shipping. The cost per unit was $2,680 / 200 = $13.40.

Why did Larkspur cap each question at six steps?

Answer: To stop the loop from wandering or repeating, and to flag answers that skipped a required check.

Who runs the tool call in a ReAct setup, the model or the surrounding program?

Answer: The surrounding program runs it and adds the result as an observation. The model only proposes the action.

Related terms

  • AI agent
  • Tool use
  • Agentic workflow
  • Human-in-the-loop
  • Prompt engineering
  • Retrieval-augmented generation
  • Function calling
  • Chain of thought

Learn next

Try a small ReAct-style task by hand: write out the thoughts, actions and observations for a question you answer at work, and note where a tool could help. Then read about chain of thought to see how reasoning alone differs from reasoning with tools, and about human in the loop to plan where approval should sit.

  • Human-in-the-loop

More in Agents and automation

  • Process mining - Process mining is a family of techniques that reconstruct how a business process actually runs by analyzing the timestamped event logs that software systems...
  • Proto-agent - A proto-agent is one of two semantic proto-roles from linguistics: the participant in an event who acts, causes, moves or experiences, as opposed to the...
  • Rational agent - A rational agent is an agent that, given what it has perceived, chooses the action expected to achieve the best outcome according to its performance measure.
  • Reactive agent - A reactive agent is a software system that chooses each action by looking only at what it senses right now and applying fixed rules or a learned mapping...
  • Reflection - Reflection is a workflow strategy in which an AI system examines an earlier output or action result before deciding what to do next.
  • Reflexion - Reflexion is a technique in which an AI agent attempts a task, receives feedback on the result, writes a short natural-language reflection on what went...

Sources

Yao et al., ReAct: Synergizing Reasoning and Acting in Language Models: https://arxiv.org/abs/2210.03629 Anthropic, Building effective agents: https://www.anthropic.com/engineering/building-effective-agents Wei et al., Chain-of-Thought Prompting Elicits Reasoning in Large Language Models: https://arxiv.org/abs/2201.11903 The sources were consulted for the definition of the reasoning and acting loop and for guidance on building tool-using agents; the examples, analogy, worked example and case are original educational illustrations. Checked 10 Nov 2026.

Previous: Reachable set Next: Reactive agent

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer