Deployed Lab

Module 6 · Capstone · Chapter 23 · Free

Capstone: design your own AI system end to end

19 min1 clickable picture1 self-review lab1 predict, 2 quick quizzes, 5-question final quiz5-min video review
In 30 seconds

The picture: the eight layers from chapter 2, used as a checklist. Every layer gets one decision from you.

What this chapter gives you
The cold open

Northbeam Tutors is a made-up tutoring company. Its team brought a 14 page homework helper design to review. All 14 pages compared models.

A design document is not a model comparison. It is the decisions a team must not remake.

The plan for this chapter
  1. Pick a brief.
  2. Write requirements and constraints.
  3. Sketch the system on the eight layers.
  4. Pick patterns; log tradeoffs, evals, fallbacks.
  5. Model the cost and review the risks.
  6. See a finished design, then score yours.

Next: pick the system you will design.

Step 1: Pick your brief

Write the brief at the top of your document: product, users, hard constraints, three lines.

Next: turn the brief into requirements a design can be checked against.

Step 2: Requirements and constraints

Requirements say what the system must do. Constraints say what it must live with. Write both before boxes and arrows.

Think of it as a contract before a house build: rooms and budget first, bricks later. Where the picture breaks down:

Next: the sketch, drawn on the reference architecture.

Step 3: Sketch on the reference architecture

Chapter 2 gave you eight layers. Here they become a checklist: walk the picture, one decision per layer. A layer you skip is a decision made by accident.

The eight layers as a capstone checklist Eight layers: surface, orchestration, model gateway, retrieval, tools, memory, guardrails, and eval with observability. Each layer holds one capstone decision. 1 Surfacewhere users meet it 2 Orchestrationthe flow of steps 3 Model gatewaymodels and routing 4 Retrievalfacts it can fetch 5 Toolsactions it can take 6 Memorywhat it remembers 7 Guardrailschecks and humans 8 Eval + observeproof it works
  1. Where it lives: chat, voice, in-app panel. Note device and conditions, like gloves or low signal.
  2. The flow: one call, a fixed workflow, or an agent loop (chapter 8).
  3. Which models, and whether a router (chapter 7) sends easy work to a small model.
  4. Where facts come from: documents, a database, or live tools. Most pattern picks land here.
  5. What it may do: read only, or act, and which actions need approval.
  6. What persists between turns and sessions (chapter 9), and what must never be stored.
  7. Checks on input and output, and where a human takes over (chapter 10).
  8. How you know it works: traces, a golden set, alarms. This layer judges the others.

Your sketch is one page: eight boxes, one decision each, arrows for the main flow. Detail goes in later steps, not the drawing.

Next: choose the patterns that fill the sketch.

Step 4: Pick patterns, with reasons

Pick at least one pattern from each group. For every pick, write the reason and a when-not-to note. A pick without a reason is a fashion choice.

Streaming (chapter 13) and memory (chapter 9) are optional: add only if a requirement asks.

Next: record what each choice costs, and how you will prove the system works.

Step 5: Tradeoff log, eval plan, fallback ladder

Tradeoff log. Three decisions. For each: the choice, the attribute bought, the attribute spent. Example: "Cache answers for 24 hours. Bought: cost. Spent: freshness." Chapter 3 gives the vocabulary.

Eval plan (chapter 11). Three lines minimum:

Fallback ladder. Rungs from best to last resort: full answer, smaller model, cached or partial answer, honest refusal, human handoff. Each names its trigger.

A perfect threshold on open ended answers blocks everything. Set one you can defend: no drop on safety cases, a small drop overall at most, and treat a miss as a review, not a bypass.

Next: price the design and name its worst days.

Step 6: Cost model and risk review

Cost model. One line of arithmetic: requests per day, times tokens per request, times price, plus fixed costs like indexing. Use illustrative prices and say so. Show expected volume and ten times it.

Risk review. Three questions, in plain words:

Each risk gets a guardrail or fallback already in your document. No defence means an open item: mark it.

Next: one brief, designed in full, so you can compare shapes.

Worked example: brief B, compressed

Fieldwise Facilities is stated as made up. Its technicians service pumps and air handlers at client sites. All numbers are illustrative.

1. Requirements. Answer from machine manuals, cite model and page, on a phone with poor signal. Targets: 90 percent of answers grounded in a cited passage, first text within 4 seconds, at most $0.06 per answer. Constraint: no manual text leaves the company account. Out of scope: ordering parts, safety sign-off.

