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
How Agents Work Together
1. User Request
User describes workflow in natural language: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
- 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
create_workflowadd_blocksupdate_blockdelete_blocksupdate_workflow_metadata
VerificationAgent
Role: Block verification and configuration Responsibilities:- Discovers required config fields
- Asks clarifying questions
- Validates tool availability
- Ensures proper configuration
verify_blockdiscover_config_fieldsvalidate_tools
BlockCodingAgent
Role: Python code generation Responsibilities:- Generates executable Python code
- Integrates library tools
- Adds error handling
- Ensures code quality
- 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
create_triggerupdate_triggerdelete_trigger
CapabilityResearchAgent
Role: Tool and integration research Responsibilities:- Researches available tools
- Answers capability questions
- Identifies integration options
- Provides tool recommendations
get_libraries_capabilitiesget_tools_capabilitiesget_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: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
Be Specific
Be Specific
Provide clear, specific descriptions. Vague requests lead to unclear workflows.
Answer Questions
Answer Questions
When agents ask clarifying questions, provide detailed answers. This helps create better workflows.
Review Generated Workflows
Review Generated Workflows
Review generated workflows before execution. Agents are good, but human review ensures accuracy.
Iterate and Refine
Iterate and Refine
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
Troubleshooting
Agent not understanding request
Agent not understanding request
- Be more specific in your description
- Provide examples if possible
- Break complex requests into simpler parts
- Answer clarifying questions thoroughly
Generated workflow incorrect
Generated workflow incorrect
- Review and provide feedback
- Update workflow with corrections
- Agents learn from corrections
- Try regenerating with more details
Agent asking too many questions
Agent asking too many questions
- Provide more context upfront
- Include all relevant details
- Specify tools and integrations needed
- Be explicit about requirements
Related Features
- 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.