# Designing an AI Customer Support Agent: Grounded Answers, Safe Actions, and Honest Resolution

## Blog Details

- **Author**: Naveen R.
- **Date**: November 13, 2026
- **Tags**: AI agents, customer support, system design, LLM applications, multi-tenant architecture
- **Read Time**: 20 mins

When I design an AI customer support agent, the hard part is not getting a language model to write a friendly reply. That is nearly free now. The hard part is that support is where a company keeps its promises: "your refund is on its way", "your subscription is cancelled". An agent that answers fluently but wrongly is worse than a slow human, because the customer believes it. A refund it should not have issued costs real money. And an agent that keeps a frustrated customer talking in circles, while a dashboard counts the conversation as "deflected", quietly damages the business it was bought to help.

So I treat this as three problems sharing one conversation: **resolve** (answer correctly from the company's knowledge), **act** (change its systems safely, exactly once) and **hand off** (know when a human should take over, and give them everything). Around all three sits a fourth that is easy to get wrong: **measuring** whether the customer was actually helped.

Here is how I would build a multi-tenant platform that businesses plug into their chat widget and support inbox: scoping, requirements with capacity estimates, a high-level architecture, and four deep-dives:

- Knowledge-grounded resolution from help centre articles, policies and past tickets
- Taking actions safely with typed tools, deterministic policy checks and confirmation
- Human handoff: detecting when, and passing full context
- Measuring resolution and quality without gaming the metric

## Scoping the Problem and Clarifying Assumptions

I am building a **platform** that many businesses (tenants) use. Each tenant connects its help centre, its policies, its ticket history, its order or account APIs and its existing helpdesk. The platform runs an AI agent on the tenant's chat and email channels, under that tenant's rules and brand voice.

**What I'm including:**
- Chat (web and in-app widget) and email, with one conversation able to move between them
- Answers grounded in the tenant's help centre, policies and resolved past tickets
- Account actions through tenant APIs (refund, change address, cancel or pause a subscription), behind identity verification
- Escalation to human agents in the tenant's helpdesk, with a structured handoff
- Per-tenant measurement of honest resolution, quality and cost

**What I'm NOT building here:**
- Ingestion, chunking, embedding and permission-aware retrieval: I reuse the layer from [Designing an Enterprise RAG Assistant](/blog/system-design-enterprise-rag-assistant)
- Prompt-injection defences and output checks: see [Designing LLM Guardrails](/blog/system-design-llm-guardrails)
- A generic agent runtime and tool sandbox: see [Designing an AI Agent Platform](/blog/system-design-ai-agent-platform)
- Voice: a phone channel plugs into the same conversation service, and its media pipeline is in [Designing a Real-Time Voice AI Agent](/blog/system-design-realtime-voice-ai-agent)
- The helpdesk itself: tenants already have one, and I integrate with it

**Key assumptions:**
- Tenants range from small shops to large subscription businesses, so configuration must be data, not code per tenant
- Tenants expose order and account APIs over HTTPS. Many were built for staff tools, not automated callers, and some are not idempotent.
- Hosted LLMs sit behind an LLM gateway, so the model is a swappable component
- Human agents remain the safety net. The goal is to resolve what can be resolved well and hand off the rest quickly, not 100% automation.

**How this differs from a classic helpdesk:** a traditional helpdesk is a ticket queue where people make every decision and the software stores and routes. Here the software decides what the policy says, whether a refund is allowed and whether to escalate. That moves risk into my code and data, and it makes the old metric, "tickets closed", dangerous, because a bot can close tickets without helping anyone.

## Functional and Non-Functional Requirements

### Functional Requirements

1. **Converse across channels**: one conversation state per customer issue, continued if the customer switches channel.
2. **Answer from tenant knowledge**: grounded in that tenant's help centre, policies and past resolutions, with checkable citations.
3. **Verify identity**: before account-specific reads or writes, at a strength that depends on the action.
4. **Take actions**: refund, change address, cancel, only when policy allows, with customer confirmation and exactly-once execution.
5. **Hand off**: escalate on defined triggers with a summary, steps already tried and relevant customer data.
6. **Measure**: honest resolution, CSAT, audited quality, knowledge gaps and cost per resolution, per tenant.
7. **Configure per tenant**: tone, actions, policy limits, escalation rules and SLA routing, without a deploy.

### Non-Functional Requirements

| Requirement | Target | Why |
|-------------|--------|-----|
| Chat reply latency | p50 under 3 s, p95 under 8 s to first text | A widget should feel near-live |
| Email reply latency | minutes | Allows a slower, more careful path |
| Action correctness | zero duplicate or out-of-policy actions | A double refund is real loss |
| Tenant isolation | no data or knowledge crosses tenants | Customers and policies are confidential |
| Availability | 99.9% for chat, fallback to "a human will reply" | The widget is the front door |
| Auditability | every answer and action traceable to evidence and rule | Disputes and chargebacks |
| Cost | tracked per resolution, per tenant | Tenants buy outcomes |

The most important row is action correctness. I would rather the agent hand off than take an action it cannot justify.

### Back-of-the-Envelope Capacity Estimation

These are planning assumptions, not measurements. The point is the method.

**Conversations and turns:**
- I assume 2,000 tenants producing **20 million conversations per month**: about **670,000 per day**, or **7.7 per second** on average
- Support is spiky (sales, outages), so I plan for **4x peak**, about **31 new conversations per second**
- At 6 customer messages per conversation: **4 million turns per day**, about **46 per second** on average and **185 at peak**

**LLM tokens:**
- About 1.5 model calls per turn (a planning call plus the reply), each with about 6,000 input tokens (instructions, policy excerpts, evidence, history) and 300 output tokens
- Input: 4M × 1.5 × 6,000 = **36 billion input tokens per day**
- Output: 4M × 1.5 × 300 = **1.8 billion output tokens per day**

The input side dominates, and most of it is a stable prefix per tenant (instructions and policy excerpts). That makes prompt caching at the LLM gateway one of my biggest cost levers.

**Actions and handoffs:**
- I assume 15% of conversations attempt an action: about **100,000 actions per day**, roughly 1 to 5 per second. Tiny in throughput, enormous in risk.
- I assume 30% end in a handoff at launch: about **200,000 handoffs per day**

**Storage:** at about 10 KB of transcript per conversation, 20M × 10 KB = **200 GB per month**. Full traces (prompts, evidence, tool calls) at about 10x that are **about 2 TB per month**, hot for 30 days, then in cheaper storage for each tenant's audit retention period.

**Illustrative cost per conversation:** if I assume a blended price of 1 dollar per million input tokens after caching and 5 dollars per million output tokens, one turn costs about 9,000 × 1/1M + 450 × 5/1M ≈ 1.1 cents, and a 6-turn conversation about 7 cents in model cost. That figure is only useful once I divide by conversations that were *actually* resolved, which the fourth deep-dive is about.

## High-Level Architecture and Core Components

![The request path for the AI support agent: chat and email reach channel adapters, which pass normalised turns to a conversation service backed by a store of conversations and identity state; the conversation service asks the agent orchestrator for the next turn, which retrieves from the tenant knowledge index and reasons with the LLM pool; proposed actions go through an action service to the tenant's order APIs, handoff packets go to the helpdesk queue, and all conversation events flow to an event stream.](https://d5osvdbc8um23.cloudfront.net/static-asset/blog_images/system-design-ai-support-agent/01-high-level-architecture.png)

### Component Walkthrough

**Channel adapters.** The chat adapter holds WebSocket or SSE connections to the widget. The email adapter receives mail by webhook, strips quoted history and signatures, and threads replies by message id. Both emit the same internal `Turn`: tenant, channel, customer handle, text, attachments.

**Conversation service.** The source of truth for conversation state. It maps a turn to a customer and an open issue, holds the verification level reached, and serialises turns per conversation so two quick messages do not race.

**Agent orchestrator.** Per turn, it loads tenant config, retrieves evidence and asks the LLM for the next step: answer, clarify, propose an action, or escalate. The LLM proposes; code decides what happens.

**Tenant knowledge index.** Per-tenant hybrid search over help centre articles, policies and mined past resolutions, built on the RAG platform's retrieval.

**Action service.** The only component allowed to change state in tenant systems: identity check, deterministic policy evaluation, confirmation, idempotent execution. The second deep-dive.

**Helpdesk integration.** Writes handoff packets into the tenant's helpdesk queues with an SLA. The third deep-dive.

**Event stream and warehouse.** Every turn, retrieval, action and handoff emits an event that outcome labelling, audits, gap reports and cost reporting read. The fourth deep-dive.

### Conversation State Across Channels

A customer starts in chat, leaves, and replies to the follow-up email two days later. If the agent treats that email as a new stranger, it asks for the order number again and may contradict what it said in chat. I model state like this:

```sql
CREATE TABLE conversation (
  id               uuid PRIMARY KEY,
  tenant_id        uuid NOT NULL,
  customer_id      uuid,                 -- null until we link a known customer
  status           text NOT NULL,        -- open | waiting_customer | handed_off | closed
  verified_level   smallint NOT NULL DEFAULT 0,  -- 0 none, 1 email/session, 2 OTP, 3 strong
  verified_until   timestamptz,
  summary          text,                 -- rolling summary, rebuilt every few turns
  opened_at        timestamptz NOT NULL,
  last_turn_at     timestamptz NOT NULL
);

CREATE TABLE channel_link (
  tenant_id        uuid NOT NULL,
  channel          text NOT NULL,        -- chat | email | voice
  handle           text NOT NULL,        -- widget session id, email address, phone
  conversation_id  uuid NOT NULL REFERENCES conversation(id),
  PRIMARY KEY (tenant_id, channel, handle, conversation_id)
);
```

Three rules sit on top of this:

1. **Linking is not verification.** Matching an email address to an earlier chat continues the *conversation*; it does not prove the sender controls the account, since email headers can be spoofed. Verification is stored separately and expires.
2. **Actions require a minimum level.** "Where is my order" might need level 1 (a logged-in widget session). A refund or address change needs level 2 (a one-time code to the contact on file) or level 3 (a session the tenant vouches for with a signed token). The tenant configures the mapping.
3. **A new issue opens a new conversation**, even on an old email thread, so metrics count issues rather than threads.

### Request Flow

1. The customer types "I was charged twice for order 4417" in the widget.
2. The conversation service finds the open conversation (verified at level 1 by the widget session).
3. The orchestrator retrieves the duplicate-charge policy and similar past resolutions, and calls the LLM.
4. The LLM asks for order data; a read-only lookup confirms two captures.
5. The LLM proposes `refund(order=4417, amount=duplicate_capture)`. Refunds need level 2, so the agent sends a one-time code.
6. The policy engine allows it. The customer sees "I'll refund 39.00 to the card ending 1234. Shall I go ahead?" and confirms.
7. The action service executes with an idempotency key and the agent replies with the reference number.
8. Seven days later, the outcome labeller checks whether the customer came back about the same issue.

### Scaling It Out

![The scaled-out platform: customers of all tenants reach a regional load balancer and an API gateway that authenticates the tenant, checks per-tenant budgets in a rate limiter and enqueues turns into a queue partitioned by tenant; a pool of orchestrator workers reads tenant policies and prompts from a config registry, keeps conversation state in a store sharded by tenant, calls model providers through an LLM gateway, and emits latency, cost and escalation metrics to monitoring.](https://d5osvdbc8um23.cloudfront.net/static-asset/blog_images/system-design-ai-support-agent/02-scalable-architecture.png)

- **Queue turns, partitioned by tenant.** A tenant's outage can multiply its traffic in minutes. Per-tenant partitions and concurrency limits mean one tenant's surge slows only that tenant, and past its ceiling new chats get an honest "a human will follow up" instead of timeouts.
- **Serialise per conversation.** Workers lease a conversation id, so a customer's messages are processed in order.
- **Shard state by tenant.** Large tenants get their own shard, which also simplifies data residency and deletion.
- **Versioned tenant config.** A worker pins the config version at the start of a turn and every event records it, so I can answer "which rules were in force when this refund happened".
- **Email takes the slow lane:** a separate, lower-priority queue with a larger model and a second review pass on drafts.

## Deep-Dive: Knowledge-Grounded Resolution: Help Centre, Policies, and Past Tickets

![The knowledge-grounded answer path: for each orchestrator turn, an intent and query planner searches three separate indexes for help centre articles, policy documents and resolved ticket replies; an evidence selector picks the top evidence for answer drafting and logs a knowledge gap when nothing relevant is found; a citation check verifies the draft before the cited answer is sent to the customer.](https://d5osvdbc8um23.cloudfront.net/static-asset/blog_images/system-design-ai-support-agent/03-knowledge-grounded-resolution.png)

Generic retrieval is in the RAG post. What changes for support is **which sources I trust for what**, and **what happens when knowledge is missing**.

### Three Sources, Three Levels of Trust

| Source | What it is good for | Main risk |
|--------|--------------------|-----------|
| Help centre articles | Customer-facing how-to, published wording | Out of date; written for marketing tone |
| Internal policy documents | Rules: eligibility, windows, exceptions | Contain details customers must not see (fraud thresholds, internal notes) |
| Resolved past tickets | How real, messy issues were actually fixed | Contain one-off exceptions and other customers' personal data |

I keep them as **separate indexes per tenant**, not one blended pile, because the agent should use them differently:

- **Help centre** is quotable. The agent can paraphrase and link it.
- **Policies** are for reasoning, not quoting. Text marked internal at ingestion can inform a decision but is never pasted. The parts that drive *actions* (limits, windows, tiers) are not left in prose at all; they become structured rules (second deep-dive).
- **Past tickets** show patterns, never authority. One goodwill refund did not create a policy. I index short, de-identified "resolution notes" (problem, steps that worked, outcome), never raw transcripts.

### Mining Past Tickets Without Leaking

A nightly job reads tickets solved with a good outcome (not reopened). An LLM extracts a de-identified resolution note, and a filter drops notes about one-off exceptions ("as a one-time courtesy"). Notes that recur across many tickets are boosted; notes that contradict current policy are flagged to the tenant, not indexed. Years of tickets become a few thousand reusable patterns instead of millions of risky transcripts.

### Planning the Query

"It still hasn't come and you said Tuesday" is useless as a search query. The planner rewrites it with the conversation summary and order data into targeted queries ("late delivery after estimated date", "delivery delay compensation"). It also classifies intent, which weights the indexes: "how do I" leans on the help centre, "can I get" on policies, "this is broken" on past resolutions.

### Answer Only From Evidence

The drafting prompt carries the selected evidence with ids, and a citation check confirms each factual claim maps to a cited passage (the general grounding design is in the guardrails post). The support-specific part is the failure path. Instead of inventing a plausible answer, the agent:

1. Asks one clarifying question if the evidence was ambiguous between two cases
2. Otherwise says plainly what it does know and offers a human
3. Escalates directly if the topic is on the tenant's "never guess" list (billing disputes, legal, safety)

### Freshness and Conflicts

Support knowledge goes stale fast. **Policies win over articles, and newer wins over older**: if the help centre says 30 days and the current rule says 14, the agent follows the rule and logs the conflict. Policies carry `effective_from` and `effective_to`, and retrieval filters by the date that matters, often the order date rather than today.

### The Knowledge Gap Log

When the evidence selector finds nothing, the citation check fails, or a human later answers what the bot could not, the platform logs a de-identified **gap event** for the gaps report in the fourth deep-dive. I expect the missing articles it surfaces to be a cheaper lever on resolution than a better model.

**What I would do first vs later:** first, three separate indexes, citation checks and a strict "say you don't know" path. Later, ticket mining and intent-aware weighting, once traffic allows tuning.

## Deep-Dive: Taking Actions Safely: Tools, Policy Checks, and Confirmation

![The safe action path as a single pipeline: the LLM sends a typed request to the action service, an identity check confirms the verification level, a deterministic policy engine evaluates it against tenant policy rules with limits per tier, the customer confirms, an idempotency ledger reserves a key, the tenant refund API executes once, and the result goes to an action audit log.](https://d5osvdbc8um23.cloudfront.net/static-asset/blog_images/system-design-ai-support-agent/04-taking-actions-safely.png)

This is where a support agent stops being a chatbot and starts being a system that can lose money. Generic sandboxed tool calls are in the agent platform post. Here I care about **who decides whether an action is allowed, and how it happens exactly once.**

### Typed Actions, Not Free-Form Calls

The LLM never sees raw tenant APIs. It sees a small per-tenant catalogue of typed actions such as `refund_order(order_id, amount_minor, reason)`, where `reason` is an enum (`duplicate_charge`, `item_not_received`, `damaged`, `changed_mind`). Each action declares a required verification level, a risk class, whether confirmation is required and whether it is reversible. A per-tenant adapter maps it to the real API, so if a refund takes three calls, that complexity lives in the adapter, not the prompt.

### Policy as Data, Evaluated by Code

The single most important decision in this design: **the LLM does not decide whether a refund is allowed.** It proposes. Deterministic code decides, using rules the tenant configures as data.

Why not let the model read the policy and judge? It can be persuaded ("my lawyer says you must refund me"), it can misread numbers, and when a tenant asks "why did the bot refund this?" the answer must be a rule id, not a paragraph of reasoning. Rules look like this:

```yaml
tenant: acme-store
version: 42
rules:
  - id: refund-duplicate-charge
    action: refund_order
    when:
      reason: duplicate_charge
      facts.duplicate_capture_confirmed: true
    allow:
      max_amount: order.duplicate_capture_amount
  - id: refund-not-received
    action: refund_order
    when:
      reason: item_not_received
      facts.days_since_estimated_delivery: { gte: 5 }
      facts.carrier_status: { not_in: [delivered] }
    allow:
      max_amount_by_tier: { standard: 5000, plus: 15000, vip: 50000 }  # minor units
      max_per_customer_per_90d: 2
    else: escalate
  - id: refund-changed-mind
    action: refund_order
    when:
      reason: changed_mind
    deny_message: "returns_flow"   # point to the returns process instead
```

The policy engine works like this:

```python
def evaluate(action, params, facts, rules) -> Decision:
    # facts come from tenant APIs (order, carrier status, customer tier, history),
    # never from the conversation text
    for rule in rules.for_action(action.name):
        if not rule.matches(params, facts):
            continue
        limit = rule.limit_for(facts.customer_tier, facts)
        if params["amount_minor"] > limit:
            return Decision.escalate(rule.id, "over_limit")
        if rule.frequency_exceeded(facts.customer_history):
            return Decision.escalate(rule.id, "frequency")
        return Decision.allow(rule.id, max_amount=limit)
    return Decision.escalate(None, "no_matching_rule")   # default is a human, not yes
```

Three properties matter:

- **Facts come from systems of record, not the chat.** "It was never delivered" is a claim; the carrier status from the tenant's API is a fact.
- **The default is escalate, not allow.**
- **Every decision records the rule id and config version**, which is the audit trail and lets a tenant replay last month's decisions against a proposed rule change.

Tenants write rules in a form editor, or an assistant drafts them from policy documents, but no drafted rule goes live until a person approves it.

### Identity Before Account Actions

The action service checks `verified_level` against the action's requirement first. If it is too low, the agent sends a one-time code to the contact already on file, never to an address the customer just typed. Changing contact details is the classic account-takeover path, so it needs the strongest level or goes to a human.

### Confirmation the Customer Can Understand

Before a confirmed action, the agent shows a summary rendered **from the validated parameters**, not from the LLM's prose: amount, destination, what will and will not happen ("This cancels your plan on 30 November. You keep access until then."). The "yes" is bound to a hash of those exact parameters, so any later change invalidates it. On email, confirmation is a reply to a specific prompt, and it expires.

### Exactly Once Against APIs That Are Not Idempotent

LLM agents retry, workers crash mid-call, customers say "yes" twice. To design out the double refund, the action service uses a ledger:

1. Derive a key from `(tenant, conversation, action, canonical params)`.
2. Insert a `pending` ledger row under a unique constraint, so a second attempt finds the row instead of executing.
3. Call the tenant API, passing the key through if it supports one.
4. Mark the row `succeeded` or `failed` with the external reference.

If the worker dies between steps 3 and 4, the row stays `pending`, and a reconciler asks the tenant's API ("any refund on order 4417 in the last ten minutes?") before ever retrying. If an API offers neither idempotency keys nor a lookup, the action is **"human executes"**: the agent prepares it and a person clicks the button. Slower, but honest about the integration.

### Failure Modes

- **Tenant API down:** the agent says so without promising a time, and queues the action (if allowed) or hands off.
- **Partial success:** the refund worked but the tenant's email failed. The ledger has the reference, and the agent gives it directly.
- **Injected text trying to trigger actions:** the policy engine and verification ignore what the text says.

**What I would do first vs later:** first, a handful of typed actions, rules as data with escalate-by-default, verification levels and the idempotency ledger. Later, rule simulation against historical traffic, drafted rules from policy documents, and deferred execution.

## Deep-Dive: Human Handoff: Detecting When, and Passing Full Context

![The handoff path: each conversation turn feeds an escalation signals component, which also takes sentiment and intent scores from a classifier and the customer value tier from a cache; an escalation decider triggers the handoff packet builder, which sends a summary with attempted steps to an SLA router that places the ticket into priority helpdesk queues by skill and SLA, ending at the human agent console.](https://d5osvdbc8um23.cloudfront.net/static-asset/blog_images/system-design-ai-support-agent/05-human-handoff.png)

A good handoff is the difference between "the bot wasted my time" and "the bot got me to the right person fast": escalate at the right moment, and never make the customer repeat themselves.

### Escalation Triggers

I evaluate triggers on every turn. Some are hard rules, some are scores:

| Trigger | Signal | Type |
|---------|--------|------|
| Explicit request | "talk to a human", in any language | Hard: escalate now |
| Policy engine says escalate | Over limit, no rule, frequency | Hard |
| Never-guess topics | Legal, safety, billing disputes | Hard, per tenant |
| Low confidence | No evidence, or citation check failed twice | Score |
| Negative sentiment | Frustration rising across turns | Score |
| Repeated failure | Same intent 3 times, "that didn't work", no progress in N turns | Score |
| High-value customer | Tenant-defined tier (VIP, enterprise) | Lowers the threshold |

Any hard trigger escalates; otherwise a weighted score is compared with a per-tenant threshold, lowered for high-value customers. I keep weights simple and visible, so a tenant can answer "why did this VIP get bot replies for ten minutes?"

The most important rule: **an explicit request for a human is always honoured.** "Try one more answer first" protects deflection numbers and is exactly the gaming I want to prevent. The agent may offer an answer *while* connecting a human, never instead of it.

Sentiment is a trend, not a keyword: "this ****ing app finally worked, thanks" is not anger. A separate small classifier scores each turn, and the decider looks at the trend. The LLM trying to resolve the issue never judges whether the customer is upset with it.

### The Handoff Packet

When escalation fires, the packet builder writes a structured record into the tenant's helpdesk ticket:

```json
{
  "conversation_id": "c_81f2",
  "tenant_id": "acme-store",
  "reason": "policy_over_limit",
  "priority": "high",
  "customer": {
    "id": "cust_552", "tier": "plus", "verified_level": 2,
    "open_orders": ["4417"], "contacts_last_30d": 3
  },
  "summary": "Order 4417 not received, 8 days past estimated delivery; carrier shows in transit. Customer asked for a full refund of 180.00, above the plus-tier limit of 150.00.",
  "attempted": [
    {"step": "order_lookup", "result": "carrier status in_transit"},
    {"step": "refund_order", "decision": "escalate", "rule": "refund-not-received", "detail": "over_limit"}
  ],
  "customer_sentiment": "frustrated, rising",
  "suggested_next_step": "Approve 180.00 refund or offer a reship",
  "transcript_url": "https://helpdesk.example/t/..."
}
```

Rules for the packet:

- **The summary is generated, but the facts are not.** Order numbers, amounts and decisions come straight from the action ledger and policy decisions, not from the LLM's retelling. A summary that says "refund of 108.00" when the ledger says 180.00 is worse than no summary.
- **Attempted steps are explicit**, so the human does not redo verification or troubleshooting, and the full transcript is one click away.

### SLA Routing

The SLA router uses the tenant's own queues: by skill (billing, technical, returns), language, priority and tier, with an SLA per combination. The customer gets an honest wait estimate from queue depth. Out of hours, the agent says so and collects anything the human will need. Once status is `handed_off`, the bot stays silent unless a human hands it back, and humans can still use it to draft replies or run policy checks. Every human override is an event that feeds rule reviews and the gaps report.

### Failure Modes

- **Helpdesk API down:** handoffs go to a durable, alarmed outbox, and the customer is told a human will reply by email.
- **Escalation storm** during a tenant outage: the agent posts the known-issue notice, still offers the human queue, and the router uses the overflow queue.
- **Ping-pong:** after one hand-back and re-escalation, the conversation is pinned to humans.

**What I would do first vs later:** first, hard triggers (explicit request, policy escalate, never-guess topics), the structured packet with ledger-sourced facts, and mapping to the tenant's existing queues. Later, the scored triggers with per-tenant tuning and estimated wait times.

## Deep-Dive: Measuring Resolution and Quality Without Gaming the Metric

![The measurement pipeline: conversation events and a table of contacts by customer feed a same-issue matcher that detects whether the customer came back, an outcome labeller waits N days and adds CSAT survey scores, and results land in a warehouse of resolution facts; separately, an audit sampler sends a stratified sample of conversations to human QA reviewers whose verdicts also land in the warehouse, which produces a knowledge gaps report and tenant dashboards.](https://d5osvdbc8um23.cloudfront.net/static-asset/blog_images/system-design-ai-support-agent/06-measuring-resolution.png)

This is the deep-dive I would argue hardest for, because the obvious metric is misleading.

### Why Deflection Lies

"Deflection rate" usually means conversations that ended without a human. It rises when the bot resolves issues, and also when:

- The customer gives up, or phones instead where the bot cannot see
- The "talk to a human" path is hard to find
- A confident wrong answer is believed, until the customer returns angry a week later

Each is a failure that looks like success, so deflection is never my headline metric.

### Defining "Resolved" Honestly

A conversation counts as **resolved by the agent** only if all of these hold:

1. It ended without a handoff to a human
2. The customer did not contact the tenant again **about the same issue, on any channel, within N days** (I use 7 by default, configurable per tenant)
3. It was not abandoned mid-flow (the customer did not leave while the bot was waiting on a question it asked)
4. If an action was promised, the ledger shows it succeeded

"Same issue" is the tricky part: I match on customer id and the order or account ids touched, plus an intent classifier on the new contact. Labels finalise only after the window closes, so the rate is always a week behind. I show a provisional number with that caveat rather than a fast wrong one. I always show came-back and abandoned rates beside resolution rate: if resolution and abandonment rise together, nothing improved.

### CSAT, With Its Biases Admitted

A post-conversation survey is useful and biased: very happy and very angry customers answer more. I report CSAT with its response rate and never let it override the came-back signal. Five stars followed by a return visit two days later is not a success.

### Audited Samples: Ground Truth From People

Behavioural signals miss quiet failures, like a wrong answer the customer simply accepted. So human QA reviewers score a share of conversations for correctness, policy compliance, tone and escalation. The sampler is **stratified**: it oversamples actions, near-threshold escalations, new intents and recent prompt or model changes, then reweights to the population. Reviewers see evidence and rule decisions, so they can tell a bad answer from a bad article. Audits also calibrate any LLM-as-judge scoring, which widens coverage but is never the only check.

### The Per-Tenant Knowledge Gaps Report

A weekly job clusters de-identified gap events, failed citation checks and human-resolved handoffs per tenant, ranked by volume and handoff rate. Each cluster shows example questions, the closest article and how humans actually answered. The output is a short to-do list for the tenant: "write these articles", "this article contradicts your refund policy", "this question needs a new action".

### Cost per Resolution

The unit economic I put on the tenant dashboard:

```text
cost per resolution = (LLM cost + retrieval cost + action and verification cost + platform overhead)
                      / conversations resolved by agent (honest definition)
```

Two choices make this honest:

- **The numerator includes failed attempts.** A bot that burns ten turns before escalating is expensive even when its successes are cheap.
- **The denominator uses the honest definition.** Deflection there makes the number look better exactly when quality gets worse.

Beside it I show time-to-handoff, because a fast, clean handoff is a good outcome too.

### Guarding Against Gaming

- **A sudden drop in explicit-request escalations is investigated, not celebrated.**
- **Changes ship behind holdouts**, comparing resolution, came-back, abandonment, audit scores and cost together. A change that raises one and lowers another is a human decision.
- **Per-resolution pricing**, if used, runs on the same labeller and window, so platform and tenant see the same number.

**What I would do first vs later:** first, the honest resolution label with a came-back window, abandonment tracking and a small audited sample. Later, stratified sampling with reweighting, calibrated LLM judges, and the clustered gaps report.

## Conclusion: Bringing It All Together

An AI support agent looks like a chatbot, but its important parts are where it makes promises on a company's behalf: what the policy says, whether this customer gets this refund, whether a human should take over, and whether the customer was really helped. My design keeps the LLM on what it is good at, understanding messy language and drafting from evidence, and moves every decision that costs money or trust into code, data and people.

If I had to summarise the design in four decisions:

1. **Ground answers in three separately trusted sources, and say "I don't know" instead of guessing.** Help centre for wording, policies for rules, mined past resolutions for patterns, with every gap logged.
2. **Let the model propose actions, and let deterministic code decide.** Policy as versioned data, identity verified before account actions, confirmations bound to exact parameters, and an idempotency ledger so nothing happens twice.
3. **Hand off early and completely.** Always honour a request for a human, escalate on clear triggers, and pass a packet whose facts come from the ledger, not from a retelling.
4. **Measure resolution the hard way.** The customer did not come back within N days, CSAT with its biases admitted, audited samples, and a cost per resolution that counts the failures.

Related reading: [Designing an Enterprise RAG Assistant](/blog/system-design-enterprise-rag-assistant), [Designing LLM Guardrails](/blog/system-design-llm-guardrails), [Designing an AI Agent Platform](/blog/system-design-ai-agent-platform), and [Designing a Real-Time Voice AI Agent](/blog/system-design-realtime-voice-ai-agent).