2. Sketch. Surface: phone app, voice input. Orchestration: fixed workflow, search, answer, check citation. Gateway: router sends simple lookups to a small model. Retrieval: manuals indexed per machine model. Tools: read only, plus "call the office". Memory: current machine only, cleared per job. Guardrails: citation required, low confidence to a dispatcher. Eval: traces on every answer.

3. Pattern picks. Retrieval: document search filtered by machine model, since the question names the machine. When not to: live sensor values, which need a tool. Output: structured answer with steps, warnings and citation fields. Reliability: citation check in code; no matching passage, no answer. Cost: cache per manual version, since 40 technicians ask the same questions.

4. Tradeoffs. Read only tools: bought safety, spent convenience. Cache per manual version: bought cost, spent freshness, handled by version keys. Small model first: bought speed, spent accuracy on rare machines, handled by escalation.

5. Eval plan. Golden set: 150 questions from senior technicians, 30 of them traps with no answer in the manual. Graders: code checks citations, humans grade 30 weekly. Threshold: 90 percent grounded, zero invented citations, or no ship.

6. Fallbacks. Large model, small model, cached answer, the manual PDF page, then the dispatcher.

7. Cost. Illustrative volume: 300 questions a day, about 3,000 input and 400 output tokens per answer. Illustrative prices: $3 per million input, $15 per million output. Per answer: 3,000 / 1,000,000 x $3 = $0.009, plus 400 / 1,000,000 x $15 = $0.006, total $0.015. Daily: 300 x $0.015 = $4.50, about $135 a month. At ten times volume, $1,350, still $0.015 per answer, under the target.

8. Risks. Worst fluent failure: a confident torque value from the wrong pump model. Defence: model filter plus citation check. Worst leak: one client's site notes shown to another crew. Defence: manuals partitioned per client, in code. Runaway cost: a retry loop on poor signal. Defence: two retries maximum, then the PDF rung.

Next: write your design, then score it.

Lab: draft your design, then score it

Why this exercise: most weak designs are not wrong, they are unfinished. Scoring coverage finds the missing section before a reviewer does.

Do this:

  1. Draft your document, one section per checklist line. Keep it under three pages.
  2. Complete the design form below, then press Check and fix what the checks name.
  3. Rewrite only your weakest section.

The course design checklist (illustrative starter, copy it):

DESIGN CHECKLIST (illustrative)
[ ] Brief: product, users, hard constraints (3 lines)
[ ] Requirements: jobs, quality targets with numbers, out of scope
[ ] Sketch: eight layers, one decision each, main flow arrows
[ ] Patterns: one each from retrieval or structured data, output
    and tool use, reliability, cost. Reason + when-not-to each.
[ ] Tradeoff log: 3 decisions, attribute bought, attribute spent
[ ] Eval plan: golden set size and source, graders, release threshold
[ ] Fallback ladder: at least 3 rungs, trigger named for each
[ ] Cost model: volume x tokens x price, at 1x and 10x volume
[ ] Risk review: worst fluent failure, worst leak, runaway cost,
    each with a defence in the design

Lab: This capstone uses Brief B from the chapter: a maintenance copilot for a facilities firm. This lab runs in your browser and needs JavaScript enabled.

What to notice
Field note, November 2026

Design reviews in production teams tend to spend most time on failure and cost, not the happy path demo. Copy that: bring your fallback ladder and cost model first, and expect the hardest questions there. Treat prices as moving parts; check current vendor pages before quoting figures elsewhere.

Mix-ups to avoid

Chapter quiz

Five questions. Score 70% or more to mark this chapter complete.

Review this chapter in 5 minutes

Watch the whole chapter recapped: Picking a brief, the six design steps, pattern picks, the tradeoff log, eval plan, fallback ladder and self-review.

Decision rule: if a checklist section is empty, the design is not finished.

Review

Glossary

Design document
The written record of decisions, reasons and tradeoffs for one system.
Brief
The short statement of product, users and hard constraints.
Reference architecture
The eight layer sketch from chapter 2 most AI products share.
Tradeoff log
Decisions listed with the attribute each bought and spent.
Golden set
A fixed set of test cases with known good answers.
Release threshold
The eval score a change must beat before it ships.
Fallback ladder
Ordered backup behaviours, down to a human handoff.
Fluent failure
A wrong answer written so smoothly nobody questions it.

Next: "AI system design interview practice: timed exercises with model answers".