See how AI agents use planning to handle complex, multi-step tasks. Learn task decomposition, sequential execution, and error handling through a complete example of booking meetings and sending summaries.

This article is part of the free-to-read AI Agent Handbook
Example: Planning with Our Assistant
You've learned how to break down tasks and implement plan-and-execute patterns. Now let's see these concepts in action with a realistic scenario that brings together everything our assistant has learned so far.
A Complex Request
Imagine you send this message to your personal assistant:
This isn't a simple, single-step task. It requires coordination across multiple systems, retrieving historical information, and executing several actions in the right order. Let's watch our assistant plan and execute this request step by step.
The Planning Phase
When our assistant receives this request, it doesn't immediately start booking meetings or sending emails. Instead, it enters a planning phase where it breaks down the goal into manageable subtasks.
Here's how the assistant might decompose this request:
Here's a breakdown of the steps needed to complete this request: 1. **Check your calendar availability for next week** to identify potential meeting times. 2. **Check Alice's calendar availability for next week** (or contact her to confirm her availability). 3. **Identify a mutually available time slot** that works for both schedules. 4. **Send a meeting invitation to Alice** with: - Date and time - Subject: "Q4 Marketing Campaign Discussion" - Duration (suggest 30-60 minutes) - Meeting location or video call link 5. **Gather Q3 marketing campaign data and results**, including: - Key metrics and KPIs achieved - Completed projects/initiatives - Budget spent vs. allocated - Successes and challenges 6. **Draft a summary document of Q3 accomplishments** in a clear, organized format. 7. **Review and finalize the Q3 summary** for accuracy and completeness. 8. **Send the Q3 summary to Alice via email** with sufficient time before the meeting (ideally 1-2 days in advance) so she can review it. 9. **Confirm Alice has received both the meeting invitation and Q3 summary** and follow up if needed.
The assistant generates this plan:
Notice how the assistant has identified dependencies on its own. You can't schedule a meeting before checking availability, and you should send the summary before the meeting gets scheduled so Alice has context when she accepts. This kind of dependency awareness is what makes planning valuable.
Executing the Plan
Now our assistant moves through each step, using the tools and capabilities we've built in previous chapters.
Step 1-3: Finding a Meeting Time
Available times for both: ['2025-11-17 14:00-15:00', '2025-11-18 10:00-11:00']
The assistant has now completed the first three steps of its plan. It found two possible meeting times.
Step 4-5: Retrieving and Summarizing Q3 Work
Next, the assistant needs to gather information about Q3 marketing activities. This is where memory and retrieval come in.
Subject: Q3 Marketing Summary Hi Team, I wanted to share our key marketing accomplishments from Q3: **Social Media & Partnerships** - Launched new social media campaign generating 50K impressions - Secured partnerships with 3 influencers for product reviews **Email & Web Optimization** - Redesigned email templates, improving open rates by 15% - A/B tested landing pages with Version B outperforming by 22% **Events** - Successfully executed webinar series with 500 total attendees Strong quarter overall with measurable improvements across multiple channels. Best regards
The assistant generates a summary:
Step 6: Sending the Summary
Sending email to alice@company.com Subject: Q3 Marketing Summary - Ahead of Our Q4 Planning Meeting Body: Subject: Q3 Marketing Summary Hi Team, I wanted to share our key marketing accomplishments from Q3: **Social Media & Partnerships** - Launched new social media campaign generating 50K impressions - Secured partnerships with 3 influencers for product reviews **Email & Web Optimization** - Redesigned email templates, improving open rates by 15% - A/B tested landing pages with Version B outperforming by 22% **Events** - Successfully executed webinar series with 500 total attendees Strong quarter overall with measurable improvements across multiple channels. Best regards Email status: sent
Step 7-8: Scheduling and Confirming
Task completed! Here's what I did: ✓ Found available time: 2025-11-17 14:00-15:00 ✓ Retrieved and summarized Q3 marketing accomplishments ✓ Sent summary to Alice at alice@company.com ✓ Scheduled meeting: "Q4 Marketing Campaign Planning" The meeting is confirmed for 2025-11-17 14:00-15:00. Alice has received the Q3 summary in advance.
What Made This Work
Let's unpack what just happened. Our assistant successfully handled a complex, multi-step request by combining several capabilities:
Planning: The assistant didn't just react to the request. It thought ahead, identified dependencies, and created a logical sequence of actions.
Tool Use: Multiple tools came into play - calendar APIs for checking availability, a memory system for retrieving past work, and email services for communication. The assistant knew which tool to use at each step.
Memory and Retrieval: The assistant pulled relevant information from its long-term memory about Q3 marketing activities. Without this capability, it couldn't have generated an accurate summary.
Reasoning: When finding a meeting time, the assistant had to reason about overlapping availability. It understood that both parties need to be free at the same time.
State Management: Throughout execution, the assistant maintained state about what it had accomplished, what remained to be done, and what information it had gathered. This prevented it from repeating steps or losing track of progress.
Handling Complications
Real-world scenarios rarely go perfectly. Let's see how our assistant handles a complication.
Suppose when the assistant tries to retrieve Q3 notes, the memory system returns incomplete information:
A well-designed assistant might respond:
This demonstrates adaptive planning. When the original plan hits an obstacle, the assistant can recognize the problem and adjust its approach.
Bringing It All Together
This example shows how planning transforms our assistant from a simple question-answering tool into something that can handle real work. The key elements that made this possible:
Task Decomposition: Breaking "book a meeting and send a summary" into eight concrete steps made the complex request manageable. Without decomposition, the assistant might have tried to do everything at once or missed important steps.
Sequential Execution: Following the plan in order, with each step building on the previous ones, ensured nothing was forgotten or done out of sequence. The assistant knew to check calendars before scheduling and to send the summary before creating the meeting invite.
Tool Orchestration: The assistant coordinated multiple tools (calendar, memory, email) to accomplish different parts of the task. Each tool served a specific purpose, and the assistant knew when to invoke each one.
Contextual Awareness: Throughout execution, the assistant maintained awareness of the overall goal and how each step contributed to it. This prevented it from getting lost in the details or forgetting why it was performing certain actions.
Graceful Handling: When problems arise, the assistant can recognize them and adapt rather than blindly continuing. This makes the difference between a brittle system that breaks easily and a robust one that handles real-world messiness.
Design Considerations
As you build planning capabilities into your own agents, consider these trade-offs:
Plan Detail vs. Flexibility: Highly detailed plans are easier to execute but harder to adapt when things change. More abstract plans are flexible but require more reasoning at each step. For our assistant, we chose medium-detail plans that specify what to do but allow some flexibility in how.
Upfront Planning vs. Incremental Planning: Should the agent plan everything before starting, or plan a few steps and then replan? Upfront planning works well for predictable tasks. Incremental planning handles uncertainty better but adds overhead. Our example used upfront planning because meeting scheduling is fairly predictable.
Error Recovery Strategies: When a step fails, should the agent retry, skip it, ask for help, or abort entirely? The right choice depends on the consequences of failure. For our assistant, we chose to ask for help when critical information is missing, since sending incomplete information could damage professional relationships.
You now have an assistant that doesn't just respond to requests but actively works to accomplish goals. In the next chapter, we'll explore how multiple agents can work together, enabling even more sophisticated capabilities through collaboration and specialization.
Glossary
Task Decomposition: The process of breaking down a complex goal into smaller, manageable subtasks that can be executed sequentially or in parallel.
Tool Orchestration: Coordinating multiple different tools or APIs to accomplish various parts of a larger task, ensuring they work together effectively.
Sequential Execution: Performing planned steps in a specific order, where each step may depend on the results of previous steps.
Adaptive Planning: The ability to recognize when a plan isn't working and adjust the approach, either by replanning or by asking for additional information.
State Management: Maintaining awareness of what has been accomplished, what remains to be done, and what information has been gathered during task execution.
Quiz
Ready to test your understanding? Take this quick quiz to reinforce what you've learned about planning in AI agents.
Reference

About the author: Michael Brenndoerfer
All opinions expressed here are my own and do not reflect the views of my employer.
Michael currently works as an Associate Director of Data Science at EQT Partners in Singapore, where he drives AI and data initiatives across private capital investments.
With over a decade of experience spanning private equity, management consulting, and software engineering, he specializes in building and scaling analytics capabilities from the ground up. He has published research in leading AI conferences and holds expertise in machine learning, natural language processing, and value creation through data.
Related Content

Skip-gram Model: Learning Word Embeddings by Predicting Context
A comprehensive guide to the Skip-gram model from Word2Vec, covering architecture, objective function, training data generation, and implementation from scratch.

Plan and Execute: Turning Agent Plans into Action with Error Handling & Flexibility
Learn how AI agents execute multi-step plans sequentially, handle failures gracefully, and adapt when things go wrong. Includes practical Python examples with Claude Sonnet 4.5.

Breaking Down Tasks: Master Task Decomposition for AI Agents
Learn how AI agents break down complex goals into manageable subtasks. Understand task decomposition strategies, sequential vs parallel tasks, and practical implementation with Claude Sonnet 4.5.
Stay updated
Get notified when I publish new articles on data and AI, private equity, technology, and more.


Comments