ReAct Pattern

Master the ReAct pattern to build intelligent agents that synergize reasoning and acting

What is the Action Phase?

After reasoning about what to do, agents enter the action phase where they execute concrete operations. Actions are the bridge between thinking and doingโ€”they interact with:

  • External APIs - Search engines, databases, web services
  • Computation Tools - Calculators, code interpreters, simulators
  • Data Sources - Files, knowledge bases, real-time feeds
  • User Interfaces - Forms, notifications, confirmations

Every action produces an observationโ€”a result that feeds back into the next reasoning phase, creating the ReAct loop.

Interactive: Execute Actions

Click on actions to see them execute and observe the results

Click an action above to execute it

Thought โ†’ Action โ†’ Observation

๐Ÿ’ญ

1. Thought

"I need to find the population of Tokyo to answer this question"

โšก

2. Action

Search(query="Tokyo population 2024")

๐Ÿ‘๏ธ

3. Observation

Result: "Tokyo metropolitan area has approximately 37.4 million people"

Why Actions Matter in ReAct

๐ŸŒ
Ground in Reality
Actions connect reasoning to real-world data, preventing pure speculation
๐Ÿ“Š
Provide Feedback
Observations validate or refute hypotheses, enabling adaptation
๐Ÿ”„
Enable Iteration
Each action's result informs the next thought, creating a learning loop
โš™๏ธ
Extend Capabilities
Tools and APIs give agents powers beyond language understanding alone