Preview — full styling will appear after the next deploy completes.

agentic-ai-patterns

Plan-and-Execute

Explicit upfront planning

A planner LLM breaks the task into steps before execution begins. An executor then runs each step in sequence, and a synthesizer merges all outputs into a final answer.

flowchart TD
    S([__start__]) --> P[planner]
    P --> X[executor]
    X -->|more steps| X
    X -->|all steps done| Y[synthesizer]
    Y --> E([__end__])

Plan-and-Execute adds a dedicated planning phase before any tool calls happen. A planner LLM reads the user's task and emits an ordered list of sub-steps. This separation lets the agent think holistically about the task before diving into execution — resulting in more coherent multi-step answers.

The executor works through the plan one step at a time, running a mini ReAct loop per step. Each step's result is stored in the graph state and made available to the next. Once all steps are complete, a synthesizer LLM merges the partial results into a single polished answer.

Use Plan-and-Execute when tasks have a predictable structure (research → compare → recommend) and you want the agent's reasoning to be auditable. The explicit plan in state makes it easy to log, monitor, and retry individual steps without re-running the whole pipeline.