What are Strategies?
Strategies are decorators that modify action behavior to add:- Manual approval - Require human sign-off before execution
- Wait conditions - Pause until memory conditions are met
- Critique loops - Have an LLM review and refine outputs
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 action functions:- Action is called
- Strategy intercepts execution
- Strategy applies its logic (wait, approval, critique, etc.)
- Action proceeds when strategy allows
- Result is returned (potentially modified by strategy)
Manual Approval Strategy
Require human approval before executing sensitive actions:- Action is called with parameters
- Approval request is sent to
signeeviamethod - Execution pauses until approved/rejected
- If approved: action executes
- If rejected: action is cancelled
- Deleting data
- Large financial transactions
- Changing production configurations
- Sending mass communications
Wait Strategy
Pause execution until memory conditions are met or actions complete:- Action is called
- Strategy checks if conditions are met (memory keys + action completion)
- If yes: action executes immediately
- If no: execution pauses and checks every
sleepseconds - When conditions are met: action resumes
- If timeout reached: action fails
- Wait for external webhooks
- Coordinate between multiple actions
- Wait for human input
- Multi-step workflows with dependencies
Critique Strategy
Have an LLM critique and refine action outputs:- Action executes and returns initial output
- LLM critiques the output
- Action re-executes with critique feedback
- Repeat for
loopsiterations - Final output is returned
- Content generation (emails, articles, ads)
- Code generation
- Data analysis reports
- Creative tasks requiring iteration
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 action:- Outermost decorator executes first (ManualApproval)
- Then middle (WaitStrategy)
- Then innermost (CritiqueStrategy)
- Finally the action itself
Using Input References
Reference agent input fields in strategy parameters:input object provides references:
input.user_email→request["user_email"]input.phone→request["phone"]input.slack_channel→request["slack_channel"]- Any field in the request
Strategy Patterns
Approval Gate
Require approval before critical operations:Multi-Step Coordination
Wait for multiple actions to complete:Iterative Refinement
Improve output through multiple iterations:Approval + Critique
Combine strategies for high-quality, approved outputs: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 actions
Use approval for destructive actions
Always require approval for operations that can’t be undone
Set reasonable timeouts
Set reasonable timeouts
Don’t wait forever - set realistic timeouts
Limit critique loops
Limit critique loops
More loops = higher cost and latency
Handle strategy failures
Handle strategy failures
Strategies can timeout or be rejected
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