Skip to main content
Render a compiled graph as Mermaid text or a PNG image to inspect topology and debug routing. For an interactive UI, use LangSmith Studio with a local server. You can visualize any compiled graph that exposes getGraphAsync(), including StateGraph. The examples below use the same small graph in both languages: two nodes, a conditional edge from node1, and a loop back from node2.

Mermaid

Call draw_mermaid() on the drawable graph to get Mermaid syntax. Paste the string into any Mermaid renderer, or keep it in docs and PRs.

PNG

Render the graph as a .png. This uses the Mermaid.ink API to generate the diagram.

See also