Exercise 3 — Memory on disk and a human approval step

Guided practice6 min
Time
35 min
You need
the kit, the venv, Ollama running, week12/diag_tools.py and week12/exercise_2_solution.py in place
Deliverable
the output of the four runs, and the number of rows in the checkpoints table

The lab kit of the course: https://github.com/hrhouma2/aiopsatlas-ml-data-diagnostics-labs-en

Goal

Two changes to the agent of Exercise 2. First, a checkpointer: the state is saved in data/checkpoints.sqlite after every node, under a thread_id, so a technician can ask a follow-up question and the agent remembers. Second, a gate: before any SQL that reads the incidents table, the graph pauses with interrupt() and shows the query to a human. The human says yes or no, and the graph resumes. You will run the same thread twice to prove the memory, and a new thread to prove the forgetting.

Preview — the rest of the lesson is for enrolled readers.

Already enrolled with a code?

Your access is tied to your account, not to this link. Sign in with the same email you used in class: your course is waiting, no need to enter the code again.

Sign inNo account yet? Create one
This lesson is part of the “Week 12 — Stateful workflows with LangGraph” module

The first modules of the course are open to everyone. For the rest you have three options: buy this course once and for all, subscribe, or enter the code handed out in class.

Are you a student on this course?

The code is tied to your account: sign in or create an account and it will be applied automatically when you come back.

No account yet? Create one