-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch.py
More file actions
267 lines (223 loc) Β· 9.56 KB
/
launch.py
File metadata and controls
267 lines (223 loc) Β· 9.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#!/usr/bin/env python3
# =========================================================
# launch.py: Meta Minds Ecosystem Launcher
# =========================================================
# Central launcher for the complete Meta Minds automation ecosystem
# Starts all components and provides easy access to the system
import sys
import os
import asyncio
import subprocess
import time
import threading
import logging
from pathlib import Path
# Add src directory to Python path
current_dir = Path(__file__).parent
src_dir = current_dir / "src"
sys.path.insert(0, str(src_dir))
def print_banner():
"""Print Meta Minds banner."""
banner = """
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β π META MINDS AUTOMATION ECOSYSTEM π β
β β
β Revolutionary AI-Powered Analytics β
β Complete Enterprise Solution β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Starting Meta Minds Complete System...
"""
print(banner)
def check_dependencies():
"""Check if required dependencies are installed."""
print("π Checking dependencies...")
try:
import streamlit
import pandas
import openai
import crewai
print("β
Core dependencies verified")
return True
except ImportError as e:
print(f"β Missing dependency: {e}")
print("π¦ Please run: pip install -r config/requirements.txt")
return False
def start_component(component_name, command, wait_time=2):
"""Start a system component."""
print(f"π Starting {component_name}...")
try:
if sys.platform == "win32":
# Windows
process = subprocess.Popen(
command,
shell=True,
creationflags=subprocess.CREATE_NEW_CONSOLE
)
else:
# Unix/Linux/Mac
process = subprocess.Popen(
command,
shell=True,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL
)
time.sleep(wait_time)
if process.poll() is None:
print(f"β
{component_name} started successfully")
return process
else:
print(f"β Failed to start {component_name}")
return None
except Exception as e:
print(f"β Error starting {component_name}: {e}")
return None
def start_automation_ecosystem():
"""Start the central automation ecosystem."""
try:
from workflows.automation_ecosystem import orchestrator
# Start orchestrator in background thread
def run_orchestrator():
asyncio.run(orchestrator.process_tasks())
thread = threading.Thread(target=run_orchestrator, daemon=True)
thread.start()
print("β
Automation Ecosystem started")
return True
except Exception as e:
print(f"β Failed to start Automation Ecosystem: {e}")
return False
def start_knowledge_base():
"""Initialize shared knowledge base."""
try:
from workflows.shared_knowledge_base import knowledge_base
# Cleanup expired entries
knowledge_base.cleanup_expired_entries()
print("β
Shared Knowledge Base initialized")
return True
except Exception as e:
print(f"β Failed to initialize Knowledge Base: {e}")
return False
def start_ai_agents():
"""Initialize autonomous AI agents."""
try:
from agents.autonomous_ai_agents import agent_manager
# Agents are automatically initialized
status = agent_manager.get_agent_performance_summary()
agent_count = status['total_agents']
print(f"β
{agent_count} Autonomous AI Agents initialized")
return True
except Exception as e:
print(f"β Failed to initialize AI Agents: {e}")
return False
def main():
"""Main launcher function."""
print_banner()
# Check dependencies
if not check_dependencies():
print("\nβ Dependency check failed. Please install requirements first.")
return
print("\nπ§ Initializing Meta Minds Ecosystem Components...\n")
# Initialize core components
components_started = 0
total_components = 7
# 1. Start Automation Ecosystem
if start_automation_ecosystem():
components_started += 1
# 2. Initialize Knowledge Base
if start_knowledge_base():
components_started += 1
# 3. Initialize AI Agents
if start_ai_agents():
components_started += 1
# 4. Start Human Intervention Dashboard
dashboard_process = start_component(
"Human Intervention Dashboard",
"streamlit run src/ui/human_intervention_dashboard.py --server.port 8501",
wait_time=3
)
if dashboard_process:
components_started += 1
# 5. Start Meta Minds Main Interface
app_process = start_component(
"Meta Minds Main Interface",
"streamlit run src/ui/app.py --server.port 8502",
wait_time=3
)
if app_process:
components_started += 1
# 6. Start Real-time Collaboration Server
collab_process = start_component(
"Real-time Collaboration Server",
"python src/integrations/realtime_collaboration.py",
wait_time=2
)
if collab_process:
components_started += 1
# 7. Start Workflow Engine
try:
from workflows.workflow_engine import workflow_engine
workflow_count = len(workflow_engine.list_workflows())
print(f"β
Workflow Engine started ({workflow_count} workflows loaded)")
components_started += 1
except Exception as e:
print(f"β Failed to start Workflow Engine: {e}")
print(f"\nπ System Status: {components_started}/{total_components} components started\n")
if components_started >= 5: # Minimum viable system
print("π META MINDS ECOSYSTEM SUCCESSFULLY LAUNCHED! π\n")
print("π Access Your System:")
print("βββ ποΈ Main Dashboard: http://localhost:8501")
print("βββ π Meta Minds Interface: http://localhost:8502")
print("βββ π Collaboration Hub: ws://localhost:8765")
print("βββ π€ AI Agents: Running autonomously")
print("βββ π Integrations: Ready for enterprise")
print("βββ π Workflows: Orchestration active")
print("\nπ‘ Quick Actions:")
print("βββ π Start Analysis: Upload data via Meta Minds Interface")
print("βββ π€ Request AI Agent: Submit analysis via API")
print("βββ π Join Collaboration: Create/join session")
print("βββ ποΈ Monitor System: Check dashboard for status")
print("βββ π View Workflows: Browse available workflows")
print("\nπ§ System Features Active:")
print("βββ β
SMART Question Generation")
print("βββ β
Autonomous AI Agents")
print("βββ β
Real-time Collaboration")
print("βββ β
Enterprise Integrations")
print("βββ β
Workflow Orchestration")
print("βββ β
Human Intervention System")
print("βββ β
Advanced ML Models")
print("βββ β
Shared Knowledge Base")
print("βββ β
Performance Optimization")
print("βββ β
Complete Automation Ecosystem")
print("\nπ― Ready for:")
print("βββ π Enterprise Data Analysis")
print("βββ π€ Team Collaboration")
print("βββ π Automated Workflows")
print("βββ π§ AI-Powered Insights")
print("βββ π Scalable Operations")
print("\n" + "="*60)
print("π META MINDS: THE FUTURE OF INTELLIGENT AUTOMATION! π")
print("="*60)
# Keep the launcher running
try:
print("\nβΈοΈ Press Ctrl+C to shutdown the ecosystem...")
while True:
time.sleep(1)
except KeyboardInterrupt:
print("\nπ Shutting down Meta Minds Ecosystem...")
# Cleanup processes
processes = [dashboard_process, app_process, collab_process]
for process in processes:
if process and process.poll() is None:
process.terminate()
print("β
Meta Minds Ecosystem shutdown complete")
else:
print("β SYSTEM LAUNCH FAILED")
print(f"Only {components_started}/{total_components} components started successfully")
print("\nπ§ Troubleshooting:")
print("βββ Check that all dependencies are installed")
print("βββ Ensure ports 8501, 8502, 8765 are available")
print("βββ Verify Python path and module imports")
print("βββ Check logs for specific error messages")
if __name__ == "__main__":
main()