Skip to main content

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:
Execution flow:
  1. Agent is invoked
  2. Strategy intercepts execution
  3. Strategy applies its orchestration logic (approval, action selection, handoff, etc.)
  4. Agent executes with strategy-modified behavior
  5. Results flow through memory

Manual Approval Strategy

Require human approval before executing sensitive agent workflows:
What happens:
  1. Agent is invoked with parameters
  2. Approval request is sent to signee via method
  3. Execution pauses until approved/rejected
  4. If approved: agent executes normally
  5. If rejected: agent execution is cancelled
Use cases:
  • Deleting user data
  • Large financial transactions
  • Production deployments
  • Bulk operations
Learn more →

Wait Strategy

Pause agent execution until memory conditions are met:
What happens:
  1. Agent is invoked
  2. Strategy checks if memory keys exist
  3. If yes: agent executes immediately
  4. If no: execution pauses and checks every sleep seconds
  5. When conditions are met: agent resumes
  6. If timeout reached: agent fails
Use cases:
  • Wait for external webhooks to populate memory
  • Coordinate between multiple agents
  • Wait for human input in memory
  • Multi-stage workflows with dependencies
Learn more →

Critique Strategy

Have an LLM critique and refine agent outputs through multiple iterations:
What happens:
  1. Agent executes and produces initial output
  2. LLM (using model parameter) critiques the output
  3. Agent re-executes with critique feedback
  4. Repeat for loops iterations
  5. Final refined output stored in memory
Use cases:
  • Content generation (emails, articles, ads)
  • Data analysis with refinement
  • Research summaries
  • Any task requiring iterative improvement
Learn more →

Pick Actions Strategy

Intelligently select which actions to execute from a pool of available actions:
What happens:
  1. Agent has access to multiple actions
  2. Strategy analyzes context and picks N actions to execute
  3. Selected actions are called
  4. Results are returned
Parameters:
  • picks: Number of actions to execute (default: 1)
  • allow_repeats: Whether same action can be picked multiple times (default: False)
Use cases:
  • 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:
What happens:
  1. Agent A completes its work
  2. Agent A specifies which agent to hand off to
  3. Memory is preserved (durable across agents)
  4. Agent B starts with access to shared memory
  5. Agent B continues the workflow
Parameters:
  • agents: List of agent IDs that can be handed off to
Use cases:
  • Multi-stage workflows (search → review → book)
  • Specialized agents for different tasks
  • Human-in-the-loop workflows (agent → approval → agent)
  • Complex orchestration patterns
Learn more →

Conditional Strategy

Execute agents or actions based on dynamic conditions:
What happens:
  1. Condition is evaluated before agent executes
  2. If condition is True: agent executes normally
  3. If condition is False: agent is skipped
  4. Supports Python expressions for conditions
Condition syntax:
  • input.field - Access request input fields
  • memory.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')
Use cases:
  • Route to different agents based on user type
  • Skip processing if conditions aren’t met
  • A/B testing with conditional execution
  • Dynamic workflow branching
Examples:
Combining with other strategies:
Learn more →

Combining Strategies

Stack multiple strategies on one agent for complex orchestration:
Execution order:
  • 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:
The input object provides references to request fields:
  • input.user_emailrequest["user_email"]
  • input.phonerequest["phone"]
  • input.slack_channelrequest["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 DashboardApprovals 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

Always require approval for agent workflows that can’t be undone
Don’t wait forever - set realistic timeouts for WaitStrategy
More loops = higher cost and latency
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

Execution Flow:
  1. 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
  2. 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
  3. booker_agent pauses
    • ManualApprovalStrategy sends approval email to user
    • Execution pauses, waiting for approval…
  4. User approves via email
  5. 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

Next Steps

Manual Approval

Detailed approval guide

Wait Strategy

Wait condition patterns

Critique Strategy

LLM-powered refinement