Log inStart free
LESSON 23.02 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

ReAct

Watch an agent think, call a tool and read the result, step by step.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 23.02 · AGENT BAYTASK + 4 TOOLS · 79 TOKENS
01
Stage 1 of 6 · Task and tools
The agent gets a task and 4 tools. Only a tool call can read real prices.
Explain it simply

At the top you see the task: three cities, two nights in each, and a budget. Below it are the four tools the agent can call. The agent can't see a single price yet. To learn one, it has to ask a tool, like a traveller who phones a travel desk.

The task asks for a trip from Lisbon to Paris, Rome and Berlin, under 1,200 euros. Four tools: flights, hotels, weather and calculator.

The model is a fixed rule policy, not a trained language model.
task, observationstoolsproblemsactions, answer
toolsthoughtactionobservationTask: LIS → PAR, ROM, BER → LIS · 2 nights in each city · under €1,200flights(route)hotels(city, under)weather(city)calculator(expr)task and toolstoolsthoughtactionobservationTask: LIS → PAR, ROM, BER → LIS · 2 nights in each city · under €1,200flights(route)hotels(city, under)weather(city)calculator(expr)task and tools
Toy: the 23.C1 trip, 3 cities and 4 tools, 10 steps at most
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
c0=(task, tools)\sy{c}{data}{c_0} = (\sy{q}{data}{\text{task}},\ \sy{tools}{param}{\text{tools}})
∣c0∣=79 tokens|c_0| = 79\text{ tokens}

The first context holds the task and the tool list.

Common mix-ups

MYTHThoughts waste tokens; acting alone gives the same answer.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With PAR→ROM sold out and a €1,000 budget, how many steps does ReAct take?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.