Skip to main content
Rilo’s AI Module is a sophisticated multi-agent system that orchestrates workflow creation, verification, code generation, and execution. It uses specialized AI agents to handle different aspects of workflow automation.

Overview

The AI Module consists of:
  • OrchestrationAgent: Central router that coordinates all agents
  • WorkflowEditorAgent: Creates and updates workflows
  • VerificationAgent: Verifies block configurations
  • BlockCodingAgent: Generates Python code for blocks
  • TriggerGeneratorAgent: Creates workflow triggers
  • CapabilityResearchAgent: Researches available tools
The multi-agent architecture ensures each aspect of workflow creation is handled by a specialized agent, resulting in better accuracy and reliability.

Multi-Agent Architecture

OrchestrationAgent (Router - owns all conversations)
├── WorkflowEditorAgent - CRUD operations on workflows/blocks
├── VerificationAgent - Verifies block configs, discovers fields
├── BlockCodingAgent - Generates Python code for blocks
├── TriggerGeneratorAgent - Creates workflow triggers
├── CapabilityResearchAgent - Research available tools/integrations
└── Specialized agents (EmailTemplateBuilder, GmailQueryBuilder, etc.)

How Agents Work Together

1. User Request

User describes workflow in natural language:
"Scrape Reddit posts daily and email summary to [email protected]"

2. OrchestrationAgent Routes

OrchestrationAgent receives the request and routes to appropriate agents:
  • Determines which agents are needed
  • Manages conversation state
  • Tracks pending questions

3. WorkflowEditorAgent Creates Blocks

WorkflowEditorAgent:
  • Parses natural language description
  • Creates workflow blocks
  • Sets up dependencies
  • Configures block types

4. VerificationAgent Verifies

VerificationAgent:
  • Discovers required config fields
  • Asks clarifying questions if needed
  • Validates tool availability
  • Ensures blocks are properly configured

5. BlockCodingAgent Generates Code

BlockCodingAgent:
  • Analyzes block instructions
  • Generates Python code
  • Includes error handling
  • Integrates library tools

6. Execution

Generated code runs in secure sandboxes with credit tracking.

Agent Details

OrchestrationAgent

Role: Central router and conversation manager Responsibilities:
  • Receives all user messages
  • Routes to appropriate subagents
  • Manages conversation state
  • Tracks pending questions
  • Handles user deviations
Tools:
  • Routes to other agents via tool calls
  • Manages conversation flow
  • Handles context filtering

WorkflowEditorAgent

Role: Workflow CRUD operations Responsibilities:
  • Creates workflows from natural language
  • Updates existing workflows
  • Adds/removes blocks
  • Manages workflow metadata
Tools:
  • create_workflow
  • add_blocks
  • update_block
  • delete_blocks
  • update_workflow_metadata

VerificationAgent

Role: Block verification and configuration Responsibilities:
  • Discovers required config fields
  • Asks clarifying questions
  • Validates tool availability
  • Ensures proper configuration
Tools:
  • verify_block
  • discover_config_fields
  • validate_tools

BlockCodingAgent

Role: Python code generation Responsibilities:
  • Generates executable Python code
  • Integrates library tools
  • Adds error handling
  • Ensures code quality
Output:
  • Python code extending BaseBlock
  • Library imports
  • Error handling
  • Data flow logic

TriggerGeneratorAgent

Role: Workflow trigger creation Responsibilities:
  • Creates workflow triggers
  • Configures schedules
  • Sets up app event triggers
  • Manages trigger types
Tools:
  • create_trigger
  • update_trigger
  • delete_trigger

CapabilityResearchAgent

Role: Tool and integration research Responsibilities:
  • Researches available tools
  • Answers capability questions
  • Identifies integration options
  • Provides tool recommendations
Tools:
  • get_libraries_capabilities
  • get_tools_capabilities
  • get_tools_trigger_actions

Specialized Agents

Rilo also includes specialized agents for specific tasks:
  • EmailTemplateBuilder: Creates email templates
  • GmailQueryBuilder: Builds Gmail search queries
  • ImageGenerationConfigBuilder: Configures image generation
  • UI Manifest Agent: Generates review forms for HITL blocks

Agent Communication

Tool-Based Invocation

Agents communicate via tool calls, not handoffs:
# OrchestrationAgent calls WorkflowEditorAgent
result = workflow_editor_agent.create_workflow(
    description="Scrape Reddit and email summary"
)
Tool-based invocation provides better state tracking and allows agents to work together more effectively.

Context Filtering

Each agent receives filtered context:
  • OrchestrationAgent: Full conversation history
  • WorkflowEditorAgent: 3-5 recent messages
  • VerificationAgent: Current block context
  • BlockCodingAgent: Block-specific context

Agent Capabilities

Natural Language Understanding

All agents understand natural language:
  • Parse user requests
  • Extract workflow requirements
  • Identify tools and integrations needed
  • Generate appropriate responses

Error Handling

Agents handle errors gracefully:
  • Ask clarifying questions
  • Suggest alternatives
  • Provide helpful error messages
  • Recover from failures

Learning and Improvement

Agents improve over time:
  • Learn from examples
  • Adapt to user patterns
  • Refine code generation
  • Better understand intent

Best Practices

Provide clear, specific descriptions. Vague requests lead to unclear workflows.
When agents ask clarifying questions, provide detailed answers. This helps create better workflows.
Review generated workflows before execution. Agents are good, but human review ensures accuracy.
Don’t expect perfect workflows on first try. Iterate and refine based on results.

Limitations

Agent Limitations

  • Cannot access system resources: Agents cannot read credentials or system files
  • Limited to available tools: Agents can only use tools from Rilo libraries
  • No custom code execution: Agents generate code but don’t execute arbitrary code
  • Context window: Agents have limited context windows

Workflow Limitations

  • Single trigger per workflow: Each workflow has exactly one trigger type
  • No circular dependencies: Workflows must be DAGs
  • No data persistence: Workflows cannot access data from previous runs
Agents are powerful but have limitations. Understand what they can and cannot do to set appropriate expectations.

Troubleshooting

  • Be more specific in your description
  • Provide examples if possible
  • Break complex requests into simpler parts
  • Answer clarifying questions thoroughly
  • Review and provide feedback
  • Update workflow with corrections
  • Agents learn from corrections
  • Try regenerating with more details
  • Provide more context upfront
  • Include all relevant details
  • Specify tools and integrations needed
  • Be explicit about requirements
  • Code Generation - How BlockCodingAgent generates code
  • Configs - How VerificationAgent discovers config fields
  • Graph Mode - Visual representation of agent-created workflows

The AI Module is continuously being improved. New agents and capabilities are added regularly to enhance workflow creation and execution.