Building with AI

Agent planning

4 min readadvancedUpdated 28 Sept 2026
1 · In one line

Agent planning is how an AI agent splits a big task into smaller steps first, then carries out those steps one by one.

1 · What it is

A simple AI agent picks one action, looks at the result, then picks the next. Agents can also use tools: other software the agent can run, such as a database query or a call to another service (an API). That works for simple jobs, but on a long task the agent only sees one step ahead and can drift.

Agent planning adds an explicit planning step before the work starts. The agent writes a plan, a list of smaller tasks, then works through them in order. Say you want numbers on each quarterback playing in this year’s Super Bowl. A shortened version of its plan has three steps: search for the teams, find each team’s quarterback, then look up each player’s stats. Because later steps reuse earlier answers, the agent does not have to re-plan after each one.

While it works, the agent reads each result to check its progress. If the first plan fails, it can write a follow-up plan. Agents can also pause for a person at checkpoints. Another style, called ReAct, mixes thinking steps with actions. That lets the model build, track and update its plan as it goes.

For engineers: researchers sort planning methods into five groups: task splitting, choosing between plans, outside helpers, reflection and memory. One plan-choosing method, Tree of Thoughts, scores several possible paths and can back out of dead ends.

2 · Why it exists

An agent that picks one action at a time can lose sight of the whole task.

One step aheadA step-by-step agent plans only the next small piece, so its path through a long task can wander.
Slow and costlyIt asks the language model again before every single tool call.
Early mistakes stickSome tasks depend heavily on the first choices, and a model writing one step at a time can fall short on them.
3 · How it works

Follow one question from goal to answer.

Plan shortened from an example LangChain gives for a plan-first design called ReWOO; the re-plan loop comes from plan-and-execute agents. Later steps point back to earlier results.
  1. 1 · goalA person gives the agent a task or talks it through with it.
  2. 2 · planA planner asks a language model to write a multi-step plan for the whole task.
  3. 3 · actAn executor takes each step of the plan and calls one or more tools to do it.
  4. 4 · checkAfter the steps run, the agent decides whether to answer or to write a follow-up plan.

Planning means deciding the steps before doing them, then fixing the plan when results say it is wrong.

4 · Where it's used
WhoWhat they askWhat it works with
Sports fan“How did each quarterback in this year's Super Bowl play this season?”A search plan whose later steps reuse the teams and players found earlier
Coding assistant“Make this change across the whole codebase”A list of files to change, worked out for this task rather than fixed in advance
HuggingGPT user“A request that needs several AI models”A task plan that picks a Hugging Face model for each subtask
Puzzle solver“Solve the Game of 24 puzzle”Several possible paths, scored so the model can back out of dead ends
5 · What it solves, and what it doesn't
solves
  • Thinking through every step first can raise how often the agent finishes the task, and how well.
  • A large model can do the planning while smaller, cheaper models handle each step.
  • In tests with GPT-3, a plan-first prompt beat plain step-by-step prompting on every dataset tried.
  • On the Game of 24 puzzle, exploring several paths raised GPT-4's success rate from 4% to 74%.
doesn't solve
  • A plan is a guess. The agent still needs real results from tools at each step to see if it is on track.
  • Errors can build up over a long run, and more autonomy means higher cost.
  • An agent can keep going too long, so builders add limits such as a maximum number of steps.
  • A good plan does not fix calculation errors. Plan-and-Solve needed extra, more detailed instructions for those.