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
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.
| Area | Figure | Where it came from |
|---|---|---|
| Daily requests | 36,000 | 12,000 colleagues x 3 questions (step 2) |
| Average and peak rate | 1.0 and 10 requests a second | 36,000 over 36,000 s, then a 10x peak (step 2) |
| In flight at peak | 25, or 70 for the three-tool flow | Little's law (step 2) |
| Monthly tokens | 1.35 billion | 45M a day over 30 days (step 2) |
| Illustrative monthly model bill | £864 before overheads | £432 input plus £432 output (step 2) |
| Recovery | Answers 1 h RTO, 24 h index RPO; refunds and incidents 15 min RTO, zero RPO | Step 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
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.
| Phase | What to build | Exit criteria |
|---|---|---|
| 1. Read-only answers, one region | Sign-in, approved manuals, retrieval with access rules, one model, basic limits, traces | Groundedness at least 95% on the golden set, zero isolation failures, pilot stores satisfied |
| 2. Live lookups | Stock and incident services as tools, hybrid answers, escalation to the support desk | Live data correct against the source, 98% of sensitive requests escalated, tool errors handled |
| 3. Safe actions | Ticket creation, approvals for refunds over £150, idempotency, audit trail | No duplicate or unapproved actions in testing, approval records complete, rollback rehearsed |
| 4. Scale and optimise | Cache, routing, queues, streaming, autoscaling, gateway failover | Peak load test passed at 10 requests a second with headroom, cost per resolved question under £0.03 |
| 5. Run and improve | SLOs, on-call runbooks, release pipeline, regular evaluation refresh | Error budgets tracked, incidents become evaluation cases, quarterly review held |
Ten mistakes and what to do instead
| Mistake | Why it fails | Better approach |
|---|---|---|
| Treating the model as the whole product | A model API gives no sign-in, business state, reliable actions or visibility | Design the workflow, data boundaries and failure behaviour around it from day one |
| Sending all data through retrieval | An index suits manuals, not stock counts, ticket states or permissions | Retrieve knowledge from the index and fetch live facts from their owners |
| Trusting the model to enforce permissions | Instructions in a prompt are not an access boundary | Enforce access in services, retrieval and tools before anything is disclosed or done |
| Choosing a model from benchmarks alone | Public scores may not match your tasks, speed or cost | Test on your own tasks and compare cost per successful resolution |
| Caching without invalidation | Cached answers outlive the documents and rules behind them | Define scope, freshness, versions and expiry before reuse is switched on |
| Retrying every failure | Retries can deepen outages, burn quota and repeat actions | Classify errors, bound retries, back off and make actions idempotent |
| Scaling servers but ignoring provider limits | More instances cannot lift a provider's request or token ceilings | Watch each layer and tie scaling to quotas and spending controls |
| Measuring only response time | A fast answer can still be wrong, unsupported or forbidden | Track speed with quality, safety, tool accuracy, cost and outcomes |
| Shipping prompt changes untested | A small wording shift can change tool use, structure or refusals | Keep prompts under version control and rerun the same evaluations before release |
| Automating work that needs judgement | Some actions deserve approval or a specialist | Draw 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.
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
| Situation | How much of the design | Why |
|---|---|---|
| Read-only FAQ for one region | Phase 1 only | No actions means a small attack surface |
| Live stock and incident checks | Phases 1 and 2 | Live data needs authoritative services and failure handling |
| Refunds, price overrides, ticket creation | Phases 1 to 3 with strict approvals | Writes need idempotency, approval and audit |
| All 400 stores at peak | All five phases | Scale, cost and recovery need the full design |
| Quick internal experiment | A prototype with no real data | Learn cheaply, and do not call it production |
Trade-offs
| Dimension | Effect | What to do about it |
|---|---|---|
| Time to launch | Phased delivery is slower to the full vision and faster to first value | Agree the value of each phase and ship it |
| Cost | Each added component adds run cost and on-call load | Add parts when measurements justify them |
| Risk | Fewer capabilities early means fewer ways to fail | Expand scope as evidence builds |
| Team effort | Review gates and checklists take time | Treat 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
- Production AI: a step-by-step guide: the hub for all fourteen steps.
- Reference architecture: the layers behind the full diagram.
- Playbook case studies: worked examples from other systems.
- Agentic failure modes: how agent systems go wrong.
- Interview approach: a way to talk through a design under time pressure.
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.