End-to-end design and launch checklist for production AI

Step 14 of 14. See the whole system at once, follow one request through it, build it in phases, and review it with a checklist before launch.

End-to-end design in 60 seconds

  • One request, ten steps: identity, limits, classification, cache, retrieval, model, tools, streaming, telemetry and escalation.
  • Start small: the smallest safe system first, then add parts when evidence demands them.
  • Five phases: read-only answers for one region, live lookups, safe actions, scale and cost work, then continuous running and improvement.
  • Ten classic mistakes each have a cheaper, safer alternative.
  • A launch checklist in five groups turns the review into assigned owners and clear risks.

The problem it solves

It is easy to understand each part and still miss how they interact. A cache that ignores permissions defeats the access model. A retry policy that ignores quotas deepens an outage. A release process that ignores the index breaks rollback. What a colleague experiences depends on the parts and on the seams between them, so the model alone never decides quality.

This step shows the whole design, follows one request through it, offers a build order, and ends with the review tools: mistakes, a launch checklist and answers to common questions.

The complete architecture

Every earlier step appears here as a box, and the arrows show where trust is checked.

Store Assist serves 12,000 colleagues across 400 stores. It answers procedure questions, searches approved manuals, checks live stock and orders, raises incident tickets and hands sensitive matters to the store support desk. Every capability has an owner, a path and a limit.

Following one request, step by step

A colleague types: "Why won't my handheld scanner sync since this morning's update?"

  • 1. Authenticate. The app presents a company sign-in session. The server checks it and derives the colleague, store and role. Nothing about identity is trusted from the request body.
  • 2. Check limits. The gateway enforces message size, per-colleague and per-store rates, and any budget rule. A rejected request gets a clear, friendly message.
  • 3. Decide the task. The orchestrator sees a troubleshooting question. A small classifier or a light model picks the path: retrieval plus a live device lookup.
  • 4. Check the cache. Store Assist looks for an authorised, fresh answer within the right scope. A miss sends the request onward.
  • 5. Retrieve knowledge. Search runs over the approved scanner sync guide. Access rules apply before any passage reaches the model, and the newest procedure is preferred.
  • 6. Choose a model and generate. The router picks a model for this task and the current policy. The model sees the question and the evidence, not the whole document store.
  • 7. Use tools only when needed. The live device status comes from the device-management service. For a ticket, our code checks the proposed action first and then raises it through the ticketing service.
  • 8. Stream. Useful text reaches the screen as it arrives, with sources shown. An action is reported as done only after the owning service confirms it.
  • 9. Record signals. Latency, token counts, retrieval results, tool outcomes and errors go to telemetry, with sensitive content handled by policy.
  • 10. Escalate when required. If the evidence is thin or a person must decide, the colleague gets a useful handoff to the store support desk instead of a pretence of resolution.

A different request takes a different path. "Reset my till PIN" goes straight to the identity verification workflow. "How many units of SKU 448812 are in the stockroom?" goes to the inventory service, never the vector index. A refund over £150 stops at a store manager's approval. The orchestrator is a thin router over these paths, and the model is one component within them.

Store Assist, worked through

Putting the earlier numbers side by side shows how the pieces fit.

AreaFigureWhere it came from
Daily requests36,00012,000 colleagues x 3 questions (step 2)
Average and peak rate1.0 and 10 requests a second36,000 over 36,000 s, then a 10x peak (step 2)
In flight at peak25, or 70 for the three-tool flowLittle's law (step 2)
Monthly tokens1.35 billion45M a day over 30 days (step 2)
Illustrative monthly model bill£864 before overheads£432 input plus £432 output (step 2)
RecoveryAnswers 1 h RTO, 24 h index RPO; refunds and incidents 15 min RTO, zero RPOStep 11

Check the cost target as a whole. £864 a month over 1.08 million requests is about £0.0008 a request in model charges. The £0.03 target per resolved question leaves room for retries, embeddings, retrieval, infrastructure and telemetry. If spend nears that line, look first at context size and retry rate.

A roadmap: build in phases

Each phase has exit criteria, and the next phase starts only when they are met.

Reading the full architecture can suggest that every box must exist before the first colleague logs in. It does not. Build a minimal, safe version that proves the use case, then add parts as real needs appear.

