AI Agents path

🤖 Using AI & AI Agents

Chapter 13 of 24

📐 Chapter 13: Planning: Goals and Task Decomposition

Define goals, break into subtasks, structured output, iterative planning

Planning means defining a clear goal and breaking it into subtasks. The agent (or a dedicated planner) produces a structured output (e.g. JSON) with a main task and a list of subtasks, each assigned to an agent or tool. Downstream systems run the subtasks and optionally re-plan when the environment or user feedback changes.

Planning flow: goal → plan → execute

Goal: "Plan a 3-day trip to Paris"
Planner (LLM or planner agent) decomposes into subtasks
{ main_task: "...", subtasks: [ { assigned_agent: "flight_booking", task_details: "..." }, { assigned_agent: "hotel_booking", task_details: "..." }, ... ] }
Execute subtask 1
Execute subtask 2
↓ (optional) if something fails or user changes mind
Re-plan and re-execute

Goal → subtasks → structured output

Goal

Generate a 3-day travel itinerary.

↓ decompose

Flight booking
Hotel booking
Car rental
Personalization

↓ assign to agents / tools

{ "main_task": "...", "subtasks": [{ "assigned_agent": "flight_booking", "task_details": "..." }] }

Example: Travel plan

Goal: "Plan a family trip to Melbourne." Subtasks: book flights, find family hotels, rent a car, list activities. The planner outputs e.g. assigned_agent: flight_booking, task_details: "Book round-trip flights". Each specialized agent or tool then executes its part; a coordinator compiles the result.