← Table of Contents · Page 100 of 868
THE CORE AGENT LOOP
Part 5 of 12
PLAN-AND-EXECUTE VERSUS STEP-BY-STEP REACTIVE
ReAct is a reactive style.
Reactive means the agent chooses only its very next move, looks at the result, and then chooses again.
There is a second major style called plan-and-execute.
In plan-and-execute, the agent first writes out a complete plan, a numbered list of steps, before it carries out any of them.
Then the harness works through the list.
Each style has strengths and weaknesses.
Consider cooking dinner.
If you are following a recipe you already know, you can plan everything first: chop, boil, mix, bake.
That is plan-and-execute, and it is efficient and easy to check, because anyone can read the plan and say whether it makes sense.
But if you are trying to fix a mystery noise in your car, you cannot plan every step in advance.
What you do next depends on what you find.
If the noise stops when you turn off the air conditioner, you check the air conditioner.
If it does not stop, you check something else.
That is a reactive style, and it adapts to surprises.
Here is a short comparison in words.
Plan-and-execute works best when the task can be split into known steps in advance, when you want a person to approve the plan before anything happens, and when you want to keep costs predictable.
Its weakness is that a plan made at the start may become wrong when real results arrive.
Reactive looping works best when the path is unknown and every result changes what you should do next.
Its weakness is that it can wander, repeat itself, or lose track of the overall goal.
Many real harnesses combine both.
They let the agent write a plan, then follow it reactively, and allow the agent to revise the plan whenever an observation shows the plan is wrong.
This blended approach is sometimes called plan, execute, and replan.
Advertisement
Read Aloud:
0:00 / 0:00