Skip to content

    AI Architect

    AI Architect Mindset: Requirements, ADRs, Design Reviews

    How AI architects write testable requirements, weigh build vs buy vs configure, record choices in decision records and run design reviews that end in decisions.

    By Published 23 min read

    Share

    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.

    Question What happened
    Is it good enough to ship? Nobody agreed what good means
    How slow may it be? The product manager says "instant", the engineer says "a few seconds"
    What may it cost per ticket? Nobody asked
    May it see customer account numbers? Legal was not in the room

    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.

    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).

    Term The book's definition How to tell it apart
    SLI (indicator) "a carefully defined quantitative measure of some aspect of the level of service that is provided" What you measure
    SLO (objective) "a target value or range of values for a service level that is measured by an SLI" The target for that measure
    SLA (agreement) A contract with consequences Ask "what happens if the SLOs aren't met?" With no explicit consequence, it is almost certainly an SLO
    • 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

    Kind Vague version Testable version (illustrative values) How it is checked
    Quality bar "Answers must be accurate" At least 92% of answers on the 300-example release set are rated acceptable by two reviewers using rubric v3; re-measured on every prompt or model change Evaluation harness in CI, reviewer sample monthly
    Latency "It must feel instant" p95 end-to-end at most 4 s and p50 at most 1.5 s, for requests under 3,000 input tokens, measured at the API gateway over a rolling 7 days Load test before release, then production monitor
    Cost "Keep it affordable" Mean cost per request at most the budgeted amount, counted from the cost log including retries and embedding calls, plus a hard monthly cap Cost log per request, alert at 80% of the cap
    Risk "It must be safe" Zero accepted outputs that reveal another customer's data in the 80-case adversarial set; any hit blocks release; residual risk accepted by a named owner Red-team set in CI, incident review
    Data sensitivity "Handle personal data carefully" Prompts and outputs that contain restricted fields go only to providers on the approved list, never to general application logs, and are kept no longer than the stated retention period Config review, log scan, provider list audit
    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.

    What NIST says What it means for a requirement
    Risk is "the composite measure of an event's probability of occurring and the magnitude or degree of the consequences of the corresponding event" Rate a risk on probability and consequence
    The framework "does not prescribe risk tolerance"; tolerance is "highly contextual and application and use-case specific" Someone with authority must name it
    "Organizational risk tolerances are determined and documented" (MAP 1.5) Write it down where the review can check it
    "attempting to eliminate negative risk entirely can be counterproductive" State the acceptable level, not zero
    An example requirement: "the system shall respect the privacy of its users" (MAP 1.6) A form to start from, not to stop at. Make it testable like the data sensitivity row

    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.

    TIP

    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.

    Constraint Typical example What it rules out or forces
    Legal and contractual Customer data may not leave a named region Providers and regions; may force self-hosting
    Platform Must run on the company's existing cloud account and identity system Vendor products that need their own identity or network path
    Budget A fixed amount per month Larger models, long contexts, multi-step agents
    Time A launch date tied to a business event Build options with long lead times
    Skills Two engineers, none with search experience Self-built retrieval stacks
    Integration Must write to a ticket system that has no batch API Asynchronous designs that depend on bulk loads

    "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.

    Constraint or preference? (interactive when JavaScript is on)

    The requirements sheet says 'we prefer open-source', with no policy behind it. How should the review treat it?

    • As a fixed constraint that removes closed products
    • As a preference to weigh against the other criteria
    • As a requirement to test
    Answer

    As a preference to weigh against the other criteria. It is a preference until a policy makes it a rule.

    A contract says customer data may not leave a named region, and one provider's only region is outside it. What happens to that provider?

    • It is weighed against price and quality
    • It is excluded before anything is compared
    • It is kept, with an exception requested later
    Answer

    It is excluded before anything is compared. A fixed constraint removes options that break it before any comparison.

    Build vs buy vs configure

    Answer What it means Example
    Build Write the capability yourself on lower-level components A model API, a vector database, your own orchestration
    Buy Adopt a product or managed service whose behaviour the vendor controls A managed service
    Configure Use a capability you already own and adjust it without new software The search in your current document system

    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.

    Criterion The question
    Fit Does it pass the same evaluation set? A vendor demo is not a test
    Total cost Licences, engineering time, running costs, evaluation and maintainers over three years, not three months. The contract search case shows the arithmetic
    Control and portability How hard is it to leave? What if the vendor changes a model or price?
    Time to first value Configure is usually quickest and build slowest. A time-bound requirement can decide it
    Data handling What leaves your boundary, and who is accountable?
    Maintenance Who tests after a model update, and who answers the pager?

    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.

    Section What it holds Style note from the post
    Title A short noun phrase Numbered sequentially; numbers are never reused
    Context The forces at play: technological, political, social and project-local, often in tension Value-neutral language that states facts
    Decision The response to those forces Full sentences, active voice, starting "We will"
    Status proposed, accepted, deprecated or superseded A superseded record points to its replacement
    Consequences The resulting context after the decision is applied All of them: positive, negative and neutral
    • 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.").

    When What to do
    A decision is expensive to reverse, constrains later choices, or someone will ask "why did you do it this way?" Write an ADR: model and provider, build vs buy vs configure, retrieval strategy, where humans approve, what is logged, which data may reach which model. A one-line pull request comment covers the rest
    The context changed so the decision would change (a new model tier, new provider terms, a tighter requirement) Write a new ADR and supersede the old one. Editing erases the history
    Any ADR Set a review trigger ("revisit when the smaller tier reaches the bar on the release set") so supersession is planned
    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.

    Minutes Agenda (60 minutes, illustrative)
    5 Context and the decision requested
    10 Requirements and constraints: check each is testable
    20 Walk the diagrams: context, runtime sequence, failure paths
    15 Risks and the draft ADRs
    10 Decide, assign actions, set dates

    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.

    Area Question an architect asks
    Requirements What requirement does this component satisfy, and how will we know it does?
    Harm What is the worst plausible output, and who is harmed if it reaches a user?
    Provider failure What happens when the provider is slow, down or returns something malformed?
    Cost What is the cost per request at expected volume, and at ten times that?
    Data Which data goes to which component, and where is it logged?
    Autonomy What can the system do without a human approving it, and what is the maximum damage of one wrong action?
    Quality drift How do we detect that quality dropped after a model or prompt change?
    Rollback What is the rollback, and how long does it take?
    Simplest option What is the simplest non-AI option, and why is it not enough?
    Reversibility Which decision is hardest to reverse, and is it written down?

    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.

    If Then Because Revisit when
    A requirement has no number and no measurement point Do not build against it The team cannot tell whether it succeeded The owner can state what result would make them say no
    A constraint is fixed Exclude options that break it before comparing A better option that violates a contract is not an option The owner changes it in writing
    An owned capability could meet the requirement Trial it first Cheapest to test; data stays inside the boundary The trial misses the bar on the evaluation set
    A decision is costly to reverse or constrains later choices Write an ADR before the build The reasons are easiest to recall now The record's review trigger fires
    A review ends without a recorded outcome Treat the design as not approved Unrecorded approvals are remembered differently by each attendee The next scheduled review
    One wrong output is high risk and hard to detect Add a human approval step and test it as a requirement Tolerance is the owner's decision and a filter is not proof Evidence shows error rate and impact are both lower than assumed

    Comparison of the main options

    Option Strengths Weaknesses Choose when Typical failure
    Configure an owned capability Fastest to test; data stays put Capped by what the tool can do The tool is close to the requirement Quality ceiling found late
    Buy a product or managed service Faster than building; vendor shares maintenance Less control; vendor changes can break behaviour The need is common, not a differentiator A demo passes, your data fails
    Build on model and data components Full control of behaviour and data path Highest effort; you own evaluation A differentiator, or a constraint no product meets Cost overrun from unplanned maintenance
    Hybrid (buy a base, build the edges) Fits unusual workflows Integration seams to maintain A product covers 80% and the rest is stable Seams become the fragile part
    Do nothing yet Zero cost; keeps options open The problem persists Requirements or evidence are missing Drift into an unreviewed pilot

    Failure scenarios to design for

    Failure What the system does Why
    A requirement exists only in conversation It is not accepted for release; the review checks the written sheet Only a written requirement can be tested
    The evaluation set is too small for the claim The report states the pass rate with its interval; an interval that straddles the bar is "not demonstrated", not a pass The data cannot rule out a rate below the bar
    The model or prompt changes after approval Any change re-runs the release set; a drop below the bar blocks promotion and reverts The approval covered the old version
    A constraint changes mid-project (a data-residency rule, say) Affected ADRs move to review and a superseding ADR is drafted before the build continues The decisions were made under the old context
    The review is skipped under deadline pressure No launch without a recorded outcome; a shorter review with the same questions is the minimum An unrecorded approval is remembered differently by each attendee
    The decision log goes stale Each ADR has an owner and a review trigger; a quarterly pass marks records valid, deprecated or superseded A stale log misleads

    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.
    Step Calculation Result
    1. Error budget (1 − 0.995) × 400,000 2,000 failed requests in the window
    2. Latency budget 0.2 + 0.8 + 0.2 + 3.8 + 0.4 + 0.2 5.6 s, so 6.0 − 5.6 = 0.4 s of slack
    3. Cost per request 6,000 / 400,000 0.015 per request
    4. Interval for 180 of 200 0.90 ± 1.96 × √(0.9 × 0.1 / 200) = 0.90 ± 1.96 × 0.0212 About 85.8% to 94.2%
    5. Zero leaks in 80 cases 1 − 0.05^(1/80) 0.0368, so a true rate up to about 3.7%

    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.

    Latency budget for the support summary: 6 s target (interactive when JavaScript is on)
    Gateway0.2 s
    Retrieve0.8 s
    Policy check0.2 s
    Model call3.8 s
    Validate output0.4 s
    Render0.2 s
    Total5.6 s of 6 s
    Slack0.4 s

    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%.

    Does 180 of 200 demonstrate a 90 percent bar? (Wilson interval, two-sided 95 percent) (interactive when JavaScript is on)
    Observed pass rate90.0%
    Interval (z = 1.96)85.1% to 93.4%
    Gate: lower bound at least 90.0%fail

    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]  # nearest rank
    
    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:

    Passes of 400 Point estimate Lower bound p95 Result
    353 88.3% about 0.851 4.7 s Pass
    352 88.0% about 0.848 4.7 s Fail

    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).

    1. Write one testable requirement for each of the five kinds: threshold, measurement point, check.
    2. List three constraints, each fixed or negotiable, with its owner.
    3. Sketch build, buy and configure in one table row each, naming one simple non-AI option.
    4. Write a one-page ADR with a status and a review trigger.
    5. 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.

    Enroll to keep reading

    Lesson 2 of 8 · AI Architect (Intermediate): Design the System

    How AI architects write testable requirements, weigh build vs buy vs configure, record choices in decision records and run design reviews that end in decisions.

    In the rest of this lesson

    • Case files
    • Decision framework
    • Comparison of the main options
    • Failure scenarios to design for
    • Worked example
    • Requirements as an executable acceptance check

    Enrolling is free. It unlocks every lesson in AI Architect (Intermediate): Design the System, tracks your progress across devices and keeps your quiz scores. The newsletter is optional.

    Ask about this article

    Get answers grounded in this post. AI-generated — based on this article, and may be imperfect.

    Scaled AI Weekly

    Enjoyed this? Get more like it every Monday.

    Real architecture decisions, LLMOps patterns that survive production, and engineering leadership advice — from 12+ years of building at enterprise scale. Free. No spam. Unsubscribe anytime.

    Get new articles by email

    Free. We email a confirmation link first, and you can unsubscribe from any email.

    Join engineers building production AI systems

    Comments