PhaseWhat to buildExit criteria
1. Read-only answers, one regionSign-in, approved manuals, retrieval with access rules, one model, basic limits, tracesGroundedness at least 95% on the golden set, zero isolation failures, pilot stores satisfied
2. Live lookupsStock and incident services as tools, hybrid answers, escalation to the support deskLive data correct against the source, 98% of sensitive requests escalated, tool errors handled
3. Safe actionsTicket creation, approvals for refunds over £150, idempotency, audit trailNo duplicate or unapproved actions in testing, approval records complete, rollback rehearsed
4. Scale and optimiseCache, routing, queues, streaming, autoscaling, gateway failoverPeak load test passed at 10 requests a second with headroom, cost per resolved question under £0.03
5. Run and improveSLOs, on-call runbooks, release pipeline, regular evaluation refreshError budgets tracked, incidents become evaluation cases, quarterly review held

Ten mistakes and what to do instead

MistakeWhy it failsBetter approach
Treating the model as the whole productA model API gives no sign-in, business state, reliable actions or visibilityDesign the workflow, data boundaries and failure behaviour around it from day one
Sending all data through retrievalAn index suits manuals, not stock counts, ticket states or permissionsRetrieve knowledge from the index and fetch live facts from their owners
Trusting the model to enforce permissionsInstructions in a prompt are not an access boundaryEnforce access in services, retrieval and tools before anything is disclosed or done
Choosing a model from benchmarks alonePublic scores may not match your tasks, speed or costTest on your own tasks and compare cost per successful resolution
Caching without invalidationCached answers outlive the documents and rules behind themDefine scope, freshness, versions and expiry before reuse is switched on
Retrying every failureRetries can deepen outages, burn quota and repeat actionsClassify errors, bound retries, back off and make actions idempotent
Scaling servers but ignoring provider limitsMore instances cannot lift a provider's request or token ceilingsWatch each layer and tie scaling to quotas and spending controls
Measuring only response timeA fast answer can still be wrong, unsupported or forbiddenTrack speed with quality, safety, tool accuracy, cost and outcomes
Shipping prompt changes untestedA small wording shift can change tool use, structure or refusalsKeep prompts under version control and rerun the same evaluations before release
Automating work that needs judgementSome actions deserve approval or a specialistDraw automation limits by risk, with handover triggers and recovery routes

The launch checklist

Use these five lists when reviewing a design or preparing to go live. Ticking every line does not prove readiness. It shows where the gaps are, who owns them and which risks must close before launch.

Requirements and capacity

  • Supported tasks and forbidden actions are written down.
  • Targets exist for quality, latency, availability and cost.
  • Average and peak traffic, concurrency and token use are estimated and load tested.

Security and data

  • Users are authenticated and authorisation is enforced server side.
  • Document-level access rules apply at retrieval time.
  • Tool inputs are validated and each tool has least privilege.
  • Privacy, retention and logging policies are defined.
  • Sensitive operations need the right approval.

AI workflow

  • Models are chosen from evaluations on your own tasks.
  • Answers are grounded in current, relevant evidence.
  • Live operational data comes from authoritative APIs.
  • Prompts, models and retrieval settings are versioned.
  • Escalation and fallback behaviour is defined and tested.

Reliability and scale

  • Timeouts and bounded retries are set everywhere.
  • State-changing operations are safe to repeat.
  • Provider quotas and spend limits are managed.
  • Queues carry suitable background work.
  • Failure recovery, scaling and failover have been exercised.

Operations and release

  • Latency, errors, usage and cost are monitored.
  • Correctness, groundedness and safety are evaluated continuously.
  • Tests and deployment are automated.
  • Rollouts are gradual with a rollback plan.
  • User outcomes are tracked and failures feed improvement.

Questions people ask

What is AI system design?

It is the planning of components, data flows, infrastructure, security and operations needed to deliver an AI feature. The model is one part. The rest is what keeps the feature dependable, useful, safe and affordable.

How is it different from LLM application development?

Application development usually centres on prompts, retrieval and tool calls. System design looks wider: requirements, capacity, architecture, data, security, reliability, release and operations. The two overlap, but design asks how everything works together under real conditions.

What is RAG here?

Retrieval-augmented generation finds relevant passages in a knowledge source and gives them to the model while it answers. It suits internal documents and current policy. Quality still hinges on good search, permission checks, keeping content fresh and ongoing evaluation.

How do you reduce cost?

Measure cost per successful task, not the price of a single call. Then consider routing, tighter context, semantic caching, output limits, batching where it fits and removing needless model calls. Never trade away quality, privacy or reliability for the saving.

How do you grow capacity?

Adding servers is only part of it. Depending on the bottleneck you may need load balancing, autoscaling, queues, faster retrieval, database planning and careful handling of provider quotas. Find the layer that saturates first at peak.

How do you defend against injected instructions?

Assume typed input and retrieved text are hostile. Expose just the tools and data a task needs, check every tool argument, make permission decisions in ordinary code, and ask a person to approve sensitive actions. Keep attacking your own system in tests. A filter helps, but none is a complete boundary.

