Skip to main content
This tutorial builds a two-node support flow that normalizes a request and produces a result. It uses only the embedded core—no database or model API key is required.
1

Create the file

Create support_graph.py:
2

Invoke synchronously

Add this at the end of the file:
3

Observe state updates

Replace the invocation with:
updates yields superstep deltas; values yields complete state; events yields lifecycle events; custom receives values written through stream_writer.

What compilation does

compile() validates reachability, edges, state schemas, and reducers, then freezes an immutable execution plan. Fields use LastValue by default. When parallel nodes write the same field, declare a deterministic merge function with Annotated[T, reducer].

Add checkpoints

Use InMemorySaver for tests, SqliteSaver for local persistence, and PostgresSaver in production. Continue with Durable execution.