Capstone Architecture Project
Design a complete AI solution architecture from requirements to deployment.
Capstone Architecture Project
This project brings together requirement analysis, model selection, RAG, tools, cloud architecture, security, governance, compliance, scalability, performance, high availability, disaster recovery, evaluation, and cost estimation into one complete design.
You will act as the AI Solution Architect for a customer support assistant. The goal is not to list technologies or draw an attractive diagram; it is to create a traceable, evidence-driven design and explain why it is suitable for the business problem.
Project Scenario
A growing online retailer receives questions through its website and mobile application. Customers ask about shipping, returns, warranties, product information, and order status. Support agents manually search policy documents and business systems, causing long wait times and inconsistent answers.
The company wants an AI assistant that answers routine questions, retrieves current approved policies with citations, accesses customer-specific order information only after authentication, and transfers uncertain or exceptional cases to a human agent.
Business Goals
- Reduce customer waiting time for routine support questions.
- Improve the consistency and evidence behind policy answers.
- Allow support agents to focus on exceptions and complex cases.
- Maintain or improve customer satisfaction and resolution quality.
- Protect customer and company information.
- Keep cost per successfully resolved conversation sustainable.
These goals are hypotheses until validated against a baseline and pilot. Your design must state what will be measured and what result would justify continued investment.
Users and Stakeholders
| Stakeholder | Need or Responsibility |
|---|---|
| Customer | Fast, accurate, private, accessible help and clear human escalation |
| Support agent | Useful handoff context, source visibility, correction, and override |
| Support leader | Quality, staffing, adoption, escalations, and business outcomes |
| Knowledge owner | Current policies, versions, approvals, and conflict resolution |
| Product owner | Scope, funding, user experience, rollout, and measured value |
| Engineering/operations | Reliable deployment, monitoring, support, and recovery |
| Security/privacy/legal | Data, access, provider, incident, and compliance controls |
| Finance/procurement | Budget, provider terms, total cost, and exit planning |
Project Scope
In Scope for the Initial Release
- Answer approved shipping, return, warranty, and product-policy questions.
- Show citations that customers and agents can inspect.
- Retrieve authenticated order status through a read-only tool.
- Detect low-evidence, conflicting, sensitive, abusive, or exceptional requests.
- Transfer the conversation and relevant context to a support agent.
- Collect controlled user and agent feedback for evaluation.
Out of Scope for the Initial Release
- Automatically approving refunds or financial exceptions
- Changing delivery addresses, payment details, or account ownership
- Giving legal, medical, or financial advice
- Using unapproved public websites as policy sources
- Training provider models on customer conversations
- Autonomous actions without deterministic authorization and required approval
Step 1: Requirements Analysis
Create a requirements catalog with identifiers so later design choices, tests, and monitors can refer to the same requirement.
| ID | Requirement | Acceptance Example |
|---|---|---|
| FR-01 | Answer from approved knowledge | Every policy claim has a supporting authorized source |
| FR-02 | Retrieve order status | Only the authenticated customer's eligible orders are accessible |
| FR-03 | Escalate safely | Unsupported and exception cases reach a human with useful context |
| NFR-01 | Responsive interaction | P95 first response and complete-response targets are defined and met |
| NFR-02 | Available service | Critical workflows meet their approved availability objective |
| SEC-01 | Protect customer data | Cross-customer access and sensitive-log negative tests pass |
| OPS-01 | Recoverable system | Restore exercise meets approved RTO and RPO |
| COST-01 | Sustainable economics | Cost per accepted resolution remains below the agreed threshold |
Replace illustrative targets with stakeholder-approved values. Record traffic, languages, regions, support hours, accessibility, retention, integration, provider, budget, and growth assumptions.
Step 2: Architecture Options
| Option | Strength | Limitation |
|---|---|---|
| Static FAQ and search | Simple, predictable, inexpensive | Weak conversational synthesis and query flexibility |
| LLM without retrieval | Fast prototype and natural interaction | Cannot reliably use current private policies or provide evidence |
| RAG assistant | Current approved knowledge with citations | Requires ingestion, retrieval evaluation, and permission controls |
| RAG plus scoped order tool | Supports knowledge and customer-specific status | Adds identity, tool security, availability, and audit complexity |
| Autonomous support agent | Potentially performs more complete workflows | Too much initial consequence, testing, and operational risk |
Recommended initial design: a RAG assistant with an authenticated read-only order-status tool and human escalation. Keep financial and account-changing actions outside the first release.
Step 3: High-Level Architecture
Customer web/mobile chat
|
CDN/WAF -> API gateway -> Identity/session -> Conversation service
|
Intent and risk router
| |
Policy RAG Order-status tool
| |
Context builder <- scoped customer data
|
LLM -> Output controls -> Citation validation
|
Customer response or human-support handoff
Approved documents -> Ingestion queue -> Parse/chunk/metadata/ACL -> Search indexes
Identity, secrets, policy, audit, metrics, traces, evaluation, cost, backups, and incident response span all layers.Create a visual diagram for your final submission showing trust boundaries, data stores, network exposure, external providers, human systems, normal flow, degraded paths, and recovery environment.
Step 4: Data Flow Design
Policy Question Flow
Question -> Validate/minimize -> Retrieve authorized policy chunks -> Rerank
-> Build labeled context -> Generate -> Validate claims/citations/safety
-> Respond or abstain/escalate -> Safe telemetry and feedbackOrder Status Flow
Authenticated customer -> Verify session and order relationship
-> Call read-only order API with scoped workload identity
-> Minimize fields -> Format status -> Respond -> Audit accessKnowledge Ingestion Flow
Approved repository -> Change event -> Scan/parse -> Structure-aware chunks
-> Source/version/owner/permission metadata -> Embeddings + keyword index
-> Quality checks -> Publish -> Freshness and deletion monitoringFor every flow, document source, format, purpose, owner, validation, sensitivity, transformation, destination, permissions, retention, deletion, lineage, and failure path.
Step 5: RAG Design
- Use only approved policy and product repositories with named owners.
- Preserve headings, tables, page or section location, stable source ID, version, and effective date.
- Choose chunking through retrieval evaluation rather than a fixed arbitrary size.
- Combine keyword and vector retrieval if representative questions benefit.
- Filter by region, product, language, effective date, and permissions before retrieval.
- Rerank a bounded candidate set and remove duplicates before generation.
- Require citations and a clear no-evidence or conflicting-evidence fallback.
- Treat documents as untrusted data and defend against embedded prompt injection.
- Define freshness and deletion objectives for source-to-index synchronization.
Step 6: Model Selection
| Criterion | Question |
|---|---|
| Task quality | Does it answer faithfully from evidence and produce the required format? |
| Safety | How does it behave on abuse, sensitive content, injection, and uncertainty? |
| Latency | Does first-token and total response time meet the user objective? |
| Context | Can it handle the selected evidence without unnecessary context cost? |
| Cost | What is quality-adjusted cost per accepted or resolved conversation? |
| Privacy | Do processing location, retention, training-use, and contract terms fit? |
| Operations | Can versions be pinned, monitored, rolled back, and replaced? |
| Fallback | Which approved alternative preserves minimum useful behavior? |
Compare at least one simple or smaller candidate with a more capable model on the same versioned evaluation set. Document the decision, rejected alternatives, limitations, and review triggers.
Step 7: Security Architecture
| Threat | Required Controls |
|---|---|
| Cross-customer order access | Strong authentication, per-request authorization, scoped queries, negative tests |
| Prompt injection | Separate trusted instructions, treat retrieval as data, restrict tools, validate actions |
| Sensitive data leakage | Minimization, redaction, output controls, tenant-safe cache, safe logs |
| Stolen credentials | Managed secrets, short-lived workload identity, rotation, alerting |
| Abusive traffic | WAF, rate limits, quotas, bot controls, spend limits |
| Supply-chain compromise | Trusted artifacts, dependency/model scanning, signatures, controlled registry |
| Unauthorized change | Separation of duties, approvals, immutable releases, audit and rollback |
| Provider outage or compromise | Timeouts, circuit breaker, fallback, data policy, incident coordination |
Include a threat model, trust-boundary diagram, role and service permissions, data classification, secrets design, logging rules, security tests, incident kill switches, and residual-risk record.
Step 8: Governance and Compliance
- Assign business, product, system, data, model, security, privacy, and operational owners.
- Register the use case, models, providers, prompts, tools, data sources, and risk tier.
- Identify applicable legal, contractual, accessibility, privacy, records, and industry requirements with specialists.
- Trace each important obligation to a control, test, evidence, owner, and review trigger.
- Define human escalation, complaint, correction, and appeal where appropriate.
- Version architecture, data, model, prompt, policy, evaluation, approval, and notices.
- Time-limit exceptions and document accepted residual risk.
- Define material-change, incident, suspension, and retirement processes.
Step 9: Cloud and Infrastructure Design
| Layer | Required Capability |
|---|---|
| Edge | DNS, CDN, encrypted traffic, WAF, rate limiting |
| Application | Stateless conversation API with independent replicas |
| Async | Durable ingestion and evaluation queues with idempotent workers |
| AI | Managed or self-hosted approved model endpoint with limits and fallback |
| Data | Transactional state, object documents, keyword/vector search, tenant-safe cache |
| Security | Identity, secrets, keys, network boundaries, audit and scanning |
| Operations | Infrastructure as code, CI/CD, metrics, logs, traces, alerts, runbooks |
| Recovery | Protected backups, reproducible environment, restore and provider-fallback plans |
Keep production and non-production accounts, identities, data, budgets, and access separate. Select provider-specific services only after comparing requirements, team skill, total cost, and exit needs.
Step 10: Scalability and Performance
- Estimate average, peak, growth, failure, region, and tenant traffic scenarios.
- Set P50, P95, and P99 end-to-end and first-token latency objectives.
- Scale application APIs, model endpoints, ingestion workers, indexes, and databases independently.
- Queue document ingestion and evaluation outside the interactive path.
- Use bounded context, streaming, connection reuse, batching, and safe caching where measured.
- Apply quotas, concurrency limits, backpressure, load shedding, and maximum model spend.
- Test load, stress, spikes, endurance, cold starts, dependency slowness, and scale-down.
- Optimize the measured bottleneck while preserving answer support and safety.
Step 11: Availability and Disaster Recovery
- Define user-workflow SLOs, error budgets, RTO, RPO, and minimum degraded capacity.
- Run application replicas across appropriate failure domains with readiness checks.
- Use deadlines, bounded retries with jitter, circuit breakers, and dependency bulkheads.
- Provide search-only, cached approved policy, queued response, or human-support degraded modes.
- Protect databases, source documents, models, prompts, configuration, keys, and audit evidence.
- Rebuild derived indexes from versioned governed sources.
- Validate fallback models for schema, quality, safety, privacy, latency, and cost.
- Test bad deployments, model outage, index failure, database restore, credential compromise, and region recovery.
Step 12: Evaluation Plan
| Layer | Metrics and Tests |
|---|---|
| Retrieval | Recall at k, ranking, no-result rate, freshness, permission isolation |
| Generation | Faithfulness, completeness, citation support, abstention, style |
| Tool | Authorization, schema correctness, order accuracy, timeout and error handling |
| Safety/security | Injection resistance, leakage, abuse, unauthorized attempts, sensitive output |
| Service | Availability, first-token and total latency, errors, throughput, queue age |
| Human workflow | Escalation quality, review time, override, agent acceptance |
| Customer | Task completion, repeat contact, satisfaction, complaint and abandonment |
| Business | Resolution rate, handling time, support demand, measured value |
| Economics | Cost per conversation, accepted answer, and resolved case |
Build a versioned evaluation set from real question patterns. Include normal, ambiguous, unanswerable, conflicting, stale, multilingual, adversarial, permission-sensitive, high-value, and accessibility cases. Keep an untouched release test set.
Step 13: Cost Estimate
Monthly cost
= model input/output and embedding usage
+ application/model compute and idle HA capacity
+ database, object, vector, cache, backup, and logs
+ network, gateway, security, monitoring, and support services
+ human knowledge ownership, review, support, incidents, and maintenance
Unit economics = total monthly cost / accepted resolved conversationsCreate low, expected, high, peak, failure, and growth scenarios. Record users, requests, tokens, context, output, cache rate, retries, escalation, document updates, storage, retention, availability, review effort, unit prices, discounts, currency, date, and contingency.
Step 14: Delivery and Rollout Plan
| Phase | Exit Evidence |
|---|---|
| Discovery | Approved problem, baseline, owner, scope, risk, feasibility, and success criteria |
| Prototype | Core RAG and tool pattern works on controlled examples |
| Offline evaluation | Acceptance thresholds pass on representative versioned tests |
| Internal pilot | Support staff validate quality, handoff, operations, and usability |
| Limited customer pilot | Small eligible traffic segment meets guardrails and outcome targets |
| Gradual rollout | Increasing traffic with monitored canary and rollback thresholds |
| General operation | SLOs, support, governance, cost, incident, and review processes active |
| Improve or retire | Evidence-based changes or decommissioning when value or requirements fail |
Step 15: Operations Plan
- Define objectives, dashboards, actionable alerts, on-call ownership, and escalation.
- Create runbooks for model, provider, RAG, database, queue, identity, security, and deployment failures.
- Monitor model, prompt, corpus, permissions, provider, latency, safety, business, and cost changes.
- Review failed and escalated conversations using privacy-aware sampling.
- Reevaluate model, retrieval, and controls before material changes.
- Patch and rotate dependencies, images, credentials, keys, and certificates.
- Test backups, restores, fallback, rollback, incident response, and support handoff.
- Maintain user notices, documentation, inventories, decisions, exceptions, and retirement criteria.
Required Capstone Deliverables
| Deliverable | Minimum Content |
|---|---|
| Executive summary | Problem, users, proposed solution, value, major risks, recommendation |
| Requirements catalog | Functional and non-functional requirements with acceptance criteria |
| Architecture diagrams | Context, components, data flows, trust boundaries, deployment, recovery |
| Decision records | Model, RAG, API/self-hosting, cloud, data, security, and alternatives |
| Data/RAG design | Sources, ownership, ingestion, chunking, metadata, ACLs, freshness, deletion |
| Security and risk | Threat model, identities, controls, human approval, incidents, residual risk |
| Governance/compliance | Owners, inventory, obligations, traceability, approvals, change and retirement |
| Evaluation plan | Datasets, metrics, slices, thresholds, safety, load, failure, human outcomes |
| Operations and DR | SLOs, monitoring, runbooks, backups, RTO/RPO, fallback, recovery tests |
| Cost model | Scenarios, assumptions, unit prices, people, TCO, unit economics, controls |
| Rollout roadmap | Pilot phases, gates, rollback, training, adoption, support, review dates |
| Presentation | A concise design-review narrative with assumptions, evidence, and trade-offs |
Suggested Document Structure
1. Executive Summary
2. Business Context, Users, Baseline, and Goals
3. Scope, Assumptions, Constraints, and Requirements
4. Architecture Options and Decision Records
5. Context, Component, Data Flow, Deployment, and Recovery Diagrams
6. Model, RAG, Tool, and Data Design
7. Security, Privacy, Governance, Compliance, and Human Oversight
8. Scalability, Performance, Availability, and Disaster Recovery
9. Evaluation, Monitoring, Support, and Incident Response
10. Cost Estimate, Unit Economics, Risks, and Sensitivity
11. Delivery Roadmap, Acceptance Gates, and Retirement Plan
12. Open Questions, Limitations, and AppendicesTraceability Matrix
| Requirement | Design Control | Validation | Monitor | Owner |
|---|---|---|---|---|
| FR-01 grounded policy answers | Permission-aware RAG with citations | Groundedness and citation test set | Unsupported-answer rate | Knowledge product owner |
| FR-02 private order status | Scoped order API authorization | Cross-customer negative tests | Denied and unusual access | Order platform owner |
| FR-03 safe escalation | Risk and evidence routing to agent queue | Handoff scenario tests | Escalation and reopen rate | Support operations |
| NFR-01 latency | Bounded retrieval/context, streaming, replicas | Representative load test | P95/P99 latency | Service owner |
| OPS-01 recovery | Protected backups and reproducible environment | Restore and provider-failure exercise | Backup and recovery health | Operations owner |
Architecture Decision Record Example
Decision: Use RAG plus a read-only order tool for the initial release
Status: Proposed for pilot
Context: Policies change frequently; order data is structured and customer-specific
Options: LLM only, fine-tuned model, RAG only, RAG plus tools, autonomous agent
Choice: Permission-aware RAG plus authenticated read-only order lookup
Consequences: Grounded current answers and exact status; added ingestion and integration
Risks: Retrieval failure, injection, data leakage, provider outage
Controls: ACL filters, citations, scoped identity, output validation, escalation
Evidence: Offline tests, authorization negatives, load/failure tests, pilot outcomes
Review trigger: New write action, new region, provider/model change, or target failure
Owner: Customer support AI product ownerPython Configuration Example
This simplified configuration makes important architectural choices visible. A real system would manage validated configuration, secrets, infrastructure, policies, models, and rollout state through secure version-controlled services.
architecture = {
"pattern": "RAG with scoped read-only order tool",
"knowledge": {"retrieval": "hybrid", "citations_required": True},
"model": {"route": "evaluated primary", "fallback": "approved smaller model"},
"security": {"authentication": True, "least_privilege": True},
"human_oversight": {"low_evidence": "escalate", "financial_action": "not_allowed"},
"operations": {"autoscaling": True, "monitoring": True, "tested_recovery": True},
}
print(architecture)Design Review Checklist
- The problem, baseline, users, owner, scope, and measurable outcomes are clear.
- Architecture components trace to requirements and unnecessary complexity is removed.
- Data sources, permissions, quality, lineage, retention, and deletion are documented.
- Model and retrieval decisions use comparative evaluation and record limitations.
- Trust boundaries, threats, identities, tool permissions, and human approval are explicit.
- Compliance obligations trace to controls, tests, evidence, monitors, and owners.
- Normal, degraded, failure, rollback, recovery, escalation, and retirement paths exist.
- Evaluation covers quality, safety, important slices, service, users, business, and cost.
- Cost includes providers, infrastructure, people, reliability, support, growth, and contingency.
- The rollout has acceptance gates, kill switches, communication, training, and rollback thresholds.
- Assumptions, rejected alternatives, residual risks, open questions, and review triggers are honest.
Assessment Rubric
| Area | Weight | Excellent Submission |
|---|---|---|
| Problem and requirements | 15% | Clear baseline, outcomes, scope, users, constraints, and acceptance criteria |
| Architecture and decisions | 20% | Coherent design with justified alternatives, interfaces, flows, and simplicity |
| Data, RAG, and model | 15% | Governed sources, evaluated retrieval/model choices, citations, freshness, limitations |
| Security, governance, compliance | 15% | Threats, controls, ownership, oversight, traceability, and lifecycle evidence |
| Reliability and operations | 15% | Objectives, scaling, monitoring, support, failure, backup, recovery, and tests |
| Evaluation and value | 10% | Representative tests and model, service, user, business, risk, and cost metrics |
| Cost and roadmap | 5% | Transparent scenarios, assumptions, TCO, unit economics, phases, and gates |
| Communication | 5% | Readable diagrams, concise narrative, decision records, honesty, and traceability |
Common Capstone Mistakes
- Starting with cloud or model products before defining the problem and requirements
- Presenting a component list instead of interfaces, flows, failure paths, and ownership
- Using RAG without source governance, permission filtering, citations, or retrieval evaluation
- Adding an agent where a deterministic workflow is safer and simpler
- Claiming accuracy, scale, availability, compliance, or savings without evidence
- Treating authentication as the complete security architecture
- Omitting human workload, exceptions, support, incidents, recovery, and retirement
- Estimating only model-token cost and ignoring the lifecycle and people
- Designing every possible future feature instead of a controlled initial release
- Hiding assumptions and trade-offs rather than explaining them clearly
Portfolio Presentation
Present the capstone as a design review rather than a technology tour. Begin with the problem and stakes, explain the chosen architecture and its major decisions, walk through one normal and one failure scenario, show how outcomes will be evaluated, and finish with risks, cost, rollout, and open questions.
- Keep the main presentation concise and move detail into appendices.
- Use diagrams with readable labels and explicit trust boundaries.
- Explain why rejected alternatives did not fit the current requirements.
- Separate proposed targets from measured prototype or pilot results.
- State limitations and residual risks directly.
- Be ready to adapt the design when an interviewer changes a requirement.