Skip to content

Agent Tree

Who started whom, as a tree you can approve and retry in: each agent's state, live clock, tasks and the cost of everything under it.

On this page

Examples

Fold finished branches

With foldFinished, a branch whose agents have all finished folds to its card on a small stack. Open it from the count, or with Space.

Credits instead of dollars

formatSpend changes every amount: the cards, the branch totals and the header.

List layout

layout="list" gives one row per agent with the clock, tasks and branch cost in columns. The org chart switches to it by itself below 640px.

Density

From a live run

Pass run and the tree follows it: agents join as they are started, with their tools and current task.

Installation

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Props

run
AgentRun
Follow a live run: the root agent on top, every other agent under the agent that sent it its first span. Agents appear as they are started; state, activity, spend, tools, the current task and open approvals come from the run.
nodes
AgentTreeNode[]
Or pass the tree: { id, name, role?, model?, state?, activity?, task?, tools?, startedAt?, endedAt?, cost?, tasks?, children? }. Ignored when run is set.
layout
"org" | "list"
Default"org"
Org: the root on top, its sub-agents in a row joined by a bus, deeper agents on a rail under their parent. List: one row per agent. Org becomes the list below 640px of width.
density
"compact" | "roomy"
Default"compact"
List layout only. Compact: one line per agent. Roomy: role and model on a second line.
title
ReactNode | false
Default"Agents"
Heading with the counts (agents, working, needs you), a failed menu that jumps to each failed agent, and the total spend. false hides it.
onResolve
(node, action: "approve" | "deny" | "retry") => void
Approve / Deny on waiting agents, Retry on failed ones. In run mode approve and deny also resolve the run's approval.
onSelect / selectedId
(node) => void / string
Click or Enter on an agent; the selected one is highlighted (aria-selected).
defaultCollapsed / foldFinished
string[] / boolean
Default[] / false
Branches folded at first; foldFinished also folds every branch whose agents have all finished. A folded card counts what it hides and flags failed or waiting agents in it.
formatSpend
(usd) => string
DefaultformatUsd
Spend format, for credits or tokens (formatCost still works).
now
number
Fixes the clock (tests, screenshots).
Cards
-
Model logo, name and model, a state badge, tool logos and the task, the approval question or failure, then the spend of the agent and everything under it (its own share in the tooltip) and its clock. Spend eases to new values.
Motion
-
New agents grow in under their parent and their line draws in; folding slides the other cards into place. Instant with reduced motion.
a11y
role=tree
Arrow keys move to the nearest card in that direction (list: ↑ ↓, → opens, ← closes), Home / End, Enter selects, Space folds. One agent is tabbable; Tab from it reaches its Approve / Retry buttons.

When to use

When to use

  • Runs where an orchestrator starts sub-agents and you want the hierarchy at a glance: state, tools, task, clock and what each branch costs.
  • Acting on a branch in place: approve or retry on the card, jump to failures from the header, fold finished branches away.
  • Narrow panels: the same component becomes an indented list below 640px.

When not to use

  • Seeing calls against time: use Trace Waterfall.
  • Several independent main agents side by side, each as a card: use Agent Fleet.
  • Who talks to whom, including tools and people, rather than who started whom: use Agent Graph.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Agent Tree to my app and wire it to my own data.
  • I need runs where an orchestrator starts sub-agents and you want the hierarchy at a glance: state, tools, task, clock and what each branch costs. Set that up with the Knowns UI Agent Tree.
  • Which Agent Tree props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-tree" }) and search_docs({ query: "agent tree" }). Pro props, full examples and source come back once your license key is in the MCP config.

Need help?

Stuck on Agent Tree, or found something off? We read every message.