/* AetherShell TUI Agent Swarm Demo
Launch with: ae tui
This demo showcases multi-agent coordination in the TUI:
- Agent creation and management
- Swarm coordination
- Real-time agent status
- Task distribution
*/
/* Create individual agents with different roles */
researcher := agent {
goal: "Research functional programming concepts",
model: "openai:gpt-4o-mini",
tools: ["web_search", "read_file"],
max_steps: 10
}
writer := agent {
goal: "Write a technical blog post",
model: "openai:gpt-4o-mini",
tools: ["write_file", "format_markdown"],
max_steps: 8
}
reviewer := agent {
goal: "Review and provide feedback",
model: "anthropic:claude-3-5-sonnet-20241022",
tools: ["read_file", "analyze_text"],
max_steps: 5
}
/* Create a swarm with coordination strategy */
content_team := swarm {
agents: [researcher, writer, reviewer],
policy: "router", /* Options: router, round-robin, coordinator */
goal: "Create a comprehensive guide on functional programming",
max_iters: 15,
shared_tools: ["read_file", "write_file"]
}
/* Execute the swarm - TUI shows real-time progress */
content_team | print
/* The TUI provides:
- Agent status panel (active, idle, completed)
- Message blackboard view
- Step-by-step execution trace
- Agent communication visualization
- Resource usage metrics
- Pause/resume controls
- Individual agent inspection
*/
/* Alternative: Sequential agents */
agents_run_sync [
{goal: "Step 1: Gather requirements", model: "openai:gpt-4o-mini", max_steps: 5},
{goal: "Step 2: Design solution", model: "openai:gpt-4o-mini", max_steps: 5},
{goal: "Step 3: Review design", model: "anthropic:claude-3-5-sonnet-20241022", max_steps: 3}
] | print
print "TUI Agent Swarm Demo Ready! Launch with: ae tui"