Pattern · intermediate
Plan-and-Execute Pattern
Plan-and-execute agents draft a multi-step plan first, then carry out steps with optional re-planning.
- planning
- orchestration
Plan-and-execute separates planning from doing. The agent drafts a plan, executes steps, and revises the plan when observations invalidate it.
When to use
- Multi-hop research
- Tasks with natural phases (gather → analyze → write)
- When you want an inspectable plan for HITL approval
Structure
1) Plan: [step1, step2, step3]
2) Execute step i → observation
3) If blocked: re-plan remaining steps
4) Finalize
Pros
- Better global coherence than pure greedy ReAct
- Plans are reviewable artifacts
- Easier to parallelize independent steps
Cons
- Bad plans waste work
- Re-planning adds latency
- Over-planning simple tasks
Production tips
- Keep plans short (5–9 steps)
- Attach success criteria per step
- Allow early stop when criteria met
- Use cheaper models for routine step execution
Variants
- Plan once (no replan) for stable environments
- Hierarchical planning for large projects
- Human-approved plans for risky domains
Frequently asked questions
What is plan-and-execute in agents?
Plan-and-execute is a pattern where the agent creates a multi-step plan up front, executes steps (often with tools), and re-plans when reality diverges.
Related reading
ReAct Pattern
ReAct interleaves reasoning traces with tool actions so agents can think, act, and observe in a loop.
Reflection and Self-Critique Pattern
Reflection patterns add a critique step so agents can check work, catch errors, and improve outputs before finalizing.
How to Build a Research Agent
Step-by-step design for a web research agent: goals, tools, planning, citations, evaluation, and safety limits.