LangGraph Structural Specification
This graph utilizes a centralized Hub-and-Spoke (Supervisor) routing topology.
Nodes
router: The central supervisor.planner: The LLM logic hub.adder: Worker node.subtractor: Worker node.multiplier: Worker node.divider: Worker node.
Routing Edges
From Router:
- If
error_contextexists ->END - If
current_expressionis a standalone number -> Setfinal_value, route toEND - Else ->
planner
From Planner:
- Reads
next_target_op["op"]. - Routes to
adder,subtractor,multiplier, ordividerbased on the value. - If missing or malformed ->
END.
From Math Agents:
- Execute calculation.
- If
error_contextis raised (e.g.DIV_ZERO) ->END - Else -> Route back to
routerfor the next cycle.