Course contentsShow
← Machine Learning and Deep Learning
Lesson 1897 of 3,53840. Advanced Prompting TechniquesFree lesson

ReAct Framework Overview

Understanding the ReAct paradigm that interleaves reasoning traces with task-specific actions for problem-solving.

ReAct Framework Overview

What you'll learn: How the ReAct framework combines reasoning and acting to solve complex problems through interleaved thought and action steps.

The Core Idea

ReAct (Reasoning + Acting) is a prompting paradigm that explicitly alternates between reasoning traces (thinking about what to do) and task-specific actions (actually doing something, like calling a tool or API). Unlike Chain-of-Thought that focuses purely on internal reasoning, ReAct acknowledges that many real-world problems require both thinking and interacting with the environment.

Think of it like a detective solving a case: they don't just sit and deduce everything in their mind. Instead, they think about what clue to pursue next, act by investigating that clue, observe what they find, then think again about what it means, continuing this cycle until the case is solved.

How ReAct Works

A ReAct trajectory looks like:

  1. Thought: "I need to find the current weather in Paris"
  2. Action: search("weather Paris today")
  3. Observation: "Temperature: 18°C, Cloudy"
  4. Thought: "Now I know the weather. The user also asked about tomorrow..."
  5. Action: search("weather Paris tomorrow")
  6. Observation: "Temperature: 22°C, Sunny"
  7. Thought: "I have all the information needed"
  8. Answer: "Today it's 18°C and cloudy, tomorrow 22°C and sunny"

The reasoning traces make the model's decision-making process transparent and help it plan multi-step solutions, while actions ground the reasoning in real information retrieval or tool use.

Key Takeaway: ReAct interleaves reasoning ("Thought") and acting ("Action") steps, enabling LLMs to solve problems that require both internal reasoning and external information gathering or tool usage.