Zenaique

Flashcard: what is the ReAct prompting pattern?

Flashcard·Easy·4.0 · 0·~30s·Asked atBraintrustCoinbaseMidjourney·Relevant atAmazonAnthropicAppleLangChain
Attempt it
TL;DR

ReAct interleaves reasoning and tool calls in a structured Thought-Action-Observation loop, ending in a Final Answer; it is the substrate for most modern agent frameworks.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine a detective solving a case out loud. They say I think the answer might be X, so let me check the records, then they actually walk to the records room and look something up, then come back and say okay, the records say Y, so now I think Z. ReAct makes the LLM behave the same way. The model writes a Thought (its reasoning), then an Action (what tool it wants to use), then the orchestrator runs the tool for real and writes back the Observation (what came back). The loop repeats until the model has enough information to write a Final Answer. The model itself cannot run tools; it just describes what tool to run, and a separate program (the orchestrator) does the actual running.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

ReAct is the prompting pattern that made agents practical. Before ReAct, LLMs were one-shot text generators: send a prompt, get an answer. After ReAct, the same model could iteratively call tools, observe results, and refine its approach across many steps. Almost every modern agent framework (LangChain, LlamaIndex, AutoGen, CrewAI, OpenAI Assistants) implements some variant of the ReAct loop under the hood.

This deep dive walks through the structure of the ReAct loop, explains exactly which side (model or orchestrator) produces which text, names the implementation mechanics that make the loop robust in production, and connects raw-text ReAct to the structured tool-calling APIs that frontier models now expose.

The structure of the loop

ReAct stands for Reason plus Act. The loop has four labels:

code
Thought: <the model's reasoning about what to do next>
Action: <a tool call, e.g. search('Python release date')>
Observation: <the actual result returned by the tool>
Thought: <next reasoning step that uses the observation>
Action: <next tool call, or no action if the model is ready>
Observation: <next tool result>
...
Final Answer: <the model's final response to the user>

The pattern is iterative. At each step the model produces a Thought (its reasoning) and an Action (a proposed tool call). The orchestrator runs the action against the real tool, captures the result, and writes it back as the next Observation. The model picks up reasoning from there. The loop continues until the model emits a Final Answer line, which signals it has enough information to respond.

The key insight is the separation of concerns. The model generates language; the orchestrator handles execution and state. The model cannot make a real web search or run a real SQL query; it can only describe what it wants to do. The orchestrator translates the description into an actual call, runs it, and feeds the result back into the prompt for the next iteration.

Who writes what (model vs orchestrator)
Production mechanics: tools, errors, and limits
Native tool-calling: ReAct in structured form
Failure modes and observability
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Yao et al.'s 2022 ReAct paper introduced the pattern on HotpotQA and ALFWorld benchmarks, showing it beat plain CoT and plain action-only baselines.
  • LangChain's AgentExecutor and LangGraph implement ReAct as a default agent pattern, used across thousands of production LLM applications.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow does native tool-calling (Claude tool_use, OpenAI function-calling) differ from raw-text ReAct, and what does it solve?
A

Native tool-calling uses structured API messages with typed schemas instead of free-form text. It solves parsing reliability (no regex hacks to extract Action arguments), schema validation, and parallel tool calls. Semantics are identical to ReAct.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Thinking the LLM actually executes tools; the model only proposes actions, an orchestrator runs them and feeds the real results back as observations.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • What ReAct stands for (Reason + Act) and what each component does

  • The four labels in the loop (Thought, Action, Observation, Final Answer)

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is the Model Context Protocol (MCP) and what problem does it solve?
MCQ·Easy