This example is available on GitHub: examples/01_standalone_sdk/24_planning_agent_workflow.py
examples/01_standalone_sdk/24_planning_agent_workflow.py
The model name should follow the LiteLLM convention:
provider/model_name (e.g., anthropic/claude-sonnet-4-5-20250929, openai/gpt-4o).
The LLM_API_KEY should be the API key for your chosen provider.Anatomy of a Custom Agent
The planning agent demonstrates the two key components for creating specialized agent:1. Custom Tool Selection
Choose tools that match your agent’s specific role. Here’s how the planning agent defines its tools:- GlobTool: For discovering files and directories matching patterns
- GrepTool: For searching specific content across files
- PlanningFileEditorTool: For writing structured plans to
PLAN.mdonly
PLAN.md) keeps the agent focused on analysis without implementation distractions.
2. System Prompt Customization
Custom agents can use specialized system prompts to guide behavior. The planning agent usessystem_prompt_planning.j2 with injected plan structure that enforces:
- Objective: Clear goal statement
- Context Summary: Relevant system components and constraints
- Approach Overview: High-level strategy and rationale
- Implementation Steps: Detailed step-by-step execution plan
- Testing and Validation: Verification methods and success criteria
Complete Implementation Reference
For a complete implementation example showing all these components working together, refer to the planning agent preset source code.Next Steps
- Custom Tools - Create specialized tools for your use case
- Context Condenser - Optimize context management
- MCP Integration - Add MCP

