Agent planning is how an agent decides on a sequence of steps to reach a goal, either before it starts acting or as it goes. Task decomposition is the part that breaks a goal into smaller units: which tools are needed, what has to be retrieved, in what order, and when to stop and ask a person.
It is worth being precise about what a plan is in an LLM agent, because the word imports expectations from classical AI planning, where a planner searched a formal state space with defined preconditions and effects. In most agent systems today, the plan is text the model produced. It has no guaranteed relationship to what the tools can actually do, and nothing enforces that the agent follows it. That is not a criticism, it is the operating condition, and designs that ignore it break in predictable ways.
Planning matters because the path is often the product. An answer that is correct after nine redundant tool calls, or after reading a record the user was not entitled to, is not a good outcome. Output-only checks score it as a pass.
Build better agents with Arize
Trace, evaluate, and learn. Build agents that work with Arize AX and start tracing your runs today.
Prefer open source? Try Arize Phoenix for self-hosted, open source agent observability.
Key takeaways
- Planning is the decision about step sequence. Task decomposition is the part that turns one goal into units of work.
- Plan-then-execute makes the intended path inspectable before anything runs. Interleaved reasoning and acting adapts better to what tools actually return. Most systems need some of both.
- A plan produced by a model is a suggestion, not a contract. Measure plan adherence separately from plan quality.
- Replanning is a design requirement, not an edge case. Decide in advance what happens when step three fails or returns something unexpected.
- Evaluate plans on necessity, ordering, groundedness in available tools, and policy compliance, because a correct final answer can hide a bad path.
Plan first, or plan as you go
Plan-then-execute. The agent produces a step list up front, then an executor runs it. The advantages are concrete: you can show the plan to a user for approval, estimate cost before spending it, cache or reuse plans for recurring tasks, and see the intended path in a trace as one artifact. The weakness is that the plan was written before any evidence arrived. When step two returns nothing, the remaining steps may be nonsense.
Interleaved reasoning and acting. The agent reasons about one step, takes it, reads the result, and decides again. This is the pattern behind the ReAct style of alternating thought and action, and it handles surprise well because every decision sees the latest observation. The cost is that no one, including the agent, knows the full path in advance, and there is nothing to approve before execution starts.
Hierarchical. A coarse plan at the top, interleaved decisions inside each step. This is where most systems that handle long tasks end up. You get an inspectable shape and local adaptability, at the price of two levels to debug.
The choice is not ideological. If the task has regulatory or cost constraints, plan first so someone can check. If the environment is unpredictable, interleave. If runs take twenty steps, do both.
Replanning
An agent that cannot revise its plan will follow it off a cliff. Replanning needs three things specified.
A trigger. A tool error, an empty result, a contradiction with an earlier observation, a step that exceeded its budget, or an explicit check that the remaining steps still make sense.
A scope. Retry the failed step, replace the remainder of the plan, or start over. Replacing everything on any failure is expensive and loses work. Retrying forever is the loop you will find in your cost report.
A limit. A cap on replanning cycles. Without one, an agent facing an impossible subtask will rewrite the plan until something else stops it.
Evaluating plans
The final answer tells you nothing about whether the path was sound, so score the plan directly. Useful criteria:
- Necessity. Does every step contribute. Redundant retrieval and duplicate lookups are the most common waste.
- Sufficiency. Would executing the plan actually answer the question, or does it stop one step short.
- Ordering. Are dependencies respected. Does it write before it reads.
- Groundedness. Does every step map to a tool that exists, with arguments the tool accepts. Plans that reference imaginary capabilities are common and easy to detect.
- Policy. Does the plan stay within permissions, and does it pause for approval where it should.
- Adherence. Did the agent do what its plan said. This one needs the plan and the trace side by side, and the gap is frequently larger than teams expect.
These are trajectory-level checks, which is why they belong with the failures that traditional software tests miss rather than with output assertions. In practice you run them as evaluators over recorded runs, scoring the plan span against the tool spans that followed it, which is a standard part of tracing and evaluating an agent rather than a separate exercise. For guidance on testing agent behavior, see agent evaluation.
When not to plan
Explicit planning costs a model call, adds latency, and can make simple tasks worse by committing the agent to a shape before it has looked at anything. A two-step lookup does not need a plan. Neither does a task where one tool obviously answers the question. Add planning when the step count is variable, when steps have dependencies, when a wrong order is expensive, or when someone needs to approve the path before it runs.
FAQ
What is a planner agent?
A component, sometimes its own agent, whose job is producing the step list rather than executing it. Separating planning from execution lets you use a stronger model for the plan and cheaper ones for the steps, and it gives you a clean artifact to evaluate and approve. The cost is a handoff, and handoffs lose context.
What is the difference between planning and task decomposition?
Decomposition breaks a goal into units of work. Planning includes decomposition and adds ordering, dependencies, tool assignment, and stopping conditions. In casual use the terms overlap, and most sources use them interchangeably.
Should the plan be structured output or free text?
Structured, if you intend to do anything with it. A JSON list of steps with a tool name and arguments per step can be validated against your tool registry before execution, compared against what actually ran, and scored automatically. Free text plans read well and are difficult to check mechanically.
How do you improve long-horizon planning?
There is no single fix, and anyone offering one is selling something. The changes that tend to help are reducing the horizon by decomposing into sub-tasks with their own termination, keeping a compact record of what has already been tried so the agent stops repeating itself, checking progress against the plan at intervals rather than only at the end, and giving the agent fewer and better-described tools so each step has less room to go wrong.
Why does the agent ignore its own plan?
Because nothing makes it follow the plan. The plan is text in the context window, and it competes with the most recent tool output for the model’s attention, usually losing. If adherence matters, enforce it in code: have the executor take steps from the plan rather than asking the model what to do next.
Plan-and-execute
Plan-and-execute is a planning pattern where an agent writes an explicit list of steps first, then carries out those steps in order.
During execution, the agent checks its progress against the plan. It replans when a step fails or the situation changes.
The main advantage is that the plan is something a reviewer can inspect before and during execution. A wrong breakdown of the task shows up at step 1, not only in the final answer.
For example, suppose an agent is asked to resolve a billing dispute. Its plan might look like this:
- Look up the account and the disputed charge.
- Check the refund policy that applies to that charge type.
- Decide the remedy the policy allows.
- Issue the remedy, or escalate with the evidence gathered.
The agent works through the steps in order and records each result. Suppose step 2 shows the charge type is excluded from refunds. The agent stops and replans toward escalation instead of improvising a remedy at step 4.
How steps are sequenced and supervised across tools and agents is covered in agent orchestration. The step-by-step execution itself runs inside the agent control loop.
Plan-and-execute vs. ReAct
ReAct (reason and act) interleaves reasoning and action. The agent decides the next step, acts, observes the result, and then decides again. Plan-and-execute commits to the full breakdown up front and revises it at checkpoints.
Each style fits a different kind of task:
- Predictable tasks: Use plan-and-execute when the task breaks down in a predictable way and a bad early choice is cheap or easy to review.
- Exploratory tasks: Use the interleaved ReAct style when each observation really does change the next step. Examples include exploratory debugging, open-ended research, and tools with hard-to-predict outputs.
In practice the two often combine. The agent follows a plan, executes each step with observe-and-adjust behavior, and replans when a result contradicts the plan’s assumptions.
How to evaluate a plan-and-execute agent
Evaluate the plan itself, not only the outcome. Check three things:
- Plan quality: Was the breakdown complete and in the right order?
- Adherence: Did execution follow the plan?
- Replanning: Did the agent replan when it should have?
A run can reach the right answer by quietly abandoning a broken plan. That run still has a planning defect, and the final answer hides it. This kind of path-level check is what agent-run evaluation describes.
Make the plan, each step result, and every replan visible in the trace. You can then tell whether a failure came from planning, execution, or replanning, instead of scoring it as one general miss.
Costs of plan-and-execute
The pattern has real costs:
- Upfront overhead: Planning adds latency and tokens before the agent takes any action.
- Stale plans: A plan that no longer fits the situation, followed faithfully, is worse than no plan.
- Error buildup: Later steps inherit every earlier error, so long plans need checkpoints.