Skip to content

Commit e0822e9

Browse files
authored
Studio: Visual Designer to create AI agents (#121)
* Arium yaml chanegs * fix readme for format * Studio first commit * Custom agent builder * Basic multi agent routing * Fix studio, and have first agent created through it to run * Add studio details in READme * Adding flo studio imahe
1 parent b14be39 commit e0822e9

41 files changed

Lines changed: 5251 additions & 225 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ scratch_pad.py
2121
*.html
2222
usecases/
2323
compare_gemini_outputs_v1.py
24+
node_modules/

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,51 @@ Flo AI is a Python framework for building structured AI agents with support for
4242
4343
Flo AI is a Python framework that makes building production-ready AI agents and teams as easy as writing YAML. Think "Kubernetes for AI Agents" - compose complex AI architectures using pre-built components while maintaining the flexibility to create your own.
4444

45+
## 🎨 Flo AI Studio - Visual Workflow Designer
46+
47+
**Create AI workflows visually with our powerful React-based studio!**
48+
49+
<p align="center">
50+
<img src="./images/flo-studio-preview.png" alt="Flo AI Studio - Visual Workflow Designer" width="800" />
51+
</p>
52+
53+
Flo AI Studio is a modern, intuitive visual editor that allows you to design complex multi-agent workflows through a drag-and-drop interface. Build sophisticated AI systems without writing code, then export them as production-ready YAML configurations.
54+
55+
### 🚀 Studio Features
56+
57+
- **🎯 Visual Design**: Drag-and-drop interface for creating agent workflows
58+
- **🤖 Agent Management**: Configure AI agents with different roles, models, and tools
59+
- **🔀 Smart Routing**: Visual router configuration for intelligent workflow decisions
60+
- **📤 YAML Export**: Export workflows as Flo AI-compatible YAML configurations
61+
- **📥 YAML Import**: Import existing workflows for further editing
62+
- **✅ Workflow Validation**: Real-time validation and error checking
63+
- **🔧 Tool Integration**: Connect agents to external tools and APIs
64+
- **📋 Template System**: Quick start with pre-built agent and router templates
65+
66+
### 🏃‍♂️ Quick Start with Studio
67+
68+
1. **Start the Studio**:
69+
```bash
70+
cd studio
71+
pnpm install
72+
pnpm dev
73+
```
74+
75+
2. **Design Your Workflow**:
76+
- Add agents, routers, and tools to the canvas
77+
- Configure their properties and connections
78+
- Test with the built-in validation
79+
80+
3. **Export & Run**:
81+
```bash
82+
# Export YAML from the studio, then run with Flo AI
83+
python -c "
84+
from flo_ai.arium import AriumBuilder
85+
builder = AriumBuilder.from_yaml(yaml_file='your_workflow.yaml')
86+
result = await builder.build_and_run(['Your input here'])
87+
"
88+
```
89+
4590
## ✨ Features
4691

4792
- 🔌 **Truly Composable**: Build complex AI systems by combining smaller, reusable components

flo_ai/examples/example.py

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
"""
2+
Example of running a Flo AI workflow with snake_case agent names
3+
Generated from Flo AI Studio
4+
"""
5+
6+
import asyncio
7+
from flo_ai.arium import AriumBuilder
8+
from flo_ai.tool.base_tool import Tool
9+
10+
# Set your OpenAI API key
11+
# os.environ["OPENAI_API_KEY"] = "your-api-key-here"
12+
13+
14+
# Create a simple web search tool
15+
async def web_search_function(query: str) -> str:
16+
"""Simple web search simulation - replace with actual search API"""
17+
return f"Web search results for '{query}': Found relevant articles about the topic including latest developments, applications, and ethical considerations. [This is a mock search - integrate with real search API like Google, Bing, or DuckDuckGo]"
18+
19+
20+
# Create the tool instance
21+
web_search_tool = Tool(
22+
name='web_search',
23+
description='Search the web for information on a given topic',
24+
function=web_search_function,
25+
parameters={
26+
'query': {
27+
'type': 'string',
28+
'description': 'The search query to look up information about',
29+
}
30+
},
31+
)
32+
33+
# YAML workflow definition (exported from Flo AI Studio)
34+
workflow_yaml = """
35+
metadata:
36+
name: New Workflow
37+
version: 1.0.0
38+
description: Generated with Flo AI Studio
39+
tags:
40+
- flo-ai
41+
- studio-generated
42+
arium:
43+
agents:
44+
- name: content_analyzer
45+
role: Content Analyst
46+
job: Analyze content and extract key insights, themes, and important information.
47+
model:
48+
provider: openai
49+
name: gpt-4o-mini
50+
settings:
51+
temperature: 0.7
52+
max_retries: 3
53+
reasoning_pattern: DIRECT
54+
- name: researcher
55+
role: Research Specialist
56+
job: Research topics and gather comprehensive information using available tools.
57+
model:
58+
provider: openai
59+
name: gpt-4o
60+
tools:
61+
- web_search
62+
- name: summarizer
63+
role: Summary Generator
64+
job: Create concise, actionable summaries from analysis and content.
65+
model:
66+
provider: openai
67+
name: gpt-4o-mini
68+
routers:
69+
- name: smart_router
70+
type: smart
71+
routing_options:
72+
researcher: If there is not enough information & deep research needs to be done
73+
summarizer: If we have enough information and its time to summarize
74+
model:
75+
provider: openai
76+
name: gpt-4o-mini
77+
settings:
78+
temperature: 0.3
79+
fallback_strategy: first
80+
workflow:
81+
start: content_analyzer
82+
edges:
83+
- from: content_analyzer
84+
to: [researcher, summarizer]
85+
router: smart_router
86+
- from: researcher
87+
to: [summarizer]
88+
end:
89+
- summarizer
90+
"""
91+
92+
93+
async def main():
94+
"""Run the workflow"""
95+
print('🚀 Starting Flo AI Workflow...')
96+
print('📋 Workflow: Content Analysis with Smart Routing')
97+
print('-' * 50)
98+
99+
try:
100+
# Create tools dictionary (required format for AriumBuilder)
101+
tools = {'web_search': web_search_tool}
102+
103+
# Create Arium builder from YAML
104+
builder = AriumBuilder.from_yaml(yaml_str=workflow_yaml, tools=tools)
105+
106+
# Example input for the workflow
107+
user_input = [
108+
"""I need to understand the current trends in artificial intelligence and machine learning.
109+
Specifically, I'm interested in:
110+
1. Latest developments in large language models
111+
2. Applications in healthcare and finance
112+
3. Ethical considerations and regulations
113+
114+
Please provide a comprehensive analysis and summary."""
115+
]
116+
117+
print('📝 Input:')
118+
print(user_input[0])
119+
print('\n' + '=' * 50)
120+
print('🔄 Processing workflow...')
121+
print('=' * 50 + '\n')
122+
123+
# Build and run the workflow
124+
result = await builder.build_and_run(user_input)
125+
126+
print('✅ Workflow Result:')
127+
print('-' * 30)
128+
if isinstance(result, list):
129+
for i, message in enumerate(result):
130+
print(f'{i+1}. {message}')
131+
else:
132+
print(result)
133+
134+
except Exception as e:
135+
print(f'❌ Error running workflow: {str(e)}')
136+
print('\n💡 Make sure you have:')
137+
print('1. Set your OPENAI_API_KEY environment variable')
138+
print('2. Installed flo-ai: pip install flo-ai')
139+
print('3. All required dependencies')
140+
141+
142+
if __name__ == '__main__':
143+
asyncio.run(main())

images/flo-studio-preview.png

275 KB
Loading

0 commit comments

Comments
 (0)