This lesson is part of AI Architect (Intermediate): Design the System. Enroll for free, then sign in, to read it in full.
What you'll learn: how to turn a vague AI feature request into requirements you can test (quality bar, latency, cost, risk, data sensitivity), separate constraints from preferences, choose between building, buying and configuring, record the choice in an architecture decision record (ADR), and run a design review that ends in a decision.
At a glance
Figure 1. From business goal to recorded decision
flowchart TD
accTitle: From business goal to recorded decision
accDescr: A business goal produces quality requirements and constraints. They frame the options, the chosen option is written as an ADR and reviewed. An approved design is built and measured, and a miss produces a superseding ADR.
G["Business goal"] --> Q["Quality requirements"]
G --> C["Constraints"]
Q --> O["Options: build, buy, configure"]
C --> O
O --> A["Decision record (ADR)"]
A --> R{"Design review"}
R -- approved --> B["Build and measure"]
R -- "not approved" --> O
B --> T{"Meets requirements?"}
T -- yes --> OP["Operate and monitor"]
T -- no --> S["Superseding ADR"]
S --> O
How to read this: requirements and constraints feed the options, the review gates the build, and a miss in measurement loops back as a new decision rather than a quiet patch.
- A requirement is useful only if a test can fail it: an indicator, a threshold, a window and a measurement point.
- A constraint limits how you may build. Mark it fixed or negotiable and name who can change it.
- There are three ways to get a capability: build it, buy it, or configure what you already own.
- An ADR records one costly decision and its reasons. Supersede it, never edit it.
- A design review ends in one of three written outcomes, never in "looks fine".
- AI outputs are probabilistic, so "does it work" becomes "how often, on which inputs, measured how".
The real-world problem
A team is asked to "add an AI assistant to the support tool". Three weeks later a demo answers well in the meeting, and then the questions start.
The team built something real without deciding anything, so every later argument is about taste.
After this page you will be able to
- Rewrite a vague AI requirement into one with a measurement, a threshold and its conditions.
- Compute whether a pass rate on an evaluation set supports a quality requirement, with its sampling uncertainty.
- Choose between building, buying and configuring using explicit criteria, and say what would change your mind.
- Write a complete ADR for a model-choice decision, with status and consequences.
- Run a 60-minute design review with an agenda, questions and a recorded outcome.
Prerequisites and cross-links
- Know what a prompt, a context window and a token are. Background: LLM inference explained, Testing AI applications and Evaluating RAG with RAGAS.
- For cost, use the site's LLM cost estimator; this page states no prices. Diagrams are page 3, evaluation page 8, threat modelling page 12.
- Terms: architecturally significant requirement, SLI, SLO, SLA, error budget, ADR, decision log, design review, risk tolerance and build vs buy vs configure.
Core concepts
Requirements for AI systems
Figure 2. Anatomy of a testable requirement
flowchart LR
accTitle: Anatomy of a testable requirement
accDescr: A user need becomes an indicator with a defined measurement point, then an objective with a target, window and conditions. The objective is checked by a test or monitor. A miss spends error budget and triggers a defined action.
N["User need"] --> I["Indicator: what is measured, where"]
I --> O["Objective: target, window, conditions"]
O --> T["Check: eval set, load test, monitor"]
T -- pass --> OK["Requirement met"]
T -- fail --> E["Spend error budget"]
E --> X["Defined action: fix, roll back, escalate"]
How to read this: a requirement is complete only when it reaches a check and a defined action for failure, otherwise it is a wish.
Only some requirements shape the structure. The ADR community's site defines an architecturally significant requirement as "a requirement that has a measurable effect on the architecture and quality of a software and/or hardware system" (adr.github.io). "The button is blue" is not one. "p95 latency under four seconds" is: it decides whether you can call a large model synchronously, whether you need streaming and whether retrieval must be cached.
The vocabulary: SLI, SLO, SLA
Google's SRE book supplies the vocabulary (SRE book, Service Level Objectives).
- Start from the user: "Start by thinking about (or finding out!) what your users care about, not what you can measure."
- Say how and where: "SLOs should specify how they're measured and the conditions under which they're valid."
- Use distributions: averaging latencies "obscures an important detail", the long tail, and a high percentile "shows you a plausible worst-case value".
The chapter covers latency, errors, throughput and availability. Applying the same structure to answer quality is an extension: a quality score on a fixed sample is an SLI like any other.
The five kinds, made testable
Check yourself: a requirement says only "p95 latency under 4 seconds". Which two things from the table's latency row are missing?
The conditions (requests under 3,000 input tokens) and the measurement point and window (at the API gateway, over a rolling 7 days). Without them two teams can measure different things and argue forever.
Two more habits. Quality needs a rubric, not a vibe: two reviewers must be able to apply "acceptable" and mostly agree. Data sensitivity is a requirement on the architecture, not a note in the policy: it decides which providers are allowed, what logs may contain and how long traces live.
Risk: tolerance is a decision
NIST's AI Risk Management Framework (AI RMF 1.0, NIST AI 100-1, January 2023, PDF) is voluntary. Use it as a vocabulary for the conversation, not as a compliance test.
Approval steps, output filters and logging all depend on the tolerance. NIST also publishes a Generative AI Profile (NIST-AI-600-1, released 26 July 2024). As of 2026-10-21, NIST's page says AI RMF 1.0 is being revised, so check the NIST page.
Targets: cautions from the SRE book
- Do not pick a target "based on current performance".
- Avoid absolutes, and "have as few SLOs as possible".
- It is "better to start with a loose target that you tighten".
A prototype scoring 88% on a hand-picked set is no reason to write 88% into the requirement. Treat the gap to what the business needs as the work.
Test each requirement with one question: "What result would make us say no?" If nobody can answer, the requirement cannot fail, so it cannot guide a design.
Constraints
Figure 3. Constraint or preference?
flowchart TD
accTitle: Constraint or preference
accDescr: A stated limit on the design is a constraint if something outside the design imposes it, and a preference if not. A constraint is marked fixed, so options that break it are excluded first, or negotiable, with a named owner who can change it.
L["A stated limit on the design"] --> Q1{"Imposed from outside the design?"}
Q1 -- no --> P["Preference: weigh it with the other criteria"]
Q1 -- yes --> Q2{"Can its owner change it?"}
Q2 -- no --> F["Fixed: exclude options that break it first"]
Q2 -- yes --> N["Negotiable: name the owner and the cost of changing it"]
How to read this: only limits that come from outside the design are constraints, and a constraint is finished only when it is marked fixed or negotiable with a named owner.
A requirement says what the system must achieve. A constraint limits how you may achieve it. Keep constraints in their own list, because they behave differently in decisions.
"No data outside the region" is fixed by a contract. "Finish by the end of the quarter" may be negotiable with a smaller scope. "We prefer open-source" is a preference until a policy makes it a rule, and disguised preferences are the commonest reason a review stalls.
Configure is the option teams forget, and it is usually the cheapest to test.
Figure 4. Build, buy or configure
flowchart TD
accTitle: Build, buy or configure decision tree
accDescr: Start by checking whether an owned capability meets the requirements, then whether a product meets them within constraints, and only then consider building. A failed trial at any step moves to the next option.
S["Requirements and constraints written"] --> C1{"Does an owned capability meet them?"}
C1 -- yes --> CF["Configure, then measure"]
C1 -- no --> C2{"Does a product meet them within constraints?"}
C2 -- yes --> BY["Buy, trial against the eval set"]
C2 -- no --> C3{"Is the capability a differentiator or a hard constraint?"}
C3 -- yes --> BU["Build, with a cost cap and review gates"]
C3 -- no --> RE["Revisit scope or constraints"]
CF -- "trial fails" --> C2
BY -- "trial fails" --> C3
How to read this: the order is cheapest to test first, and a failed trial moves you down the tree with evidence instead of opinion.
Check yourself: the trial of an owned capability misses the bar on the evaluation set. What does Figure 4 ask next?
Whether a product meets the requirements within the constraints. If it does, buy it and trial it against the same evaluation set.
Buying spreads maintenance across a vendor's customers; building thin layers around model APIs limits lock-in. This page's default: configure first, then buy, and build only what a requirement or constraint forces, with an ADR so the decision can be reversed.
Architecture Decision Records
An ADR captures one significant decision so a person who joins in two years can see why the system looks as it does. Michael Nygard's post "Documenting Architecture Decisions" (Cognitect, 15 November 2011) proposes small records with five parts.
- Why: "One of the hardest things to track during the life of a project is the motivation behind certain decisions." A newcomer can blindly accept or blindly change a decision; changing it without understanding it "could mean damaging the project's overall value".
- How: "Large documents are never kept up to date.", so a record fits on one or two pages, in the repository at
doc/arch/adr-NNN.md, in a lightweight markup such as Markdown.
The adr.github.io site defines an architectural decision as "a justified design choice that addresses a functional or non-functional requirement". An ADR "captures a single AD and its rationale", the collection of ADRs in a project is its decision log, and the site credits Nygard's 2011 post with popularising the idea.
Figure 5. The life of an ADR
stateDiagram-v2
accTitle: ADR status life cycle
accDescr: A record starts as proposed and becomes accepted after review. An accepted record can later be deprecated or superseded by a newer record. Superseded records are kept.
[*] --> Proposed
Proposed --> Accepted: review approves
Accepted --> Deprecated: no longer applies
Accepted --> Superseded: newer ADR replaces it
Deprecated --> [*]
Superseded --> [*]
How to read this: the status values are the four from Nygard's post, and nothing is deleted, a superseded record stays so readers know it was once the decision.
Nygard's rule for reversals is the one teams skip: the old ADR is kept and marked superseded ("It's still relevant to know that it was the decision, but is no longer the decision.").
Check yourself: a year after ADR 12 is accepted, the provider changes its terms and the decision would now change. Edit ADR 12 or write ADR 13?
Write ADR 13 and mark ADR 12 superseded, pointing to its replacement. Editing ADR 12 would erase why it was reasonable at the time, which is what the next team needs.
A worked ADR for a model choice
This illustrative ADR uses placeholder tiers, not real products, because model names and prices are volatile. The measurements are invented; the interval method is in the Worked example.
ADR 12: Use the large model tier for ticket summaries
Status: Accepted (2026-10-21). Supersedes: none.
Context
Support agents need a three-sentence summary of long ticket threads. The
requirements: at least 92% of summaries rated acceptable on the 300-example
release set (rubric v3); p95 latency at most 4 s at the gateway; tickets may
contain customer personal data, so only providers on the approved list may
be used. About 150,000 summaries a month are expected. Two tiers from the
approved provider were evaluated on the release set:
small tier: 272 of 300 acceptable (90.7%), p95 1.8 s, relative cost 1
large tier: 286 of 300 acceptable (95.3%), p95 3.1 s, relative cost 6
With a normal-approximation 95% interval the pass rate of the small tier lies
between about 87.4% and 94.0%, so the data do not prove it is below the bar, but its measured
rate is under it. The large tier's lower bound is about 92.9%.
Decision
We will use the large tier for ticket summaries behind the model gateway,
with the prompt and rubric versions recorded on every request.
Consequences
Positive: the quality requirement is met with margin and latency is within budget.
Negative: the cost per summary is about six times the small tier's.
Neutral: the model gateway lets us switch tiers per request type later.
Review trigger: re-run the release set when the provider releases a new
small tier, or when monthly cost exceeds the approved cap.
The ADR names the requirement, shows the evidence, admits the uncertainty and states a trigger for revisiting.
Design reviews
A design review decides whether a design is ready to build (or launch) and records the decision and its conditions. It is not a status update, a demo or a place to redesign from scratch. The ADR is the input; the decision log is the output.
Attendees: the author (owns the design and the ADR), an architect or senior engineer who chairs, the product owner (owns the requirements), a security or privacy reviewer when data sensitivity or tool access is in scope, an operations or reliability engineer, the person who owns evaluation, and a scribe. Anyone else reads the pre-read and sends comments.
The pre-read (one to two pages plus diagrams, sent two working days before) holds requirements, constraints, options, evidence and open questions. A review that spends its first twenty minutes reading ends undecided.
Figure 6. A design review from request to decision log
sequenceDiagram
accTitle: Design review flow
accDescr: The author sends a pre-read. Reviewers send comments before the meeting. In the meeting the architect checks requirements and failure paths, then records one of three outcomes in the decision log. Conditions create follow-up actions that return to the author.
participant AU as Author
participant RV as Reviewers
participant AR as Architect
participant DL as Decision log
AU->>RV: Pre-read with requirements, options, ADR draft
RV-->>AU: Written comments before the meeting
AU->>AR: Walk through diagrams and failure paths
AR->>AU: Questions on requirements, evidence, rollback
AU-->>AR: Answers and evidence
alt Design approved
AR->>DL: Record approval and ADR status accepted
else Approved with conditions
AR->>DL: Record conditions, owners, dates
DL-->>AU: Actions to close before launch
else Not approved
AR->>DL: Record missing evidence and reasons
DL-->>AU: Revise and resubmit
end
Note over AU,DL: Every outcome is written down. Nothing ends as undecided.
How to read this: the architect is the hinge between the author's evidence and the decision log, and every branch ends with a written entry.
Check yourself: a review ends with "looks fine, let's keep going" and nothing is written. Which of Figure 6's branches did it take?
None. Every branch ends with an entry in the decision log, so this meeting produced no outcome and the design should be treated as not approved.
A good outcome is approved (ADRs accepted), approved with conditions (each with an owner and a date) or not approved (with the specific evidence missing). The meeting also fails if the author leaves unsure what to change.
Case files
- Claims triage copilot: requirements nobody wrote down. In a composite scenario, an insurer's pilot looked good in demos but could not be called a success or a failure. Pattern: requirements definition, written as testable statements with a labelled evaluation set.
- Contract search: build, buy or configure. In a composite scenario, a legal team began building and then discovered the three-year cost. Pattern: build vs buy vs configure, compared on total cost with a simple non-AI baseline.
Decision framework
Figure 7. Choosing the next step for a proposed AI design
flowchart TD
accTitle: Choosing the next step for a proposed AI design
accDescr: A decision tree that runs from a proposed design to a recorded review outcome. Requirements without a number are rewritten first. Options that break a fixed constraint are excluded. An owned capability is trialled first. Costly decisions get an ADR before the build, risky outputs get a tested human approval step, and a review with no recorded outcome counts as not approved.
S["Proposed AI feature or design"] --> A{"Every requirement has a number and a measurement point?"}
A -- no --> A1["Rewrite it before building"]
A1 --> S
A -- yes --> B{"Does an option break a fixed constraint?"}
B -- yes --> B1["Exclude that option first"]
B -- no --> C{"Could an owned capability meet it?"}
B1 --> C
C -- yes --> C1["Trial configure first"]
C -- no --> D{"Costly to reverse or constrains later choices?"}
C1 --> D
D -- yes --> D1["Write the ADR before the build"]
D -- no --> E{"One wrong output high risk and hard to detect?"}
D1 --> E
E -- yes --> E1["Add a human approval step and test it"]
E -- no --> F["Hold the design review"]
E1 --> F
F --> G{"Outcome recorded?"}
G -- yes --> H["Proceed as recorded"]
G -- no --> I["Treat as not approved"]
How to read this: each diamond is one rule from the table below.
Comparison of the main options
Failure scenarios to design for
Worked example
A support-summary feature has the illustrative requirements below (a different feature from the ADR example, so the numbers differ).
Assumptions:
- 400,000 requests per month, a 30-day window and a 6,000 currency-unit monthly budget.
- 200 and 80 as example sample sizes, independent cases, a 95% confidence level and z = 1.96.
- All stage times and the 99.5% availability objective are chosen for illustration.
The SRE book describes an error budget as a rate at which the SLOs can be missed, tracked daily or weekly. Here a "failure" is a request that returns no valid summary within the latency limit (step 1).
Latency budget (step 2). The requirement is p95 end-to-end of 6 s, allocated across the stages with slack kept.
Figure 8. A latency budget on the request path
sequenceDiagram
accTitle: Latency budget on the request path
accDescr: One request passes the gateway, retrieval, policy check, model call, output validation and rendering, with a time budget for each stage summing to 5.6 seconds inside a six-second target. If the model call exceeds its budget the orchestrator returns a fallback.
participant CA as Client app
participant GW as API gateway
participant OR as Orchestrator
participant RT as Retriever
participant PE as Policy engine
participant MG as Model gateway
participant LP as LLM provider
CA->>GW: Request (budget 0.2 s)
GW->>OR: Authenticated call
OR->>RT: Fetch ticket context (budget 0.8 s)
RT-->>OR: Passages
OR->>PE: Check data policy (budget 0.2 s)
PE-->>OR: Allow
OR->>MG: Generate summary
MG->>LP: Model call (budget 3.8 s)
alt Within budget
LP-->>MG: Summary
MG-->>OR: Summary
OR->>OR: Validate output (budget 0.4 s)
OR-->>CA: Summary, render (budget 0.2 s)
else Provider too slow
MG-->>OR: Timeout at 3.8 s
OR-->>CA: Fallback message and retry option
end
Note over CA,LP: Stage budgets sum to 5.6 s, leaving 0.4 s of slack in the 6 s target.
How to read this: each stage carries a time budget, and the slow-provider branch shows the behaviour agreed in advance, a fallback rather than a hang.
Percentiles of separate stages do not add up exactly, so this is a planning budget: measure the end-to-end percentile in a load test. Set the Retrieve stage to 1.2 s in the widget and watch the slack.
Cost (step 3). Allowed tokens per request = 0.015 / price per token. Get the price from the cost estimator for your model and date, and count retries and embedding calls.
Quality bar (step 4). The normal-approximation 95% bounds are p ± 1.96 × √(p(1 − p) / n). For 180 of 200, "at least 90%" is met by the point estimate, but the data cannot rule out a true rate near 86%.
Figure 9. Does a measured pass rate support the bar?
flowchart TD
accTitle: Does a measured pass rate support the bar
accDescr: Compute the pass rate with its 95 percent interval. If the lower bound is at or above the bar, the requirement is demonstrated. If the upper bound is below the bar, it fails. If the interval straddles the bar, it is not demonstrated and the system or the evidence must improve.
M["Pass rate on the evaluation set, with its 95 percent interval"] --> Q{"Lower bound at or above the bar?"}
Q -- yes --> D["Demonstrated"]
Q -- no --> U{"Upper bound below the bar?"}
U -- yes --> F["Fails the bar"]
U -- no --> N["Not demonstrated: the interval straddles the bar"]
N --> X["Improve the system, then re-measure"]
How to read this: only the lower bound can demonstrate a bar, so a result that merely matches it still lands in the "not demonstrated" box.
- The lower bound is always below the observed rate, so you need an observed rate above 90% and a sample large enough for the margin to fit under it. A bigger sample at exactly 90% only narrows the interval.
- The normal approximation is poor near 0% and 100% or at small samples. Use an exact or Wilson interval there.
The widget uses the Wilson interval on the same 180 of 200. Its bounds (about 85.1% to 93.4%) differ slightly from the normal-approximation ones, and the verdict is the same. Raise passes to 190 and the lower bound clears 90%.
Zero failures is not zero risk (step 5). The chance of zero leaks in 80 cases at a true rate p is (1 − p)^80; setting it to 0.05 gives p = 0.0368. A risk requirement needs a test set big enough for its tolerance and controls that do not depend on the test passing.
Requirements as an executable acceptance check
Put the thresholds in code that runs against the evaluation results, so a change that breaks one fails the build. This sketch checks quality (the lower bound from the worked example), p95 latency (nearest-rank) and mean cost, using only the standard library.
import math
REQ = {"quality_lower_bound": 0.85, "latency_p95_s": 5.0, "cost_mean": 0.20}
def percentile(values, q):
ordered = sorted(values)
return ordered[math.ceil(q * len(ordered)) - 1]
def lower_bound(passes, n, z=1.96):
p = passes / n
return p - z * math.sqrt(p * (1 - p) / n)
def check(results):
"""results: list of dicts with ok (bool), latency_s (float), cost (float)."""
n = len(results)
got = {
"quality_lower_bound": lower_bound(sum(r["ok"] for r in results), n),
"latency_p95_s": percentile([r["latency_s"] for r in results], 0.95),
"cost_mean": sum(r["cost"] for r in results) / n,
}
got["pass"] = (got["quality_lower_bound"] >= REQ["quality_lower_bound"]
and got["latency_p95_s"] <= REQ["latency_p95_s"]
and got["cost_mean"] <= REQ["cost_mean"])
return got
With 400 results, latencies evenly spaced from 1.0 to 4.9 s and a cost of 0.12 each:
At 352 the point estimate looks fine and the requirement is still not demonstrated, which is the behaviour a gate should have. Wire the function into CI so a prompt or model change cannot merge without the numbers.
Common mistakes
- Requirements as adjectives. "Fast", "accurate" and "safe" cannot fail a test. Add an indicator, a threshold and a measurement point.
- Setting the target from the prototype's result. The target comes from the user's need; the prototype shows how far away you are.
- Treating "buy" as the end of design work. A product still needs an evaluation on your data, a data-flow review and an exit plan.
- Editing an old ADR instead of superseding it. Write a new one and mark the old one superseded.
- Using the design review as a demo. Check the failure paths, the evidence and the rollback instead.
- Hiding preferences as constraints. "We cannot use that vendor" needs a named owner and a reason, or it is a preference.
Try it
Time: 20 to 40 minutes. Pick one AI feature you work on or have been asked to scope (or use "a chatbot that answers HR policy questions" if you have none).
- Write one testable requirement for each of the five kinds: threshold, measurement point, check.
- List three constraints, each fixed or negotiable, with its owner.
- Sketch build, buy and configure in one table row each, naming one simple non-AI option.
- Write a one-page ADR with a status and a review trigger.
- Draft five questions for a review of your own design.
Done when each requirement names a number and a place where it is measured, the ADR states its status and a review trigger, and a colleague who was not involved can say what result would make you reverse the decision.
Key takeaways
- A requirement is useful only if a test can fail it: indicator, threshold, window and measurement point.
- Risk tolerance is an owner's documented decision, not something the model or the framework supplies.
- Separate constraints from preferences, mark which are fixed, and name who can change them.
- Evaluate configure, then buy, then build, on the same evaluation set and over a three-year cost.
- Write an ADR for costly decisions, supersede rather than edit, and a review ends only with one of three recorded outcomes.
Self-check
1. Why is "p95 latency under 4 seconds" an incomplete requirement on its own?
It does not say where the clock starts and stops or under what conditions it holds. The SRE book says SLOs should specify how they are measured and the conditions under which they are valid.
2. A model scores 180 of 200 on the evaluation set and the requirement is "at least 90%". Is it demonstrated?
Not conclusively. The point estimate is exactly 90%, but the 95% interval is about 85.8% to 94.2%, so the true rate could be below the bar. Report it as not demonstrated and improve the system until the lower bound clears the bar.
3. What is the difference between a requirement and a constraint, and why track them separately?
A requirement states what the system must achieve; a constraint limits how, usually because of something outside the design such as a contract, platform or budget. Fixed constraints remove options before any comparison; requirements score the options that remain.
4. When should you write a new ADR rather than edit an existing one?
When the context has changed enough that the decision would change, such as a tighter requirement or new provider terms. Nygard's post says to keep the old record and mark it superseded, because it is still relevant to know that it was the decision.
5. A design review ends with "looks good, let's proceed". What is missing?
A recorded outcome: approved, approved with conditions (each with an owner and a date) or not approved (with the missing evidence listed), with the ADR status changed to match.
Further reading
Last verified: 2026-10-21
Next
Continue to page 3: Diagramming AI systems, which teaches how to draw the context, component and runtime views that a design review needs.