LESSON 05 OF 05 · 90 MIN
Free Capstone: Production Lead Intelligence Agent
Build one small working system that uses all four ideas at once — then break it on purpose, four ways.
You have seen four ideas on their own: how a real system is shaped, asking for a filled-in card, checking parcels at the door, and handing over keys carefully. Now you build one small thing that needs all four at once — which is the only way to find out whether they actually stuck.
So what is this really about?
You are going to build something that receives an enquiry, works out what it is about, and does one useful thing with it. Deliberately small. The interesting part is not the happy path — it is that you will break it on purpose, four specific ways, and it has to behave sensibly each time.
QUICK CHECK
Which of these four would you expect to be hardest to get right?
The words you will hear
- Capstone
- The build at the end that uses everything, rather than one more exercise.
- Extraction
- Pulling named facts out of messy human text: who, what, how urgent.
- Routing
- Deciding where something goes next, based on what you extracted.
- Confidence
- How sure the AI claims to be — useful only if you decided in advance what to do when it is low.
What you will be able to do
- Build a validated, idempotent webhook endpoint.
- Extract structured data from an unstructured enquiry.
- Execute one controlled tool with an explicit permission boundary.
- Demonstrate correct behaviour under invalid input and tool failure.
Going deeper
This capstone assembles the four lessons into one working system. It is deliberately the same shape as the lead capture behind this site, because that is a real problem with real failure modes rather than a toy.
What you are building
An endpoint receives an enquiry. It validates and durably stores it, extracts structured fields with a model, decides a routing category, and calls exactly one tool to act on that decision. Every stage handles its own failure.
Requirements
- Webhook. Accepts POST only. Verifies a shared secret, caps body size, validates against your schema, and is idempotent on a sender-supplied id.
- Durability. The enquiry is stored before any model call. A later failure must not lose it.
- Extraction. A structured call returning a defined schema: contact details, an intent category from a fixed set, urgency, and a confidence value.
- Routing. A deterministic rule over the extracted fields. Low confidence routes to human review — the model does not decide its own trustworthiness.
- One tool. A single controlled action, with an explicit permission boundary you can state in a sentence.
- Observability. For any enquiry, you can reconstruct what arrived, what was extracted, what was decided and what ran.
How it is assessed
The happy path is the easy part. The capstone is complete when all four of these behave correctly:
- The same event delivered twice produces one stored enquiry and one action.
- A payload failing schema validation is rejected with a clear error and stores nothing.
- A model response that does not conform is retried once, then fails cleanly without a partial write.
- A tool failure leaves the enquiry stored and flagged for attention, never silently dropped.
If those four hold, you have built something that will survive contact with real traffic — which is the entire point of this course.
Resources
- Starter repository specification — Structure, setup and the four failure tests
Sign in to save your progress through this course.
