Skip to content

langgraph

etrack.providers.adapters.topology.langgraph

providers/adapters/topology/langgraph: LanggraphTopologyAdapter — a LangGraph graph read as its declared map.

read takes a compiled graph or the JSON of LangChain's Graph.to_json() — the interchange format agent graphs are exported in, so a host that cannot hand over the graph object (another process, a file) still draws it. From a compiled graph, get_graph(xray=True) opens compiled subgraphs into their own nodes (agent:model), so a deep agent mounted as a node shows its inner steps. __start__ and __end__ stay as nodes: a canvas draws where a run enters and leaves. A subagent a deep agent launches through a tool is not declared anywhere — it appears only in the live span tree. A node declared with metadata={"label": …} carries that label: what a person reads on the canvas, the name left intact.

A node that routes by returning Command declares nothing LangGraph can draw unless it says where it may go (destinations= on add_node, or a Command[Literal[...]] return annotation): LangGraph then draws it to __end__ and leaves its targets unreached. The map cannot be guessed; the nodes no arc reaches are named in a warning instead.

GraphEdge

Bases: Struct

An arc of Graph.to_json(): its ends, the branch name a router gave it, and whether a router chooses it.

GraphJson

Bases: Struct

Graph.to_json() as it is exported: nodes and edges.

GraphNode

Bases: Struct

A node of Graph.to_json(): its id, its data — the runnable's description, a name, or nothing — and metadata.

LanggraphTopologyAdapter

Reads any compiled LangGraph graph; holds nothing between reads.

health async

health() -> bool

Always ready: the adapter holds no resource.

read

read(graph: object) -> Topology

The declared nodes and arcs, unplaced, from a compiled graph or the JSON of its Graph.to_json(); an arc's label is the router's branch name when it has one; the nodes no arc reaches are named in a warning.