CourseAI System Design: The Complete Course · Module 9: Agentic Architecture · part 67 of 107
Part 67 · Module 9: Agentic Architecture

Lab: The bounded Cases agent over MCP

266 min read·
Module 9 · Lab · About 75 minutes · Needs: lessons 1 to 6 of this module, and the Module 8 lab (or nothing: Step 1 rebuilds Modules 1 to 8)

What you are building

A Cases request End to end Active flow Background or async 1 Processing step number Client Maya's request C012, a monitor Jobs RQ RQ job returns a run id Orchestration Lesson 1's loop think, act Tool gateway gateway tenant views Approval approval interrupt() and a checkpoint MCP servers Around every call hris assets tickets access spans and audit every call kill switches before every call trajectory eval the path, not the end 1 2 3 4 5
The lab's piece: a request becomes a job (yellow) running Lesson 1's loop (blue) over four MCP servers behind the gateway; approvals pause with a checkpoint (green); every call is a span and an audit line, read against the kill switches (teal), and the path is scored.

Maya Ortiz's monitor from Lessons 1 and 6 now runs on the whole platform. The six lessons' files go into the repository unchanged and are joined into one Cases agent: Lesson 1's bounded LangGraph loop calls its tools through four MCP servers behind Lesson 3's gateway; each run is an RQ job that pauses for approval with a checkpoint and resumes on any worker; every call is a span and a line in the hash-chained audit trail; kill switches are read before every call; and trajectory evaluation scores each run's path.

The eight Cases tools are per-intent tools, as Lesson 2 names them. One optional cell calls your provider; every number quoted comes from scripted models, in-memory MCP and fakeredis. Open a new Colab notebook, module-09-lab.ipynb, and run each cell in order.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan