Planner-Executor Agent

Split a task into an explicit plan, execute steps one at a time, and re-plan only when a step fails.

planningdecompositionmulti-step
Setup time2-4 hours (estimate)
Estimated costOne planning call plus one call per step; replanning adds more.
ToolsPython
VerificationNot yet independently verified

Separating planning from execution makes long tasks more reliable and cheaper: a strong model plans once, a cheaper model can execute individual steps.

Steps

  1. Plan: ask the planner model for a JSON list of steps, each with id, goal, and done_when.
  2. Execute: for each step, give the executor only the overall goal, the current step, and results of prior steps.
  3. Check: verify the step against done_when (programmatically where possible).
  4. Re-plan: on failure, send the plan, completed results, and the error back to the planner for a revised remaining plan.
  5. Finish: synthesize a final answer from step results.

Planner prompt

You are a planner. Break the user's goal into 3-8 sequential steps.
Return ONLY JSON: {"steps":[{"id":1,"goal":"...","done_when":"..."}]}
Each step must be independently executable and verifiable.
Do not include steps that require information the user has not provided
unless a tool can obtain it. Goal: {{goal}}

Control flow

max_replans: 2
planner_model: strong-reasoning-model
executor_model: fast-cheap-model
on_step_failure: replan
on_replan_exhausted: return_partial_with_error

Failure modes

Markdown version: /blueprints/planner-executor.md

Want a deeper build of this?

Vote for an extended, fully tested version (more tools, a full workflow file). Votes decide what we build next.

– votes

Get one fully built blueprint a week

A weekly email: one blueprint with config, cost, setup time and failure modes, plus a vote on what we build next.

Related blueprints