06 Agentic Systems 3 min read 604 words

Planning and Decomposition (Dec 2025)

Planning is the "System 2" component that allows agents to solve multi-stage problems without "wandering." In late 2025, we have moved from simple "Chain-of-Thought" to Recursive Decomposition and Tree Search.

planningagentsreasoningcore
01spectrum

The Planning Spectrum

MethodStrategyComplexityBest For
LinearOne step at a timeLowSimple tools
BranchingIf-Then-Else logicMediumConditional flows
HierarchicalMaster-Plan -> Sub-PlansHighSoftware engineering
Search-BasedTry multiple paths internallyMaxScientific Research
02dynamic planning

Static vs. Dynamic Planning

2.1

Static (Plan-and-Solve)

The agent writes a 10-step plan and follows it strictly.

  • Pros: High performance, easy to parallelize.
  • Cons: Brittle. If step 2 fails, steps 3-10 are useless.
2.2

Dynamic (Adaptive)

The agent writes a plan, but Re-evaluates after every tool call.

  • 2025 Best Practice: Use Checkpointed Planning. The agent is forced to "Commit" its progress to a state store after every major sub-goal to allow for recovery and "Backtracking" if the plan fails.
03o1 reasoning

CoT and o1 Reasoning

In 2025, the model's internal "Thinking" window (Inference scaling) is used as a Hidden Planner.

  • Instead of using a separate "Planner LLM," we use a reasoning model (o1/R1) to generate a "Mental Draft."
  • This draft is translated into a Task DAG (Directed Acyclic Graph) that the orchestrator executes.
04task decomposition

Recursive Task Decomposition

For massive tasks (e.g., "Build a full-stack app"), we use Sub-Agent Spawning.

  1. Master Agent: Decomposes "Project" into "Frontend," "Backend," and "DB."
  2. Sub-Agents: Each receives a "Sub-Goal" and performs its own decomposition.
  3. Consolidation: The Master Agent merges the results.

Critical Nuance: Each sub-agent is given a Minimal Context (only what it needs) to prevent token bloat and hallucination.

05search mcts

Tree Search (MCTS)

For high-stakes decisions, we use Monte Carlo Tree Search (MCTS) within the agent loop.

  • The agent "Simulates" 10 possible tool calls.
  • A Reward Model (or a separate LLM prompt) scores each simulation.
  • The agent follows the path with the highest reward.
06questions

Interview Questions

Q: How do you prevent an agent from "Infinite Recursion" during task decomposition?

Strong answer: We implement Decomposition Depth Limits (usually 3 levels) and Granularity Checks. Before spawning a sub-agent, we ask the Supervisor model: "Is this task small enough to be solved by a single tool call?" If yes, we execute. If no, we decompose. We also use a Global Controller that tracks the total "Agent Count" to prevent a recursive bomb (fork bomb) that could drain the API budget.

Q: Why is "Plan Revision" often more expensive than "Plan Generation"?

Strong answer: Plan generation is a "Fresh Start." Plan revision requires Context Re-evaluation—the model must understand what was already done, why the previous step failed, and how to fix it without undoing previous successes. This requires a much higher "Reasoning Density." In production, we often use a larger model (e.g., Sonnet 3.7 or o1) for the Revision step, while using a smaller model for the initial plan generation.

07references

References

  • Silver et al. "Mastering the game of Go with deep neural networks and tree search" (Applied to LLMs, 2024/2025)
  • Wang et al. "Self-Consistency Improves Chain of Thought Reasoning" (2022/2025 update)
  • LangGraph. "Multi-Agent Planning Patterns" (2025)

Next: Error Handling and Recovery

summary · added by this rebuild

Key takeaways

01

Static plans break at step two

A ten-step plan is fast and easy to parallelise but useless once an early step fails; adaptive planning re-evaluates after every tool call at the cost of extra model calls.

02

Checkpoint progress to allow backtracking

Committing state to a store after each major sub-goal is what makes recovery and backtracking possible, instead of discarding the whole plan and restarting from the beginning.

03

Sub-agents get minimal context deliberately

Each spawned sub-agent receives only what its own sub-goal requires, which the page frames as a defence against token bloat and hallucination rather than just a cost saving.

04

Recursion needs a hard depth limit

About three levels, plus a granularity check asking whether a task fits in one tool call, plus a global agent counter to stop a fork bomb from draining the API budget.

05

Revision costs more than planning

Re-planning means understanding what was done, why it failed, and what not to undo, so the page spends a larger model on revision and a smaller one on the first plan.