Loading component…
Loading component…
One agent run that forks into sub-agents and joins back, drawn like a git graph – lanes curve out in their own colour, work runs in parallel, the lead waits at the join
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentBranches from ./agent-branches.
import { AgentBranches, type BranchAgent, type BranchTask } from "@/components/ui/agent-branches";
const agents: BranchAgent[] = [
{ id: "lead", name: "Report lead" },
{ id: "market", name: "Market research", parent: "lead", start: 6.5, summary: 2400 },
{ id: "rivals", name: "Competitors", parent: "lead", start: 6.5, summary: 3100 },
];
const tasks: BranchTask[] = [
{ id: "t1", agent: "lead", label: "Plan", start: 0, end: 6, tokens: 4000 },
{ id: "t2", agent: "market", label: "Read 12 sources", start: 8, end: 22, tokens: 96000 },
{ id: "t3", agent: "rivals", label: "Compare pricing", start: 8, end: 28, tokens: 54000 },
{ id: "t4", agent: "lead", label: "Write the draft", start: 31, end: 42, tokens: 14000 },
];
export function Run() {
return <AgentBranches title="Q4 market report" agents={agents} tasks={tasks} duration={44} />;
}| Name | Type | Default | Description |
|---|---|---|---|
| title | string | The run's name, in the bar | |
| agents | BranchAgent[] | { id, name, parent?, start?, end?, tone?, base?, summary? } – the one without a parent is the lead | |
| tasks | BranchTask[] | { id, agent, label, start, end, failed?, tool?, tokens? } – seconds into the run | |
| duration | number | The run's length in seconds – the end of the last task when left out | |
| window | number | How many seconds the card shows – three quarters of the run by default | |
| startAt | number | Where it opens – halfway into the first fork by default, so the lanes are full from the start | |
| contextLimit | number | Every agent's context window in tokens – 200k by default | |
| speed | number | How much faster than real time it plays – 4 by default | |
| autoPlay | boolean | Plays the run again and again, the window sliding with it – on by default; reduced motion keeps it still | |
| className | string | An extra class on the root |
Fills its container's width; lanes are reused once free, so the card is only as tall as the most agents at once
Below 560px only the agents' marks and the coloured blocks stay on the lanes, and the context bars stack in one column
Long names and tasks end in …; tokens read 2k, 119k or 1.3M
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"