📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials AI Agents and Automation ReAct Framework

ReAct Framework

6 min read Quiz at the end
ReAct interleaves Thought-Action-Observation loops enabling agents to use tools to solve multi-step problems.

ReAct: Reason + Act

ReAct is the foundational agent prompting pattern — the model interleaves Thought (reasoning), Action (tool call), and Observation (result) to solve multi-step problems.

# ReAct prompt structure
You have access to these tools:
- search(query): Search the web
- calculator(expr): Evaluate math
- python(code): Execute Python code

Always respond in this format:
Thought: [your reasoning]
Action: tool_name(arguments)
Observation: [result will be filled in]

# Example trace
Question: What is the GDP of France divided by its population?

Thought: I need France GDP and population.
Action: search("France GDP 2024")
Observation: France GDP is $3.1 trillion.

Thought: Now I need population.
Action: search("France population 2024")
Observation: France population is 68 million.

Thought: Calculate GDP per capita.
Action: calculator(3100000000000 / 68000000)
Observation: 45588.24

Final Answer: France GDP per capita is approximately $45,588.
Topic Quiz · 1 questions

Test your understanding before moving on

1. In ReAct prompting what does Act mean?
💡 Act in the ReAct framework means invoking a tool (search, calculator, code execution) to get real data.