Agentic AI / Patterns

Planning

Intermediate [3/5]
Task decomposition Goal decomposition Plan generation

Definition

Planning in AI agents refers to breaking down complex goals into actionable steps, determining the order of operations, and creating a structured approach to task completion. Good planning enables agents to tackle multi-step problems systematically.

Planning transforms vague goals into concrete action sequences that can be executed step by step.

Key Concepts

  • Decomposition: Breaking big tasks into smaller subtasks
  • Sequencing: Ordering steps for logical execution
  • Dependency tracking: Understanding which steps need others first
  • Re-planning: Adapting plan when obstacles arise

Examples

Approaches
Planning Strategies
PLANNING APPROACHES: 1. TOP-DOWN DECOMPOSITION Goal: Build a website ├─→ Design │ ├─→ Wireframes │ └─→ Visual design ├─→ Development │ ├─→ Frontend │ └─→ Backend └─→ Deployment ├─→ Testing └─→ Launch 2. PLAN-AND-EXECUTE (Upfront) ┌────────────────────────────────┐ │ Create complete plan first │ │ ↓ │ │ Execute steps sequentially │ │ ↓ │ │ Re-plan only if blocked │ └────────────────────────────────┘ 3. DYNAMIC RE-PLANNING ┌────────────────────────────────┐ │ Plan next few steps │ │ ↓ │ │ Execute │ │ ↓ │ │ Observe results │ │ ↓ │ │ Adjust plan, repeat │ └────────────────────────────────┘ 4. HIERARCHICAL PLANNING High-level plan (abstract goals) ↓ Mid-level plan (concrete tasks) ↓ Low-level plan (specific actions)
Example
Agent Planning in Action
GOAL: "Analyze competitor pricing and create a report" PLANNING PHASE: Think: "This task requires multiple steps: 1. First, I need to identify competitors 2. Then gather their pricing data 3. Analyze the data for insights 4. Create a formatted report Let me plan dependencies: - Steps 2-4 depend on step 1 - Steps 3-4 depend on step 2 - Step 4 depends on step 3" GENERATED PLAN: ┌─────────────────────────────────────────────┐ │ Step 1: Identify Competitors │ │ - Search for companies in same market │ │ - Filter to top 5 direct competitors │ │ Dependencies: None │ ├─────────────────────────────────────────────┤ │ Step 2: Gather Pricing Data │ │ - Visit each competitor website │ │ - Extract pricing information │ │ - Record in structured format │ │ Dependencies: Step 1 │ ├─────────────────────────────────────────────┤ │ Step 3: Analyze Data │ │ - Compare pricing tiers │ │ - Calculate averages and ranges │ │ - Identify positioning opportunities │ │ Dependencies: Step 2 │ ├─────────────────────────────────────────────┤ │ Step 4: Create Report │ │ - Summarize findings │ │ - Create comparison table │ │ - Add recommendations │ │ Dependencies: Step 3 │ └─────────────────────────────────────────────┘ EXECUTION: "Now executing Step 1: Identify Competitors..." [Tool: web_search("competitors in [industry]")] ... "Step 1 complete. Moving to Step 2..."

Interactive Exercise

Create a Plan

Create a plan for this goal: "Set up automated email marketing for a new product launch"

Pro Tips
  • Plans should have verifiable completion criteria for each step
  • Include contingency steps for likely failure modes
  • Keep plans flexible—rigid plans fail in dynamic environments
  • Shorter plans are usually better; decompose further only when needed

Related Terms