Planning
Planning is how an agent breaks a goal down into an ordered sequence of steps it can execute.
Prerequisites
What Is Planning?
Some goals are too complex to act on in a single step. Planning is the part of an agent that breaks a high-level goal into a sequence of smaller, more concrete steps — deciding what needs to happen, and roughly in what order, before execution actually begins.
Goal
Too Complex for One StepThe high-level outcome the agent wants.
Plan (Ordered Steps)
Before ExecutionWhat needs to happen, roughly in what order.
Execute Step 1
First ActionThe plan turns into real actions.
Execute Step 2
Next ActionFollows the same ordered plan.
Execute Step N
Final ActionThe last step needed to reach the goal.
Key Idea
Planning decides what should happen and in what order; the agent loop is what actually executes each step and reacts to what happens.
Approaches to Planning
- Upfront planning — the agent produces a full plan before executing anything, then works through it step by step.
- Dynamic (interleaved) planning — the agent plans only the next step or two at a time, incorporating the results of each action before deciding what comes next.
- Task decomposition — breaking a large goal into smaller, well-defined sub-goals, each of which may itself need a small plan.
Upfront plans are easier to inspect and reason about before anything happens, but can go stale if early steps reveal information that changes what should happen later. Dynamic planning adapts more naturally to new information, at the cost of being harder to fully predict in advance.
A Real-World Example
Given the goal "prepare a summary of last quarter's support tickets by category," an agent with planning might first produce a plan like: fetch tickets, categorize them, count by category, and generate the summary. If an early step reveals the ticket data is incomplete, a purely upfront plan might fail partway through, while a dynamic planner can adjust — for example, fetching from a different source — before continuing.
Common Mistakes
Committing rigidly to an upfront plan
A plan made before any execution can become wrong once new information appears — some ability to adjust is usually necessary.
Skipping planning for genuinely complex goals
Without any planning step, an agent may take disjointed actions that don't add up to progress on the actual goal.
Confusing planning with the agent loop
Planning decides what should happen; the agent loop is the execution mechanism that carries the plan out and reacts to results.
Not decomposing an overly large goal
A goal that's too broad to act on directly usually needs to be broken into smaller, concrete sub-goals first.
Interview Question
What is planning in an AI agent, and how does it differ from the agent loop?
Planning is how an agent breaks a high-level goal into an ordered sequence of smaller, concrete steps before or during execution. It's distinct from the agent loop — planning decides what should happen and in what order, while the agent loop is the mechanism that actually executes each step and reacts to results. Planning can happen upfront, producing a full plan before acting, or dynamically, planning just the next step or two at a time based on what's happened so far. Dynamic planning adapts better to new information but is harder to fully predict in advance.
What an interviewer may ask next
- Why might an upfront plan become invalid partway through execution?
- How does dynamic planning differ from producing a full plan in advance?
- How does planning relate to the agent loop?
Explain It in 30 Seconds
Planning is how an agent breaks a complex goal into an ordered sequence of smaller steps, either upfront before executing anything or dynamically, one or two steps at a time as new information comes in. It's distinct from the agent loop, which is the mechanism that actually executes each step and reacts to results. Upfront plans are easier to inspect but can go stale; dynamic planning adapts better but is less predictable in advance.