Planning loops

ReAct makes one decision at a time: think, act, observe, repeat. Planning loops flip that: think about the whole task first, write out the plan, then execute the plan step by step. The plan adds structure. Execution keeps flexibility. For tasks with 8+ steps or for anything you want to review before running, planning loops are the right shape.

The pattern

  1. Plan: prompt the model to produce a structured list of steps. "Research Y by doing these 5 things."
  2. Execute: orchestrator walks the list. At each step, it calls the right tool or runs a mini ReAct loop.
  3. Synthesize: final LLM call combines the step results into the user-facing answer.

Why plan first

Three concrete wins over pure ReAct:

When planning helps vs doesn't

A worked example: "Research the top 3 competitors for product X"

Plan phase, model writes:

1. Identify top 3 competitors of X (web_search)
2. For each, fetch their pricing page (web_fetch, parallel)
3. For each, fetch their product page (web_fetch, parallel)
4. Extract key features from each (llm call per competitor)
5. Write comparison table (synthesize)

Execute phase: steps 2 and 3 run in parallel for 3 competitors (6 fetches, simultaneously). Total wall time: ~6 seconds instead of ~20 if done sequentially. Plan saved time and gave you a reviewable artifact.

Hybrid: plan + ReAct inside each step

The most robust shape in production. Outer loop is a plan. Inner loop at each step is a small ReAct agent. Plan gives the skeleton; ReAct handles tactics when a step turns out to be trickier than expected ("fetch failed, try a different URL").

Replanning triggers

Plans go stale. Hard-code these replan triggers:

When triggered, the agent generates a new plan from the current state (what it knows now, what's already been done).

Plan-prompt craft

A planning prompt is different from a ReAct prompt. Include:

Bad planning prompts produce 15-step plans for 3-step tasks. Good prompts produce tight, parallelizable plans.

Pitfalls

What to do with this