Back to Catalog
Agentic AI
Planning & Control Flow
ReWOO
Plan a complete dependency DAG with placeholder variables before any tool runs, then execute and substitute observations into the plan.
Intent & Description
🎯 Intent
Plan a complete dependency DAG with placeholder variables before any tool runs, then execute and substitute observations into the plan.
📋 Context
A team runs a multi-tool agent on tasks where most of the planning could be done in one shot because each step’s structure is determined by the task, not by what the previous step returned. Token cost matters: the agent is called at volume.
💡 Solution
- Three roles: Planner emits a DAG with steps like
t1 = ToolA(x); t2 = ToolB(#t1)using variable references. - Worker executes each tool in dependency order and substitutes real observations for placeholder variables. - Solver reads the resolved trace and produces the final answer. - The planner never sees observations; re-injection cost is eliminated.
Real-world Use Case
- Most planning steps do not depend on early observations and can be planned upfront.
- ReAct-style observation re-injection is the dominant token cost.
- Tools have stable signatures so the planner can reference outputs by variable.
Source
Advantages
- Up to 5x fewer tokens than ReAct on the original benchmarks.
- Plan is fully inspectable before any tool fires.
Disadvantages
- Bad plans are paid for in full; no mid-course correction.
- Not a fit for tasks where observations genuinely redirect planning.