Single Agent Patterns: Plan-Then-Execute
Intent
Separate deliberation from action: produce an explicit multi-step plan first, then execute steps, optionally replanning on failure.
Introduction
While the step-by-step reasoning of a Reason and Act (ReAct) loop is highly adaptive, it exhibits significant limitations when applied to long-horizon, complex tasks. In unconstrained loops, errors can compound quickly, the context window can overflow with detailed execution traces, and the agent is susceptible to losing the high-level goal or wandering into infinite loops. The Plan-Then-Execute pattern resolves these issues by explicitly separating the thinking phase (deciding *what* to do) from the execution phase (doing it).
Structure of the Pattern
The Plan-Then-Execute architecture divides the execution lifecycle into distinct stages managed by specialized components:
- Planner: A high-capability language model parses the initial user prompt and outputs an explicit multi-step plan (often structured as a task list, a timeline, or a Directed Acyclic Graph - DAG).
- Executor: A decoupled engine (which can be a smaller, faster model, or a deterministic parser/runtime) executes the plan's tasks sequentially or in parallel, invoking tools and recording outputs.
- Monitor: A validation layer tracks execution state, logs success metrics, and checks if execution outcomes align with the plan. If a step fails, or if environmental feedback contradicts the plan's assumptions, it halts execution and invokes a **Replanning Loop**, passing the current system state back to the Planner for adjustments.
Decoupling planning from execution was formalized under methodologies like **Plan-and-Solve Prompting** [1]. Rather than forcing the model to generate both thoughts and actions simultaneously, this pattern allows the system to structure its entire action path beforehand, enabling more coherent behavior on long-horizon objectives.
Trade-offs
Separating planning from execution offers significant architectural advantages but introduces unique complexities:
Improved Long-Horizon Coherence
Decoupling the high-level roadmap from step-by-step mechanics ensures the model doesn't get sidetracked or lose its place over dozens of steps.
Legibility & Parallelization
Plans are easily readable, permitting human-in-the-loop review. Independent steps can be executed in parallel (e.g. parallel SDK builds).
Plan Stale Rate
Plans created with incomplete initial information can quickly go stale once tool execution begins and the environment responds unpredictably.
Rigid Plan Adherence
A classic failure mode is rigid adherence to a flawed or outdated plan without dynamic checking, leading to wasted execution steps.
Known Uses
The Plan-Then-Execute pattern is widely used across multi-task schedulers and production scaffolds:
- Plan-and-Solve Prompting: Structured zero-shot prompting techniques that command models to "first devise a plan, then solve it step-by-step" to avoid reasoning failures [1].
- HuggingGPT: An orchestration manager that delegates tasks to multiple models. It leverages ChatGPT as a planner to parse input requests, map them to specific HuggingFace model APIs, and orchestrate their sequential executions [2].
- "To-Do List" Scaffolds in Coding Agents: Sophisticated IDE and software engineering agents that produce formal checklist states (like a local
task.md), updating progress markers (`[x]`, `[/]`, `[ ]`) as they code and debug.
References
-
[1]
Wang, L., Xu, W., Lan, Y., Hu, Z., Lan, Y., & Lim, E. P. (2023). Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning in Large Language Models. International Conference on Learning Representations (ICLR).
https://arxiv.org/abs/2305.04091 -
[2]
Shen, Y., Song, K., Tan, X., Li, D., Lu, C., & Zhou, Y. (2023). HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face. Neural Information Processing Systems (NeurIPS).
https://arxiv.org/abs/2303.17580