ReAct: Teaching LLMs to Think, Act, and Observe

ReAct teaches an LLM to solve problems by interleaving thought, action, and observation. This is key for agents that search the web or query APIs to answer questions with external data.
Why it exists
Large language models are good at reasoning internally (via Chain-of-Thought) but are disconnected from the real world, unable to access new information. Conversely, action-oriented models can interact with systems but lack abstract reasoning. ReAct was created to combine reasoning and acting into a single, more capable framework.
The mental model
Think of a detective solving a case. They don't just sit and ponder. They form a hypothesis (Thought), go interview a witness or search a database (Action), analyze the new information (Observation), and then refine their hypothesis for the next step. ReAct formalizes this Thought -> Action -> Observation loop for an LLM.
How it works
ReAct prompts an LLM to generate output in a structured format that interleaves reasoning and actions. For a given task, the model first produces a Thought, which is its internal monologue about what to do. It then produces an Action, which is a command for an external tool (e.g., a search engine or API). An outer system executes this action and passes the result back to the model as an Observation. This loop continues until the model concludes it has solved the task.
When to use it
Use ReAct when a task requires information outside the model's training data or requires interaction with the world. This is essential for building agents that need to answer questions about current events, query private databases, execute code, or interact with APIs to book appointments or make purchases.
When not to use it
For self-contained tasks that rely only on the model's internal knowledge, ReAct is unnecessary overhead. Standard prompting is more efficient for creative writing, summarizing provided text, or answering general knowledge questions where real-time data is not a factor. The ReAct loop adds latency for no benefit in these cases.
One canonical example
A user asks, "What was the score of the last Lakers game?" A ReAct agent would first think: "I need to find the most recent Lakers game and its score." It would then generate an Action: search('Los Angeles Lakers last game score'). The system executes the search and returns the Observation: "Lakers vs. Nuggets, 119-108." The agent then thinks: "I have the final score." It then synthesizes and delivers the final answer to the user.
Interview question
Which scenario best illustrates the primary advantage of using the ReAct framework for an LLM?
- a.Solving a complex logical puzzle using only the model's pre-trained knowledge.
- b.Summarizing a lengthy document provided directly to the model.
- c.Answering a question that requires current, real-world data.Correct
- d.Generating a creative story based on a user's prompt.
Why? this is the answer
The ReAct framework is designed for tasks requiring information outside the model's training data or interaction with the world, making it ideal for answering questions with current, real-world data. Tasks like creative writing, summarization, or purely internal logical puzzles do not leverage ReAct's core benefit of external interaction and would incur unnecessary overhead.
Just read this? Test yourself on what you have been reading.
Read the original → research.google
- #llm
- #generative ai
- #prompting
- #agent
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on llm — each one lists the topics its interview covers.
See open roles