ML System Design

Design: Customer Support Copilot

Building an AI assistant that handles customer support tickets by retrieving knowledge base articles and generating responses.

🔴 advanced6 min readsystem-designllm
Designing a Customer Support Copilot uses LLMs and retrieval to assist or automate customer support interactions. The system retrieves relevant help articles and past ticket resolutions, generates draft responses for human agents or auto-replies for simple cases, and escalates complex issues to human specialists.

The Problem

Design an AI copilot that helps customer support agents respond to tickets faster and more accurately. The company receives 10,000 support tickets per day across email, chat, and phone. About 60% are routine questions answerable from the knowledge base. The remaining 40% require investigation, policy exceptions, or empathy for frustrated customers.

High-Level Architecture

  Customer Ticket Arrives
              │
              ▼
  ┌───────────────────────────────┐
  │ STEP 1: TICKET CLASSIFICATION │  (~50ms)
  │ Category, priority, sentiment │
  │ Route to correct queue        │
  └───────────────────────────────┘
              │
     ┌────────┴────────┐
     ▼                 ▼
  ROUTINE           COMPLEX
  (Auto-reply       (Agent-assisted)
   candidate)              │
     │                     ▼
     ▼            ┌───────────────────┐
  ┌──────────┐    │ STEP 3: COPILOT   │
  │ STEP 2:  │    │ DRAFT GENERATION  │
  │ AUTO-    │    │ Retrieve docs +   │
  │ REPLY    │    │ past tickets,     │
  │ Generate │    │ generate draft    │
  │ + Verify │    │ for agent to edit │
  └──────────┘    └───────────────────┘

Step 1: Ticket Classification

When a ticket arrives, classify it immediately:

A fine-tuned text classifier or a prompted LLM handles this classification.

Step 2: Auto-Reply for Routine Questions

For routine questions (password reset, order tracking, return policy):

  1. Retrieve the most relevant help article or FAQ using hybrid search (BM25 + vector search) against the knowledge base.
  2. Generate a personalized response using an LLM with the retrieved article as context and the customer's specific details (order number, account status).
  3. Verify the response: check that it does not contain hallucinated information, confirm that order numbers and dates mentioned match the customer's actual data from the CRM.
  4. Send if confidence is high, or queue for quick agent review if confidence is medium.

Step 3: Agent Copilot for Complex Issues

For complex tickets that require human judgment:

  1. Surface Context: Pull up the customer's history (past tickets, purchases, account status, loyalty tier).
  2. Retrieve Similar Resolved Tickets: Find past tickets with similar issues and show how they were resolved, giving the agent a starting point.
  3. Draft Response: Generate a suggested response that the agent can edit, accept, or discard. The draft includes relevant policy references.
  4. Suggest Actions: Recommend actions like "issue refund for $X" or "escalate to billing team" based on the issue pattern.

The agent always has final control. The copilot saves time by eliminating research and drafting work.

Key Design Challenges

  1. Hallucination Risk: The copilot must never tell a customer something false about their order, policy, or account. Ground all responses in retrieved documents and verify facts against CRM data.
  2. Tone Matching: Responses should match the company's brand voice. Fine-tune or prompt the LLM with style guidelines.
  3. Escalation Logic: Build clear escalation paths. If the customer mentions legal action, a safety concern, or asks for a manager, route immediately to a senior human agent.
  4. Feedback Loop: Track which copilot drafts agents accept, edit, or reject. Use acceptance rate as a training signal to improve the model.

Say this out loud

A customer support copilot classifies incoming tickets by category, priority, and complexity. Routine questions get auto-replied using RAG retrieval from the knowledge base. Complex issues get a copilot-generated draft response for human agents to review and edit. All responses are grounded in actual company documents and verified against CRM data to prevent hallucination.

Followups to expect

  1. How do you measure copilot effectiveness? Track agent handle time reduction, first-contact resolution rate improvement, CSAT scores, and the percentage of copilot drafts accepted without edits.
  2. How do you handle multi-language support? Use multilingual embedding models for retrieval and multilingual LLMs for generation. Detect the customer's language from the ticket and respond in the same language.

Check yourself

Question 1 of 3

Why is a customer support copilot designed to assist human agents rather than fully replace them?

More in ML System Design

See all →
A Framework for Any ML Design Round5 minFraming a Business Problem as ML5 minOnline vs Offline Evaluation5 min