11.03

Persistence and human-in-the-loop

skillmaxingPython with AIPersistence and human-in-the-loop
Visual lesson

Persistence and human-in-the-loop

Included with Pro · 3:59
Lessons · 921 words

A graph compiled with a checkpointer writes its state to storage after every step, filed under a thread_id. That sounds like a small feature and it is the one that turns a script into a service. The same run can be continued in a later HTTP request, from a different worker, after a deploy. And because the state on disk is complete, a run can stop in the middle of a node, wait for a human for as long as it takes, and carry on from the same line of code with the human's answer in hand.

Every step lands in Postgres
Figure 1Every step lands in PostgresThe client starts the run; the lead resumes it; both are checkpoints on one thread.

Relay's escalation is the natural place for that pause. The model may decide a ticket needs a person, but a support lead should confirm before a customer gets an "escalated" email. The graph should propose, stop, and resume only when someone approves.

Pro

Continue reading

Pro unlocks every video lesson, the full notes and runnable code across the Python with AI course, from the language itself to agents, MCP, Langfuse and deployment.

Unlock full access to
Python with AIAI researchComplete system design
30% off with LAUNCH30ends in 7h 40m
Buy now
View all plans ·Already Pro? Sign in
124 online