What is the Plan-and-Execute agent pattern?
LLM & AILevel: IntermediateAgent Architectures
What is the Plan-and-Execute agent pattern?
Hints
- Identify the stage: pretraining, adaptation, generation or evaluation.
- Name the inputs, constraints and a case where the approach fails.
Answer
Standard ReAct agents decide one step at a time — can be myopic for long-horizon tasks. Plan-and-Execute separates planning from execution:
PLAN PHASE (expensive model):
User: "Research competitors and write a strategic memo"
Plan:
1. Search for top 5 competitors
2. For each competitor, retrieve key product info and pricing
3. Compare features across competitors
4. Identify our differentiation
5. Write executive memo in prescribed format
EXECUTE PHASE (can use cheaper model):
Step 1: [execute] → results
Step 2: [execute for each competitor] → results
...
Step 5: [write memo using all gathered data] → final output
Benefits: better decomposition for complex tasks; planner can be GPT-4, executor can be GPT-4o-mini (cost savings); progress is trackable; individual step failures don't derail the whole plan if there's a re-planning mechanism.
Source and licence: JustInCache & contributors — Awesome AI Interviews · Apache-2.0