Triggeruser message
Planneropus-4.8
Search toolweb
Code toolsandbox
Synthesizeopus-4.8
Answerstreamed
Agent Flow
tsx
import { AgentFlow, type AgentFlowNode, type AgentFlowEdge } from "@/components/myndui/agent-flow";const nodes: AgentFlowNode[] = [{ id: "trigger", label: "Trigger", sublabel: "user message", x: 90, y: 170 },{ id: "planner", label: "Planner", sublabel: "opus-4.8", x: 320, y: 170 },{ id: "search", label: "Search tool", sublabel: "web", x: 560, y: 80 },{ id: "code", label: "Code tool", sublabel: "sandbox", x: 560, y: 260 },{ id: "synth", label: "Synthesize", sublabel: "opus-4.8", x: 800, y: 170 },{ id: "answer", label: "Answer", x: 1020, y: 170 },];const edges: AgentFlowEdge[] = [{ id: "e1", from: "trigger", to: "planner" },{ id: "e2", from: "planner", to: "search", curvature: 40 },{ id: "e3", from: "planner", to: "code", curvature: -40 },{ id: "e4", from: "search", to: "synth", curvature: -40 },{ id: "e5", from: "code", to: "synth", curvature: 40 },{ id: "e6", from: "synth", to: "answer" },];export function AgentFlowDemo() {return <AgentFlow nodes={nodes} edges={edges} autoPlay className="h-[400px] w-full" />;}