How It Works
AgenticPal employs a multi-stage processing pipeline:1. Plan Actions
The agent analyzes your request to determine:- Which tools are needed
- What parameters to extract
- Whether confirmation is required
- Dependencies between actions
agent/graph/nodes/plan_actions.py.
2. Route Execution
The system decides how to execute tools:- Parallel: Independent actions run simultaneously
- Sequential: Dependent actions run in order
- Confirmation: Destructive actions pause for approval
3. Execute Tools
Tools are invoked with validated parameters:- Calendar operations
- Email queries
- Task management
4. Synthesize Response
Results are formatted into a natural, human-readable response. Implemented inagent/graph/nodes/synthesize_response.py.
Natural Language Examples
Calendar
Tasks
Date & Time Parsing
AgenticPal uses intelligent date/time parsing fromagent/date_utils.py:
Relative Dates
Tomorrow/Today/Yesterday:Absolute Dates
ISO Format:Time Parsing
12-hour Format:Duration Parsing
Implementation
dateparser library with smart defaults:
- Future preference: “Monday” means next Monday, not last Monday
- Timezone aware: Respects specified timezone
- Context sensitive: “morning” depends on current time
Intent Recognition
AgenticPal recognizes user intent across different phrasings:Create/Add
List/Show
Update/Modify
Delete/Remove
Complete/Finish
Tool Discovery
AgenticPal uses a meta-tool architecture for efficient tool discovery:Three Meta-Tools
discover_tools: Find tools by category or actionget_tool_schema: Get detailed schema for a specific toolinvoke_tool: Execute a tool with parameters
agent/tools/tool_definitions.py.
Discovery Process
Tool Categories
calendar: Calendar event managementgmail: Email operationstasks: Todo list management
Tool Actions
create: Add new itemsread: Retrieve informationupdate: Modify existing itemsdelete: Remove itemssearch: Find specific itemslist: View collections
Prompt Engineering
AgenticPal uses structured prompts to guide the LLM:Planning Prompt
Fromagent/graph/nodes/plan_actions.py:
Response Synthesis Prompt
Fromagent/graph/nodes/synthesize_response.py:
Context Awareness
The agent maintains conversation context:Parameter Extraction
The LLM extracts structured parameters from natural language:Error Recovery
When the agent encounters ambiguity or errors, it asks clarifying questions:Next Steps
Multi-turn Conversations
Learn about context-aware interactions
Confirmations
Understand confirmation flows