Which technologies should a beginner use?

Choose tools your team can operate with confidence. A typical first build has a web framework, a hosted model, an ordinary database, simple search, company sign-in and basic monitoring. Add a gateway, queue, vector store or multi-provider failover only when a requirement justifies it.

Do I need microservices?

No. A well structured modular monolith is a strong start. Split out services when parts need different scaling, release cycles, security boundaries or operations. Splitting early adds deployment work and makes failures harder to trace.

How do I know it is production ready?

Test it against written requirements under lifelike load, attack scenarios and broken dependencies, then watch quality, speed, cost, tool behaviour and business outcomes after launch. Readiness is an ongoing duty, not a milestone that is passed once.

A launch review as data: every item needs an owner and evidence (illustrative) (python)
from dataclasses import dataclass

GROUPS = ["requirements", "security", "ai_workflow", "reliability", "operations"]

@dataclass
class Item:
    group: str
    text: str
    owner: str = ""            # a named team, never blank at review time
    evidence: str = ""         # link to a test run, dashboard or document
    accepted_risk: str = ""    # filled only with a named approver and an expiry date

def review(items: list[Item]) -> dict:
    """Return open gaps. An item is closed only if it has evidence or a signed risk."""
    gaps = []
    for it in items:
        if it.group not in GROUPS:
            raise ValueError(f"unknown group: {it.group}")
        if not it.owner:
            gaps.append((it.text, "no owner"))
        elif not (it.evidence or it.accepted_risk):
            gaps.append((it.text, "no evidence"))
    return {"ready": not gaps, "gaps": gaps, "checked": len(items)}

# Usage: the release meeting reads the gaps, it does not ask whether anyone feels ready.

This is only a sketch. The habit it shows is the useful part: every line has an owner and evidence, and an accepted risk has a name and an end date.

Design decisions

  • Start as a modular monolith with clear internal boundaries, and extract a service only for a stated scaling, security or release reason.
  • One system of record per data type, with the index, cache and model treated as derived or temporary.
  • A single path catalogue: every request type has a documented route, its limits, its approval rule and its fallback.
  • Trust boundaries drawn once and checked at each crossing: client to gateway, gateway to application, application to model, application to tool.
  • Failure behaviour by design: for each dependency decide whether to degrade, queue, fail over or refuse.
  • Readiness review as a gate, with named owners for each checklist line and a date for each accepted risk.

Measuring it

  • End-to-end task success on the golden set, split by request type and risk tier.
  • Component attribution: for each failure, whether retrieval, model, tool or routing caused it.
  • Escalation precision and recall, since missed handoffs and needless ones both hurt.
  • Phase exit metrics: the evaluation scores that decide whether the next phase may begin.
  • Cost per resolved question across the whole system, trended with each release.

When to use it, and how much of it

SituationHow much of the designWhy
Read-only FAQ for one regionPhase 1 onlyNo actions means a small attack surface
Live stock and incident checksPhases 1 and 2Live data needs authoritative services and failure handling
Refunds, price overrides, ticket creationPhases 1 to 3 with strict approvalsWrites need idempotency, approval and audit
All 400 stores at peakAll five phasesScale, cost and recovery need the full design
Quick internal experimentA prototype with no real dataLearn cheaply, and do not call it production

Trade-offs

DimensionEffectWhat to do about it
Time to launchPhased delivery is slower to the full vision and faster to first valueAgree the value of each phase and ship it
CostEach added component adds run cost and on-call loadAdd parts when measurements justify them
RiskFewer capabilities early means fewer ways to failExpand scope as evidence builds
Team effortReview gates and checklists take timeTreat them as part of the feature, not an extra

What this means for your role

Common mistakes

Step checklist

  • A one-page architecture exists, and every box maps to a step in this guide.
  • Each request type has a documented path, limit, approval rule and fallback.
  • The ten-step request walkthrough has been traced for each path with real traces.
  • A phased roadmap exists with exit criteria and named owners.
  • The ten classic mistakes have been reviewed against the current design.
  • All five checklist groups have owners and evidence, and accepted risks are signed and dated.
  • Failover, rollback and approval flows have been rehearsed.
  • A plan for continuous evaluation and improvement is funded.

Further reading

A good AI system is not defined by a big model or a crowded diagram. It does its job reliably, keeps its colleagues safe, stays inside its limits and can keep improving without risking the product. Start narrow, measure, and add parts when the evidence asks for them. Return to the start with Production AI: a step-by-step guide.

Search topics

↑↓ to move · Enter to open · Esc to close