What is the plan-and-execute pattern?
The plan-and-execute pattern is an agent architecture in which an agent first builds a plan splitting the task into steps, then executes them in sequence or in parallel, updating the plan when needed; planning and execution often use separate model calls.
Unlike Reasoning and Acting, which reasons and picks an action at every step before waiting for the observation, plan-and-execute builds the plan up front without rethinking at each step. This cuts model calls but needs replanning if an unexpected observation invalidates the plan.
- Topic
- Agents and protocols
How the plan-and-execute pattern works
- A planner model splits the task into steps with stated dependencies.
- An executor runs each step with tools or a smaller model; independent steps can run in parallel.
- Step results are gathered and fed into later steps.
- If a step fails or returns something unexpected, the planner updates the plan; finally the answer is assembled.
In more detail
Parallel execution with a dependency graph (DAG)
When independent plan steps are structured as a directed acyclic graph (DAG), as in LLMCompiler, the executor can run parallel tool calls concurrently and substitute outputs via variable placeholders without waiting on the planner. This cuts end-to-end latency dramatically compared to strictly sequential execution.
Partially observable settings and bounded replanning
Pure up-front planning struggles in partially observable environments, such as exploratory database querying or debugging, where step 3 cannot be formulated until step 1's schema or error output is known. Production systems therefore cap replanning iterations (max-replans) and blend high-level milestones with local ReAct-style sub-loops inside each step.
Asymmetric model routing, time to first action and safe replanning
Plan-and-execute naturally supports asymmetric model routing: a strong reasoning model serves as the planner once, while a smaller, faster on-premise model or deterministic API executes individual steps. However, generating the full plan up front increases time-to-first-action (TTFA) compared to streaming ReAct and any tool output fed back to the replanner must be treated as untrusted input against indirect prompt injection.
Commonly confused terms
| Term | How it differs |
|---|---|
| Plan-and-solve prompting | Plan-and-Solve prompting is a single-turn zero-shot chain-of-thought prompting instruction asking one LLM to break a problem down before solving, whereas the plan-and-execute pattern is a multi-call agent orchestration loop with distinct planner, executor/tool and replanner roles. |
| Chain of thought and tree of thoughts | Chain-of-Thought and Tree-of-Thoughts explore internal reasoning steps within the LLM itself, while plan-and-execute orchestrates external tool executions, dependencies and state updates across an agent workflow. |
Why the plan-and-execute pattern matters for on-premises AI
The paper proposing plan-and-solve prompting shows first devising a plan dividing a task into smaller subtasks, then following it, reduces missing-step errors in zero-shot chain of thought. A paper decoupling reasoning from tool observations reports planning up front and gathering observations afterwards gave 5 times token efficiency and a 4% accuracy gain on a multi-step question answering benchmark while staying robust to tool failures. Showing the plan before execution also enables human approval.
An accounting team's month-end close agent first drafts a plan with bank reconciliation, accrual checks and report generation; steps run once a specialist approves the plan, with the plan updated if a reconciliation difference appears.
Common questions
How does plan-and-execute differ from ReAct?
ReAct reasons and picks an action at each step. Plan-and-execute builds the plan up front and runs steps without returning to the planner each time.
What if the plan is wrong?
A failed or unexpected result returns to the planner, which updates the plan. For critical work the plan can go to a human for approval before execution.
Related terms
Sources
- Wang et al., Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Models, 2023
- Xu et al., ReWOO: Decoupling Reasoning from Observations for Efficient Augmented Language Models, 2023
In the glossary: Glossary, M to Q