Lesson deck

LangGraph: persistence, human approval and failure flashcards

Reviewing needs JavaScript. You can read every card in the list below.

Loading your cards...

Back to the lesson13 cards in this deck

Read all 13 cards as a list
  1. Front
    Checkpointer or store?
    Back
    Checkpointer: one thread's state at each step, keyed by thread id (continuity, approvals, time travel, recovery). Store: memories across threads, keyed by namespace and key (long-term memory).
  2. Front
    What does a thread id select?
    Back
    Which saved state to load. Reuse it to continue; a new id starts fresh. Treat it as part of access control.
  3. Front
    Why not the in-memory saver in production?
    Back
    Checkpoints are in RAM and lost on restart, so paused runs and conversations vanish. Use a database-backed saver, and prune old checkpoints.
  4. Front
    How does interrupt pause and resume a run?
    Back
    interrupt saves state through the checkpointer and returns its payload to the caller. Invoking again with a resume command on the same thread continues; interrupt then returns the resume value.
  5. Front
    Where does execution restart after an interrupt?
    Back
    At the top of the same node, not the line after the call. Everything before interrupt runs again.
  6. Front
    Rules for using interrupt?
    Back
    Needs a checkpointer and thread id; JSON-serialisable payload; no bare try-except around it; stable interrupt order; no while-true loop (use a conditional edge); resume parallel interrupts with a map of ids.
  7. Front
    Static breakpoints or interrupt for approvals?
    Back
    interrupt. Static breakpoints (before or after a node) are a debugging aid; the docs do not recommend them for human-approval flows.
  8. Front
    What guarantee do outside side effects get after a failure or resume?
    Back
    At least once. A node that failed part-way re-runs from its start. Use idempotency keys or check for an existing result.
  9. Front
    How do you stop a duplicate approval from refunding twice?
    Back
    Send the refund with a stable key derived from the request, so a second resume is recognised and ignored. A fresh random key per attempt would not help.
  10. Front
    The three durability modes?
    Back
    exit (save only when the run ends: fastest, no mid-run recovery), async (save while the next step runs: small loss window), sync (save before the next step: safest, slowest).
  11. Front
    What does replay from a checkpoint do?
    Back
    Nodes before it are not re-run; nodes after it run again, so model calls and side effects happen again and may differ. Replaying from the final checkpoint does nothing.
  12. Front
    What does a fork do?
    Back
    Updates state at an earlier checkpoint and branches a new checkpoint from it. The original history stays intact. Later steps then run live.
  13. Front
    Wrong assumption at step 4 of 9: how to fix it?
    Back
    Fork from the checkpoint before step 4 with corrected state. Steps 1 to 3 are not redone; steps 4 to 9 run again, with their side effects.