CourseAgentic AI Engineer: The Complete Course · Module 6: Planning and Decomposition · part 37 of 97
Part 37 · Module 6: Planning and Decomposition

Lab: A checked plan for every request

40 min read·13 Oct 2026
Module 6 · Lab · About 75 minutes · Needs: the Module 3 lab's tools.py, and lessons 1 and 2 (Plan, CHECKS, PlanStore, run_plan and revise; done-checks, the consistency check and run_checked)

What you are building

RETURNS_DESK/PLAN.PY AFTER THIS LAB model drafts, replans Plan checked first run_plan waves, 1 replan done systems agree else: a person, with the todo list tools.py: Module 3's 7 tests, no key; audit on every run
The model (amber) only proposes plans; your code (blue) checks and runs them on Module 3's tools (grey), and a request ends done (green) or with a person (red).

The lessons built plans and verifiers in a notebook. This lab moves them into returns_desk/plan.py, the file Module 6 adds to the package, on top of Module 3's tools.py. A plan is a list of steps, each with a done-check that reads BrightCart's systems. Code keeps the plan in a file, runs it wave by wave, holds any email whose claims the systems contradict, replans once from evidence, and then hands over to a person. Tests pin each promise, and a real model plans R-1001, Aisha's $129.00 robot vacuum. Everything at BrightCart is simulated.

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.