Level 09 · Production
AI System Design
This level teaches you to draw an AI product as boxes: the person using it, your server, the model, and the document store. You decide what each box is for, what you measure, and what breaks when a box is slow, empty, or down. An AI engineer needs that picture because a single chat reply is not a product. Quality, wait time, and cost have to be chosen together.
Assumes You can explain a prompt, a document the model looks up, and a tool your code runs when the model asks for it. · 16 study sessions · 9 modules
Ship it
Capstone: AI System Design Document
Pick one product you could explain to a friend, such as a support draft helper, a repo helper, or a research brief. Write the design as boxes: the user, your server, the model, and the document store. Every major box needs a reason tied to wait, cost, or answer quality, plus at least two ideas you dropped.
A drawing with no sentences does not pass. You are done when a skeptical reader can point at one sentence they disagree with, and you can say what breaks if that box is removed.
1. A complete design document
Open one text file and use only the headings from the later steps, filled for a single product. Name the user, the path of one request, and the numbers you are designing toward. Do not paste a generic model picture from memory. You are done when a friend can tell which product this is from the first paragraph alone.
2. Requirements & success criteria
State the user, the task, and three success measures you can score, such as answers that stay inside a source, tasks that finish, and a defect you refuse to ship. Add non-goals so the scope does not slide into actions you cannot test. Under each measure, write where the number would come from. You are done when each measure has a source a person could check.
3. Expected traffic & constraints
Write the traffic you expect, a wait cap, a spend ceiling per task, and one privacy rule. Mark which of those are hard. If a figure is unknown, write the assumption and design to it. You are done when a design that breaks a hard limit is named and crossed out in the file.
4. High-level architecture
In words or boxes, draw the path from the person to the response, including lookup, model calls, tools, and any human step. Label which boxes wait on the request and which are queued. Add a short paragraph on why this shape beats one prompt for the limits you listed. You are done when every box has a neighbor and the paragraph names a limit.
5. Model choice & routing
Name the model roles you need, such as a labeler, a drafter, and a backup, and the rule that picks among them. Add a second model only if you also name the quality risk. Say which sample you would rescore when a route changes. You are done when the rule can be followed without guessing, and the sample is named.
6. Context / RAG architecture
Describe the sources, how you split them, what is fetched versus pinned in the prompt, and how permission checks and citations reach the answer. Give a freshness target for each source. State what you keep out of the window on purpose. You are done when each source has a freshness line and one fact is explicitly left out.
7. Tools & agents where required
List the tools, and mark which ones change the world outside the chat. If a fixed pipeline is enough, say you need no open loop and why. If you include an agent, name the branch a fixed pipeline cannot express. Write the allow-list and the condition that stops the run. You are done when every world-changing tool has a stop or a person.
8. Caching strategy
Pick the caches you will actually use, exact, prefix, retrieval, or semantic, and give each a key and a lifetime. Call out any answer that must never be reused across people. State the hit rate that would make you call that cache a win. You are done when each cache has a key, a life, and a win number, or you wrote none and why.
9. Latency & cost budget
Split one typical request into lookup, time to the first token, generation, and tools. Put a rough millisecond or cent figure on each and label guesses. Add them and compare the total with your caps. Name the first cut if the total is over budget. You are done when the sum is visible and the cut is a specific step.
10. Reliability & fallback strategy
For a provider outage, an empty lookup, and a bad tool result, write what the person sees. Include timeouts, which calls may be retried, and a degrade ladder that ends in a clear refusal or a handoff. Do not write that the model will handle failure. You are done when each failure has visible words and the ladder has a last rung.
11. Security & guardrails
Put checks on lookup, on tool execution, and on the final output. Describe one hostile line inside a retrieved document, and one way private data could leak. Point to at least one control that is code, not a sentence in the prompt. You are done when that code control would reject the hostile example you wrote.
12. Evaluation & monitoring
Define the offline case set, the live numbers, and the trace fields you store with each request. Include one quality metric and one cost metric. Say which alert wakes a person and which alert only hits a dashboard. You are done when a fake bad request would show up in a field you listed.
13. User-feedback loop
Specify one signal the person gives on purpose and one you infer from behavior. Explain how you strip personal data before storage, and how a bad trace becomes a new scored case. Name who reviews samples each week. State what is blocked until that new case passes. You are done when the new-case path has an input, a forbidden output, and a reviewer.
14. Scaling strategy
Say what fails first at ten times the traffic: provider quota, index size, queue depth, or human review. Name the lever you pull, such as a cache, a batch, a smaller model, a split of the store, or more reviewers. Name the metric that tells you to pull it. A bigger machine alone is not a plan. You are done when the lever is tied to a metric, not a hope.
15. A diagram and the rejected alternatives
Add the diagram and a short section with at least two designs you rejected. Tie each rejection to the limit it failed. State the quality, wait, or cost trade you accepted in the design you kept. You are done when a reader can disagree with one specific sentence, and you can say what breaks if that sentence is reversed.