Design an AI Customer Support Agent
Problem statement
AI customer support agent system design interview guide covering RAG, citations, safe tool execution, order and refund actions, approval gates, confidence routing, human handoff, cost limits, agent evaluation, architecture diagrams, and a live example.
Key Challenges
- ·Answer from trusted help content and show the source beside the claim
- ·Use read tools such as order lookup without exposing private customer data
- ·Block refund and account actions until the right approval is recorded
- ·Hand the conversation to a person when confidence is low or the topic is sensitive
- ·Control model and retrieval cost without hiding a worse customer experience
- ·Evaluate the full journey: answer quality, tool safety, handoff quality, latency, and cost
2-Minute Answer — High-Level TL;DR
Read this before your interview
HLD Interview Focus
I would put a support orchestrator between the chat UI and the AI model. For every message, the orchestrator first applies safety and identity rules. It then retrieves a few trusted help documents and gives those passages to the model. If the customer asks about an order, the agent can call a read-only order tool. If it wants to refund money or change an account, it creates an action proposal and waits for approval. The answer streams to the UI with citations. Low confidence, sensitive topics, repeated failures, and customer requests go to a human with a short summary. I would measure resolution rate, grounded-answer rate, unsafe-action rate, handoff quality, p95 latency, and cost per resolved conversation.
My Approach: Building the Solution
How to think about this problem
I will design the safe path before choosing a model. First I will separate questions from actions. Then I will show how trusted knowledge, tools, approval, and human handoff fit around the model. The model can suggest the next step, but normal code owns identity, permissions, money, and audit logs.
Why This Approach?
A weak answer is 'send the message to an LLM and add a vector database.' That misses the dangerous parts. A support agent reads private data and may change orders or money. A strong answer explains where evidence comes from, which actions are allowed, what needs approval, and when the agent must stop.
Think of the agent as a new support employee. The help center is its handbook. Tools are the company systems it can open. Approval is a manager signing an important action. The audit log is the work record. The employee may recommend a refund, but cannot quietly move money because a sentence sounded confident.
Requirements: What Makes a Great Solution?
Clarify scope before designing anything
Requirements Exploration Questions
Ask your interviewer these questions to refine requirements
What jobs may the agent do?
- ·Answer policy and product questions
- ·Read order, shipment, subscription, and account status
- ·Prepare or execute refunds, cancellations, and account changes
- ·Create a ticket or hand the conversation to a human
Which actions are risky?
- ·Any action that moves money
- ·Cancelling an order or subscription
- ·Changing identity, address, email, or security settings
- ·Health, legal, safety, abuse, or fraud-related requests
What knowledge can the agent trust?
- ·Published help-center pages with version and last-updated time
- ·Private account data returned only after authorization
- ·Region, plan, language, and product-specific policy documents
- ·A clear rule for conflicting, missing, or expired documents
What is a successful conversation?
- ·The customer receives a correct answer or safe action
- ·Important claims have useful citations
- ·The customer does not repeat context after handoff
- ·Latency and cost stay inside agreed limits
Functional Requirements
Must Have — MVP
- ✓Chat UI with streaming answer, Stop, retry, citations, and clear status
- ✓RAG over approved help content with document version and freshness
- ✓Authenticated read-only order lookup
- ✓Refund action proposal with amount, reason, order id, and approval state
- ✓Confidence and policy routing before the final answer
- ✓Human handoff with conversation summary and collected evidence
- ✓Audit trail for retrieval, tool calls, approvals, and final outcome
Advanced (If Time Permits)
- +Multiple languages with language-specific retrieval and evaluation
- +Agent memory limited to useful customer preferences and recent cases
- +Proactive updates when shipment or ticket state changes
- +Supervisor review queue for sampled conversations
- +Model routing by task complexity, latency, and cost budget
Non-Functional Requirements
Performance Targets
- ·Show the customer message immediately after Send
- ·Show a useful status within 300 ms, such as 'Checking the help center'
- ·First answer text under 2 seconds for a warm, simple FAQ path
- ·Order lookup p95 under 1 second after authorization
- ·Do not block the chat UI while a tool or human handoff is pending
Reliability & Consistency
- ·Every write tool uses an idempotency key so a retry cannot repeat a refund
- ·A failed or timed-out tool never becomes a made-up success message
- ·Citations point to the exact document version used for the answer
- ·A reconnect restores the visible trace and any pending approval
- ·After repeated failure, stop retrying and create a human handoff
Accessibility & Input Support
- ·Keyboard-first flows with visible focus and predictable tab order
- ·Screen-reader announcements for async changes using aria-live where appropriate
- ·Reduced-motion alternatives for animated transitions
- ·Pointer, touch, and keyboard parity for every core action
Security & Privacy
- ·Authorize every tool call on the server; never trust customer ids from the browser
- ·Keep payment, identity, and internal system secrets out of model context
- ·Treat retrieved documents and tool output as untrusted input that may contain prompt injection
- ·Redact sensitive values from traces, analytics, and evaluation datasets
- ·Require fresh approval for high-impact actions and record who approved them
Observability
- ·Track Core Web Vitals plus domain-specific interaction latency
- ·Measure API error rate, retry rate, stale-cache usage, and client exceptions
- ·Emit structured events for critical user journeys and abandoned flows
The full solution is part of HelloFrontend Pro
The question above is free to read in full. Upgrade to unlock the interactive workspace and the senior-level walkthrough that go with it.
- Full RADIO-framework walkthrough with architecture diagrams
- Data model, API design, and rendering strategy trade-offs
- Performance, accessibility, and offline sections plus a model answer
Already a member? Log in to open the workspace.