Skip to content

Agent Graph

Agents and the tools they call as a live network. Each call travels as a light streak along the link, and the target lights up when it lands. Links stay hairline-thin; only the streak shows traffic.

On this page
Used for
  • Watch a run live
  • See who called which tool
  • Map a team of agents
  • Spot a stuck agent
  • Demo a multi-agent flow

Examples

Layout
Scenario

Installation

npx knowns-ui@latest add agent-graph
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Layouts

tree flows top-down and stacks tools into a list when a row gets crowded, then scrolls sideways. horizontal flows left to right and grows downward. center puts the root agent in the middle with branches on both sides. radial puts it in the middle with You just above it, its agents on a tight inner ring (diagonals first) and every tool packed just outside the ring, next to the agent that calls it. In a fixed frame the rings are ellipses shaped like the frame, so the graph fills it. Below 520px both fall back to tree. Center lays out again on every join or leave and everyone glides to the new spot: agents are balanced between both sides, a heavy agent's tools pack into a grid beside it, and the lead stays in the middle. Radial is stable: nodes that join mid-run take the closest free spot and everyone else stays put (an agent whose slot is already taken by tools lays the graph out again). With a fixed height (and width), the graph fits that frame and scales down if it must.

Tools sit under the agent that called them first, so the tree does not reshuffle while calls stream in.

Props

run
AgentRun
Read actors, spans and links from a run. Takes precedence over the data props.
actors / spans / links
Actor[] / Span[] / Link[]
Default[]
Plain data instead of a run.
layout
"tree" | "horizontal" | "center" | "radial"
Default"tree"
How the graph is arranged. Radial: lead in the middle, You just above it, agents on an inner ring, tools packed just outside it beside their agent (elliptical rings shaped like a fixed frame); newcomers take the closest free spot.
intro / introSpeed
"grow" | "fade" | false / number
Defaultfalse / 180
How the graph appears on first layout, after a reset or a new run. Grow reveals nodes from You outward: each link draws into its child, then the child pops in, siblings staggered, the whole reveal capped near 2.5s. Streaks wait for both ends. Off with reduced motion.
ref
Ref<AgentGraphHandle>
replayIntro() plays the intro again.
selectedId
string | null
Controlled selection. Leave undefined to let the graph manage it.
onActorSelect
(actor | null) => void
Fires when the detail popover opens or closes.
renderDetail
(actor, spans) => ReactNode
Replace the body of the detail popover.
header
ReactNode | false
Default"Agent graph"
Title of the header bar, or false to hide it.
activityWindow
number
Default20000
Window in ms of calls counted toward the calls/min readouts.
height / width
number
Defaultfits / container
A fixed frame: the layout targets this box; if it still doesn't fit, the canvas scales down to fit (no scrollbars).
fit
"contain" | "none"
Default"contain"
With a fixed height: scale to fit, or the old sideways scroll.
zoomControls
boolean | "bottom-right" | "top-right" | "bottom-left"
Defaulttrue ("bottom-right") in a frame
Zoom out / in / Fit in a corner; fitting keeps the graph clear of them, and they fade back while the pointer is on the canvas. ⌘/Ctrl + wheel or pinch zooms around the cursor, drag pans, double-click fits.
touch
"pan" | "scroll"
Default"pan"
Touch in a frame. Pan: one finger pans, two pinch. Scroll: swipes scroll the page and the graph takes taps only. Use it in a long page, like a landing hero.
clock
number
DefaultDate.now()
Clock for rates; without it the graph ticks every second.
formatSpend
(n) => string
Default$0.00
How spend is shown.

Accessibility

Every actor is a button labelled with its name, type, state, model, activity and call rate. Tab walks the tree in order and highlights the focused actor's neighbours; Enter opens the detail popover, Escape closes it and returns focus. A visually hidden list mirrors the graph, the needs-you / failed chips sit in a polite live region, and state is never shown by colour alone. Streaks and breathing stop under reduced motion.

What it handles

  1. 01Lays agents and their tools out as a tree, horizontal, center or radial graph with the layout prop, and falls back to the tree below 520px.
  2. 02Sends a light streak along a link each time a new span starts, and the answer travels back once the span gets an outcome.
  3. 03Thickens a link by how many spans crossed it inside activityWindow, 20 seconds by default, so busy paths stand out.
  4. 04Opens a detail card on click or Enter with the agent's state, spend and last spans, closes it with Escape, and takes your own body through renderDetail.
  5. 05Pans by dragging empty canvas, zooms with ctrl or cmd plus wheel or a pinch, and fits the whole graph from the corner zoom buttons.
  6. 06Plays an optional intro that grows nodes outward from You, and replayIntro() on the ref runs it again.

States

First render
Nothing. It paints as it is, unless intro is set
none
intro="grow"
Each link draws into its child, then the node pops in from 0.9 scale
280ms, ease out
intro="fade"
Nodes fade in together
180ms, ease out
A streak reaches an agent
The node's halo flares once in the streak's colour
280ms, opacity only
Node hover or focus
Border and shadow change
120ms, ease out
Detail card opens
The card rises into place
180ms, ease out
Reduced motion
No intro, flare or join animation
0ms

Works with

When to use

When to use

  • Showing which agents and tools a run involves and how they connect, while calls are happening.
  • An overview panel where the shape of the work matters more than exact timings.
  • Runs with a handful to a few dozen nodes, where a click on a node should open its details.

When not to use

  • You need to see when each call started and how long it took: use Trace Waterfall.
  • You want who spawned whom as an org chart, with the cost of each branch: use Agent Tree.
  • A decorative hero graph with no real run behind it: use Run Pulse.

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 Graph to my app and wire it to my own data.
  • I need showing which agents and tools a run involves and how they connect, while calls are happening. Set that up with the Knowns UI Agent Graph.
  • Which Agent Graph props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-graph" }) and search_docs({ query: "agent graph" }).

Need help?

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