Skip to content
Sign in
ObservabilityGraph state viewerMenu

Graph state viewerPro

A state graph with the run drawn on it, and the state object.

ProA support agent mid run with two tool loops.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/graph-state-viewer

Usage

tsx
import { GraphStateViewer } from "@/components/ui/chatcn/pro/graph-state-viewer"

<GraphStateViewer nodes={nodes} edges={edges} path={visited} running state={state} changedKeys={["messages"]} />

Layers come from the distance to the start node; edges back up the graph, like a tool loop, curve round the side. Taken edges are solid with a count, the rest dashed. The current node is ringed and labeled Now, or Failed.

Examples

States

ProNot started, finished, and failed in a tool call.

Props

PropTypeNotes
nodes, edgesThe graph
pathstring[]Visited node ids in order
running, failed, currentIdRun status
state, changedKeysThe state object
onSelect, selectedIdMakes nodes buttons

Accessibility

  • Every node names its visits; the path is also a text list under the graph.