Ballmac UI home

Agent Graph

New

A layered graph of how agents, tools, memory and people hand work to each other: nodes that say what they are and what they are doing in words, labelled arrows, the active path drawn heavier, and arrow keys that follow the edges.

v1.0.0Updated Oct 24, 2026Ships with a test
What changed
billingreadslooks upasks

Billing agent · Agent, working

Reading the payment record and the refund policy.

Receives from Router. Sends to Customer memory, Payments API, Refund tool.

Installation

$ pnpm dlx shadcn@latest add @ballmac/agent-graph

Usage

import { AgentGraph, layoutGraph } from "@/components/ballmac/agent-graph"

The full example is in the Code tab above.

Examples

With a person and a loop

plandiffchangesapprove?

Select a node to see its connections. The arrow keys follow the edges.

API reference

PropTypeDefault
nodes*GraphNode[]—
edges*GraphEdge[]—
selected

The selected node id. Controlled.

string | null—
defaultSelected

The selected node id for uncontrolled use.

string | nullnull
onSelectedChange

Called when a node is chosen, or null when it is cleared.

(id: string | null) => void—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
TabEnters the graph once, on the first node (or the selected one)
ArrowRight / ArrowLeftFollow an edge to what the node sends to, or to what feeds it
ArrowDown / ArrowUpNext or previous node in the same column; Home and End go to the first and last
Enter / SpaceSelects the node and lists its connections in a sentence (a polite live region)
Screen readersEach node reads 'Coder, agent, working'; status and kind are words, never colour or position alone

Use with AI

nodes is [{ id, label, kind?: agent | tool | human | memory, status?: idle | working | waiting | blocked | done, detail? }]; edges is [{ from, to, label?, active? }]. Columns are computed from the edges; an edge that loops back is drawn under the nodes. selected / defaultSelected / onSelectedChange. layoutGraph(nodes, edges) is exported. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Agent Graph (@ballmac/agent-graph) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing how a multi-agent system is wired and where the work is right now
  • A map of tools and people an agent can call

Not for

  • Who did what over time; use agent-lanes
  • A linear list of steps; use trace or agent-plan
  • Flows with amounts; use flow-sankey

Registry JSON: https://ui.ballmac.com/r/agent-graph.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.