What are Strategies?
Strategies are decorators that modify agent behavior to add orchestration capabilities:- Manual approval - Require human sign-off before agent execution
- Pick actions - Intelligently select which actions to execute
- Hand off - Transfer control between agents with shared memory
- Critique - Have an LLM review and refine agent outputs
- Conditional - Execute agents based on dynamic conditions
- Wait - Pause until memory conditions are met
Available Strategies
Manual Approval
Require human approval before execution
Wait Strategy
Pause until memory conditions or actions complete
Critique Strategy
LLM reviews and refines output
Pick Actions
Intelligently select which actions to execute
Hand Off
Transfer control to another agent
Conditional
Execute based on conditions
How Strategies Work
Strategies are Python decorators that wrap your agent classes:- Agent is invoked
- Strategy intercepts execution
- Strategy applies its orchestration logic (approval, action selection, handoff, etc.)
- Agent executes with strategy-modified behavior
- Results flow through memory
Manual Approval Strategy
Require human approval before executing sensitive agent workflows:- Agent is invoked with parameters
- Approval request is sent to
signeeviamethod - Execution pauses until approved/rejected
- If approved: agent executes normally
- If rejected: agent execution is cancelled
- Deleting user data
- Large financial transactions
- Production deployments
- Bulk operations
Wait Strategy
Pause agent execution until memory conditions are met:- Agent is invoked
- Strategy checks if memory keys exist
- If yes: agent executes immediately
- If no: execution pauses and checks every
sleepseconds - When conditions are met: agent resumes
- If timeout reached: agent fails
- Wait for external webhooks to populate memory
- Coordinate between multiple agents
- Wait for human input in memory
- Multi-stage workflows with dependencies
Critique Strategy
Have an LLM critique and refine agent outputs through multiple iterations:- Agent executes and produces initial output
- LLM (using
modelparameter) critiques the output - Agent re-executes with critique feedback
- Repeat for
loopsiterations - Final refined output stored in memory
- Content generation (emails, articles, ads)
- Data analysis with refinement
- Research summaries
- Any task requiring iterative improvement
Pick Actions Strategy
Intelligently select which actions to execute from a pool of available actions:- Agent has access to multiple actions
- Strategy analyzes context and picks N actions to execute
- Selected actions are called
- Results are returned
picks: Number of actions to execute (default: 1)allow_repeats: Whether same action can be picked multiple times (default: False)
- Dynamic action selection based on context
- A/B testing different actions
- Load balancing across similar actions
- Adaptive workflows
Hand Off Strategy
Transfer control from one agent to another:- Agent A completes its work
- Agent A specifies which agent to hand off to
- Memory is preserved (durable across agents)
- Agent B starts with access to shared memory
- Agent B continues the workflow
agents: List of agent IDs that can be handed off to
- Multi-stage workflows (search → review → book)
- Specialized agents for different tasks
- Human-in-the-loop workflows (agent → approval → agent)
- Complex orchestration patterns
Conditional Strategy
Execute agents or actions based on dynamic conditions:- Condition is evaluated before agent executes
- If condition is
True: agent executes normally - If condition is
False: agent is skipped - Supports Python expressions for conditions
input.field- Access request input fieldsmemory.get('key')- Access memory values- Standard Python operators:
==,!=,>,<,>=,<=,and,or,not - String matching:
input.answer == 'blue' - Numeric comparisons:
input.amount > 100 - Boolean logic:
input.active and memory.get('verified')
- Route to different agents based on user type
- Skip processing if conditions aren’t met
- A/B testing with conditional execution
- Dynamic workflow branching
Combining Strategies
Stack multiple strategies on one agent for complex orchestration:- Outermost decorator executes first (ManualApproval)
- Then middle (WaitStrategy)
- Then innermost (CritiqueStrategy)
- Finally the agent executes with all strategies applied
Using Input References
Reference agent input fields in strategy parameters:input object provides references to request fields:
input.user_email→request["user_email"]input.phone→request["phone"]input.slack_channel→request["slack_channel"]- Any field from the incoming request
Agent Orchestration Patterns
Approval Gate
Require approval before critical agent workflows:Multi-Agent Coordination
Agents can hand off to each other with shared memory:Iterative Refinement
Agent improves its output through critique loops:Approval + Critique
Combine strategies for high-quality, approved agent workflows:Dashboard Management
View and manage pending approvals in the dashboard:1
View Pending Approvals
Navigate to Dashboard → Approvals to see all pending approval requests.
2
Review Details
Click on an approval to see:
- Action name and description
- Input parameters
- Requester information
- Timestamp
3
Approve or Reject
Click Approve or Reject with optional comment.The action will resume or be cancelled accordingly.
Best Practices
Use approval for destructive workflows
Use approval for destructive workflows
Always require approval for agent workflows that can’t be undone
Set reasonable timeouts
Set reasonable timeouts
Don’t wait forever - set realistic timeouts for WaitStrategy
Limit critique loops
Limit critique loops
More loops = higher cost and latency
Strategies work at agent level
Strategies work at agent level
Strategies orchestrate entire agent workflows, not individual actions
Limitations
Current limitations:
- Max timeout: 24 hours for WaitStrategy
- Critique cost: Each loop uses LLM tokens
- Approval methods: Email, Slack, SMS (more coming)
- No custom strategies yet: Only built-in strategies available
Complete Example: Multi-Agent Flight Booking
This example demonstrates a complete multi-agent workflow with handoffs, strategies, and durable memory:Running the Multi-Agent Workflow
-
searcher_agent runs
- PickActionsStrategy selects 2 best search actions dynamically
- Searches Google and comparison sites
- Stores 20+ flight options in memory
- Hands off to reviewer_agent
-
reviewer_agent runs
- Reads flight options from memory
- Analyzes with GPT-4
- CritiqueStrategy refines analysis (2 iterations)
- Stores top recommendation in memory
- Hands off to booker_agent
-
booker_agent pauses
- ManualApprovalStrategy sends approval email to user
- Execution pauses, waiting for approval…
- User approves via email
-
booker_agent resumes
- Charges payment via Stripe
- Books flight
- Sends confirmation email
- Returns final result
Key Features Demonstrated
✅ Stateless agents - Each agent step is independent✅ Durable memory - Persists across all handoffs and failures
✅ PickActionsStrategy - Intelligently selects search methods
✅ CritiqueStrategy - Refines analysis through iteration
✅ HandOffStrategy - Seamless agent-to-agent transitions
✅ ManualApprovalStrategy - Human-in-the-loop approval
✅ Multi-tenant - Memory scoped to run_id
✅ Fault-tolerant - Can retry from any point
Coming Soon
We’re adding more strategies:- RateLimitStrategy - Throttle action execution
- CacheStrategy - Auto-cache action results
- FallbackStrategy - Automatic fallback on failure
- ParallelStrategy - Execute actions in parallel
- CustomStrategy - Define your own strategies