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

Plan-and-execute

Watch an agent write a whole plan first, then run it 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.03 · AGENT BAYTASK + 4 TOOLS · 79 TOKENS
01
Stage 1 of 6 · Task and roles
Plan-and-execute splits an agent into a planner and an executor.
Explain it simply

At the top is the trip from the ReAct lesson: three cities, two nights in each, and a budget. The planner box is the big language model. The executor box is a small helper that calls the four tools. Only the tools can see real prices.

The task asks for a trip from Lisbon to Paris, Rome and Berlin, under 1,200 euros. A planner box, an executor box and four tools: flights, hotels, weather and calculator.

The big model is a fixed rule policy, not a trained language model.
task, resultstoolsproblemsplan steps, answer#n links
Task: LIS → PAR, ROM, BER → LIS · 2 nights in each city · under €1,200planner (big model)1 call · reads 79 tokensexecutorruns the stepsflights×0hotels×0weather×0calculator×0task and rolesTask: LIS → PAR, ROM, BER → LIS · 2 nights in each city · under €1,200planner (big model)1 call · reads 79 tokensexecutorruns the stepsflights×0hotels×0weather×0calculator×0task and roles
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
planner←(task, tools)\sy{plan}{out}{\text{planner}} \leftarrow (\sy{task}{data}{\text{task}},\ \sy{tools}{param}{\text{tools}})
∣task+tools∣=79 tokens|\text{task} + \text{tools}| = 79\text{ tokens}

The planner reads the task and the tool list.

Common mix-ups

MYTHA plan written up front still works when the world changes.

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

Predict, then reveal
3 CHECKS · PRO
Q01If every seat is free, how often does the big model run?

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.