---
title: "Plan-and-execute pattern for AI agents | Agentic Pattern Language"
description: "A planner model writes the whole plan, executors carry out the steps, and the planner replans. Sourced from Xu et al., Kim et al., and LangChain."
url: https://agenticpatternlanguage.com/patterns/plan-and-execute/
---

26 [Systems of agents](https://agenticpatternlanguage.com/#systems-of-agents)

# Plan-and-execute

A planner model writes the whole plan, executors carry out the steps, and the planner replans.

Xu et al., Kim et al., LangChain, Google

[How to read this](https://agenticpatternlanguage.com/notation/)

## Alternatives

* [Plan before coding](https://agenticpatternlanguage.com/patterns/plan-before-coding/)
* [Agent loop](https://agenticpatternlanguage.com/patterns/agent-loop/)
* [Todo list](https://agenticpatternlanguage.com/patterns/todo-list/)

## The problem

An agent that plans one step at a time never reasons about the whole task, and each step costs a call.

> The LLM only plans for 1 sub-problem at a time. This may lead to sub-optimal trajectories, since it isn't forced to "reason" about the whole task.

LangChain [Plan-and-Execute Agents](https://blog.langchain.com/planning-agents/) Feb 13, 2024

> current methods for function calling often require sequential reasoning and acting for each function which can result in high latency, cost, and sometimes inaccurate behavior.

Kim et al. [An LLM Compiler for Parallel Function Calling](https://arxiv.org/abs/2312.04511)

## Therefore

> the "plan-and-execute" design pattern, which separates an LLM-powered "planner" from the tool execution runtime.

LangChain [Plan-and-Execute Agents](https://blog.langchain.com/planning-agents/) Feb 13, 2024

> Planner breaks down a task and formulates a blueprint of interdependent plans, each of which is allocated to Worker.

Xu et al. [ReWOO: Decoupling Reasoning from Observations for Efficient Augmented Language Models](https://arxiv.org/abs/2305.18323)

> When replanning, the intermediate results are sent back from the Executor to the Function Calling Planner which then generates a new set of tasks with their associated dependencies.

Kim et al. [An LLM Compiler for Parallel Function Calling](https://arxiv.org/abs/2312.04511)

## In use

Gemini Deep Research

> When presented with a complex user query, the system first formulates a detailed research plan, breaking the problem into a series of smaller, manageable sub-tasks.

Google [Gemini Deep Research](https://gemini.google/overview/deep-research/)

## Where it breaks

It needs more model calls, and a plan made up front fails when little is known about the environment.

> We notice that for certain tasks where little context about the environment is available, fully relying on foreseeable reasoning becomes impractical.

Xu et al. [ReWOO: Decoupling Reasoning from Observations for Efficient Augmented Language Models](https://arxiv.org/abs/2305.18323)

> We think Plan-and-Execute is great for more complex long term planning, at the cost of more calls to the language model.

LangChain [Plan-and-Execute Agents](https://blog.langchain.com/plan-and-execute-agents/) May 10, 2023

## Sources

1. [ReWOO: Decoupling Reasoning from Observations for Efficient Augmented Language Models](https://arxiv.org/abs/2305.18323) Xu et al.
2. [An LLM Compiler for Parallel Function Calling](https://arxiv.org/abs/2312.04511) Kim et al.
3. [Plan-and-Execute Agents](https://blog.langchain.com/planning-agents/) LangChain, Feb 13, 2024
4. [Plan-and-Execute Agents](https://blog.langchain.com/plan-and-execute-agents/) LangChain, May 10, 2023
5. [Gemini Deep Research](https://gemini.google/overview/deep-research/) Google

Added Nov 14, 2026
