Plan and Execute › Practical Considerations

Michael BrenndoerferJuly 21, 20251 min read
AI Agent HandbookAll chapters
Part 9 of 15Planning - Agents with a Plan
Chapter 25Plan and Execute › Practical Considerations
Reading section 7 of 10 · Practical Considerations · 1 minSection 7 of 10 · 1 min

Book contents

Section 7 of 10 · 1 min read

Plan and Execute › Practical ConsiderationsOne section · Sections in this chapter7 / 10 ↓

As you build plan-and-execute agents, keep these principles in mind:

Start simple. Begin with straightforward sequential execution. Add error handling and flexibility only when you need it. A simple executor that works is better than a complex one that doesn't.

Log everything. When debugging why a plan failed, you'll want to see exactly what happened at each step. Log the plan, each step's input and output, any errors, and the final result.

Set timeouts. Some steps might take a long time or get stuck. Set reasonable timeouts so your agent doesn't wait forever for a response that will never come.

Consider costs. Each step might involve API calls to your language model and external services. If a plan has 20 steps, that's 20+ API calls. Sometimes it's worth combining steps or using a simpler approach.

Test edge cases. What happens if step 1 returns zero results? What if a tool returns malformed data? Your executor should handle these gracefully rather than crashing.