What is Arium?
Arium is Flo AI’s powerful workflow orchestration engine for creating complex multi-agent workflows. It allows you to chain agents together, implement conditional routing, and build sophisticated AI systems.AriumBuilder Methods
TheAriumBuilder class provides a fluent interface for configuring workflows. All methods return self for method chaining. Here’s a complete reference:
| Method | Description | Parameters |
|---|---|---|
with_memory(memory: MessageMemory) | Set shared memory for the workflow | memory: MessageMemory instance |
add_agent(agent: Agent) | Add a single agent to the workflow | agent: Agent instance |
add_agents(agents: List[Agent]) | Add multiple agents to the workflow | agents: List of Agent instances |
add_function_node(node: FunctionNode) | Add a function node to the workflow | node: FunctionNode instance |
add_function_nodes(nodes: List[FunctionNode]) | Add multiple function nodes | nodes: List of FunctionNode instances |
add_arium(arium: Arium, name: str, inherit_variables: bool) | Add a nested Arium workflow as a node | arium: Arium instance, name: Optional name, inherit_variables: Whether to inherit variables |
add_foreach(name: str, execute_node: AriumNodeType) | Add a ForEach node for batch processing | name: Node name, execute_node: Node to execute on each item |
start_with(node: AriumNodeType | str) | Set the starting node | node: Agent, FunctionNode, AriumNode, or node name string |
end_with(node: AriumNodeType) | Add an ending node | node: Agent, FunctionNode, or AriumNode |
connect(from_node: AriumNodeType, to_node: AriumNodeType) | Connect two nodes directly | from_node: Source node, to_node: Target node |
add_edge(from_node: AriumNodeType, to_nodes: List[AriumNodeType], router: Callable) | Add edge with optional router function | from_node: Source node, to_nodes: List of target nodes, router: Optional routing function |
from_yaml(yaml_str: str, yaml_file: str, ...) | Create builder from YAML configuration | yaml_str: YAML string, yaml_file: Path to YAML file, plus optional registries |
build() | Build and return the Arium instance | Returns: Arium instance |
build_and_run(inputs, variables: Dict) | Build and run the workflow | inputs: List of messages or string, variables: Optional runtime variables |
visualize(output_path: str, title: str) | Generate workflow visualization | output_path: Path for graph image, title: Graph title |
reset() | Reset builder to start fresh | Returns: AriumBuilder instance |
start_with() and end_with() are required before calling build(). All other methods are optional.
Node Types
Arium workflows support several types of nodes, each serving different purposes:Agent Nodes
Agents are the primary executable nodes in Arium workflows. They use LLMs to process inputs and generate responses.Function Nodes
Function nodes allow you to execute custom Python functions within workflows. They can be synchronous or asynchronous.Arium Nodes (Nested Workflows)
Arium nodes allow you to embed one workflow inside another, creating hierarchical workflows with isolated memory.ForEach Nodes
ForEach nodes execute a node on each item in a collection, useful for batch processing.Combining Node Types
You can combine different node types in a single workflow:Basic Workflow Creation
Simple Agent Chain
Create a linear workflow with multiple agents:Conditional Routing
Route to different agents based on conditions:YAML-Based Workflows
Define entire workflows in YAML for easy management:Advanced Routing
LLM-Powered Routers
Use LLMs for intelligent routing decisions:ReflectionRouter
For A→B→A→C feedback patterns:PlanExecuteRouter
For Cursor-style plan-and-execute workflows:Workflow Patterns
Sequential Processing
Parallel Processing
Fan-out/Fan-in
Memory Management
Shared Memory
Custom Memory
You can extendMessageMemory to add custom functionality:
Workflow Execution
Running Workflows
Workflows can be executed usingbuild_and_run() or by building first and then running:
Error Handling
Error handling in Arium workflows is managed at the agent level. Configure retries and error handling when building agents:Performance Optimization
Parallel Execution
Arium automatically executes agents in parallel when multiple agents are connected from the same source node:Workflow Visualization
Visualize your workflow to understand the execution flow:Best Practices
Workflow Design
- Keep it simple: Start with linear workflows before adding complexity
- Use meaningful names: Name agents and workflows descriptively
- Handle errors: Always implement error handling and recovery
- Test thoroughly: Test workflows with various inputs
Performance Tips
- Use appropriate models: Choose models based on task complexity
- Implement caching: Cache expensive operations
- Optimize routing: Use efficient routing logic
- Monitor performance: Use telemetry to track workflow performance

