Week 15: Exercises & Checklist
Graded exercises
Easy: Run
notebooks/01-langgraph-support-agent.ipynbend-to-end with the mock brain. Copy the graph diagram (ASCII/Mermaid) and the per-node latency/token table into the Week 15 sheet of the Excel tracker.Standard: Change the refund-approval threshold from
$500to a value of your own, add one new node (log_escalation) that writes an escalation record to a JSONL file on the escalate path, and re-print the graph visualization so the new node appears.Stretch: Run with a real API key, deliberately crash the graph mid-run (e.g. raise in the
toolnode), then resume from the checkpoint withCommand(resume=...)and confirm the final answer matches a clean (uncrashed) run. Record the checkpoint ID you resumed from.Portfolio: Commit the graph agent with (a) the visualization, (b) the checkpoint config, and (c) the refund-approval trace; add a
READMEblock stating the graph shape, the threshold, and which node the interrupt guards (tracked incurriculum/projects/README.md).
Hints
- Easy: Run top to bottom with the mock brain; copy the Mermaid diagram and the per-node latency/token table exactly as printed. The table's
callscolumn tells you which nodes actually fired. - Standard: Find the
500.0comparison insidecompute_refund/classify_intent, not the diagram string; change the threshold in one place, then addlog_escalationas a node that appends a line to a JSONL file and wire it on theescalatepath beforeescalate. - Stretch: Raise inside
tool_nodeto force the crash, then resume on the samethread_id; compare the resumedfinal_answerto a clean run's. Record the checkpoint id fromgraph.get_state(cfg). - Portfolio: The reviewer reads the
READMEblock cold: state the graph shape (nodes + edges), the checkpoint config (MemorySaver), the threshold, and which node the interrupt guards, not just "HITL was added."
Checklist (mirrors manifest.json + Excel tracker)
- [ ] Mon: Study graph-based agent design (reference/knowledge-base/10-agents-multiagent.md + LangGraph docs).
- [ ] Tue: Port the Week 14 agent to LangGraph; visualize the graph.
- [ ] Wed: Add checkpoints and resume; crash mid-run and recover.
- [ ] Thu: Add the human-in-the-loop interrupt for refunds over $500.
- [ ] Fri: Use case: end-to-end run with approval; record latency and tokens per node.
- [ ] Sat: Take the Week 15 quiz (quiz.md), pass with 8/10; record the score in Notes.
- [ ] Milestone: Update the Excel tracker; commit the graph agent.