Graph API: state, nodes, edges, reducers
Notebook· 07.02· 120–150 min· Lesson 57 of 129
The notebook opens in your lab, in a new tab. If your server is stopped, it starts first (a few seconds).
By the end you can
- Define graph state with
TypedDictor Pydantic, and know what each choice validates. - Control merges with reducers: overwrite (default),
operator.add,add_messages, and custom ones. - Use
MessagesStatefor chat-shaped graphs and runtimecontextfor per-run settings. - Wire nodes with normal and conditional edges,
STARTandEND; compile, invoke and stream. - Visualize a graph inline (PNG, Mermaid, ASCII) and read a step-by-step state trace.
Before you start
Lesson 07.01.
