Skip to content

< CollectionsPaper

ReAct.

ReAct: Synergizing Reasoning and Acting in Language Models

Yao et al. · 2022 · arXiv 2210.03629

Read the paper (opens in a new tab)

Interleave a thought, an action and the observation it returns, and let each one decide the next.

5 sections · 8 problems · 1 project

0 of 9 done

Start Next: 01 Run a ReAct Loop on Plain Text

Fig. 1. The agent laps the loop: call the model, run the tool, read the result, decide. When the model says end_turn, it takes the exit to the answer.

Section 01

Act, observe, repeat

0 of 3

The paper: The model writes a thought, then an action; the harness runs it and appends the observation, which feeds the next step.

  1. 01Run a ReAct Loop on Plain Textimplement · medium
  2. 02Dispatch a Model's Tool Callimplement · easy
  3. 03Build a Tool-Calling Agent Loopharness · medium

Section 02

Choose the action

0 of 2

The paper: Actions come from a fixed set the model is told about, and choosing one well is part of the reasoning.

  1. 04Route a Question to the Right Toolimplement · medium
  2. 05Refuse the Arguments a Model Inventedimplement · medium

Section 03

Get out of the loop

0 of 2

The paper: A common failure is the model repeating its earlier thoughts and actions without moving on.

  1. 06Detect an Agent Stuck in a Loopharness · medium
  2. 07Stop the Loop Inside a Dollar Budgetimplement · medium

Section 04

Read the trajectory

0 of 1

The paper: Because the reasoning is written down, a person can read the trajectory and see where it went wrong.

  1. 08Find the First Turn That Went Wrongimplement · medium

Section 05

Build it

0 of 1

Beyond the paper: The whole loop, from one reply to a working agent.

  1. 09agent-step-by-stepproject
All collections