Customer Support Automation
Design support that answers, requests approval and hands off with evidence, while keeping account actions controlled.
- Kind
- Case study
- Level
- Foundation
- View
- Interview prep
- Sections
- 4
- By
- Sourav Banerjee
- Last updated
- 20 Nov 2026
Practise this as a worksheet: Customer Support AutomationRead the classic design: Customer Support Assistant: Knowledge, Actions, and Approval
Interview view. The case brief, design walkthrough, technical deep dives and quick review, condensed into bullets, tables and lines to say out loud, with interactive diagrams to step through.
Want to go deep? The full casebook has the complete reasoning in prose, the original diagrams, practice questions with worked answers and the sources.
Case brief
The case in one line: support automation that answers, asks for approval or hands off with evidence, and never moves money on model confidence alone.
30-Second Cheat Sheet
- The scenario: "I was charged twice for last month's subscription and need this fixed today."
- The goal: cut handling time and cost without raising incorrect or harmful resolutions.
- The design: a routed decision pipeline with a deterministic policy gateway as its central control.
- The rule: the model can propose a refund. The gateway decides whether the refund tool may execute.
- Every write is idempotent: repeating a request can't create a second effect.
- First release: a human sends every final response, and money-moving actions follow explicit approval rules.
- The dangerous constraint: no refund or account change on model confidence alone, only after verified identity and a gateway pass.
1. Resolve the Double Charge Without Creating Another Problem
The request
"I was charged twice for last month's subscription and need this fixed today."
What the assistant must do
- Establish who is asking.
- Inspect live billing.
- Find the applicable refund policy.
- Avoid issuing a duplicate refund.
- Decide whether to answer, request approval or hand off.
- Key point: a fluent reply can't establish that a refund is allowed or that it succeeded.
Scope and goal
- Channels: chat, email and voice transcripts.
- Goal: cut handling time and cost without increasing incorrect or harmful resolutions.
Who gets what
| Person | What they get or own |
|---|---|
| Customer | A grounded answer or a clear next step |
| Support agent | Evidence and attempted actions when taking over |
| Support operations | Owns escalation policy and adoption |
| Security, legal, privacy reviewers | Approve access and tool permissions |
- First (agent-assist) release: a human sends every final response.
- Money-moving actions stay subject to explicit approval rules.
The design idea
- Routed decision pipeline: a sequence of services that classifies each request and sends it down the path its risk allows.
- Deterministic policy gateway: a service that evaluates written rules against identity, action type, value, current facts and approvals.
- The boundary holds even when the model is confident.
Idempotent = repeating the same request can't create a second effect.
The double charge through that idea
verify identity → fetch live billing facts → model drafts a reply or proposes a refund → gateway → answer or act, or approval or handoff
- The source figure's caption: the model suggests, the policy gateway decides, and risky or uncertain work reaches a human with context.
First-release exclusions
- Open-ended negotiation
- Autonomous handling of legal complaints
- Unsupervised refunds or cancellations
- Cross-system data repair without review
- Proactive outreach on ambiguous policy violations
- Lawsuit threats and open negotiation stay human.
2. What You Need to Design and What It Assumes
The task
- Explain the system end to end at interview depth, starting from its dangerous constraint:
- No refund or account change may happen on model confidence alone.
- Only after verified identity and a policy gateway pass.
- Then answer follow-ups on:
- Identity
- Source authority
- Action safety
- Handoff
- Failure modes
- Evaluation
- Rollout
- Cost
Who it's for
- Engineers preparing for Forward Deployed, solutions or applied-AI engineering interviews.
- Especially a round asking for a support agent that can take actions on customer accounts.
What it assumes you know
- Retrieval
- Large language model (LLM) agents and tool calling
- Idempotent APIs
- Basic cloud architecture
Caveat: all traffic, timings, thresholds and framework examples are the source's planning assumptions, not measured guarantees.
3. The Anchor for Related Support Cases
- This is the anchor case for support automation.
- Related cases reuse the same pipeline and change which boundary dominates.
- Learn the shared pipeline here and carry only the difference.
| Related case | What changes from this case | Where it's taught here |
|---|---|---|
| Customer Support Assistant at 1M conversations a day | Planner only for multi-system requests; three distinct memory layers; model routing and large-scale serving | Walkthrough step 5 and the scaling deep dive |
| Multi-Tenant SaaS Support Assistant | A tenant predicate on every retrieval and tool call; tests for cross-tenant leakage | Multi-tenant deep dive |
| ServiceNow Ticket Automation Agent | Classify, prioritise, assign and request missing details; obey the existing ITIL change process | IT service management deep dive |
| Agentic Support Workflow (short and full mock) | Probes on handoff quality, wrong refunds, stale facts, confidence, rollout and the requested automation target; the marketplace scenario | Practice |
| OpenAI-style practice prompt, Customer-Support Agent | The decomposition list and the 80 percent follow-up | Practice |
| Six framework mock designs | How branches, interrupts, retrieval, durable state and specialist tools implement the same control boundaries | Implementation deep dive |
| Support chatbot with 10,000 daily users | The cost drill | Practice, cost pivot |
Quick Recall: Lines to Say in the Interview
- "A fluent reply can't prove a refund is allowed or that it succeeded."
- "The model can propose a refund. The gateway decides whether it executes."
- "Every write is idempotent, so a repeat can't refund twice."
- "In the first release, a human sends every final response."
- "Lawsuit threats and open negotiation stay human."
- "This is the anchor case; related cases change which boundary dominates."
Design walkthrough
The one-line goal: Support that answers, asks for approval or hands off with evidence, while every account action stays controlled.
30-Second Cheat Sheet
- Reframe first: this isn't "a chatbot that answers everything". The product decides when to act, when to ask and when to stop.
- Optimise for outcome: cut handling time and cost without raising wrong or harmful resolutions.
- Core rule: the model only suggests. A deterministic policy gateway decides whether anything executes.
- Identity before account access. No verified identity means no account tools.
- Source systems own the truth (billing, orders, CRM). The automation layer owns only workflow state.
- Failures degrade into a safe handoff with full context. They never force an answer.
- Measure net value, not deflection.
- Roll out slowly: agent-assist → reversible intents → one tool class at a time, with a kill switch per intent.
Opening line to say out loud: "I'll optimise for the outcome first: reduce handling time and cost without increasing incorrect or harmful resolutions. I'll clarify the highest-risk intents, estimate scale, sketch the control flow, then spend most of my time on escalation, safety and rollout."
1. Discover the Authority and Harm Boundaries
The reframe
- The request sounds like "automate routine support".
- In the first minute, turn it into: when do we act, when do we ask for approval, when do we stop?
- A chatbot that answers everything fails that test.
Naive vs real design
- Naive: send the message to a model → draft a reply → close the ticket.
- Real: start earlier.
- Verify who the user is.
- Check whether the request touches money.
- Decide whether it is safe to act on the account.
- Keep enough context for a human to take over.
- If billing is down or a policy check fails, hand off safely. Don't force an answer.
Three answer tiers (what interviewers grade)
| Tier | What it does | Why it falls short / wins |
|---|---|---|
| Weak | LLM drafts a reply and closes the ticket | Treats model output as truth. No identity check. No policy gate before a refund. |
| Average | Classify intent, retrieve context, draft, escalate on low confidence | Never says which actions need approval. Ignores "refund ran but response timed out". Treats confidence as permission. |
| Strong | Routed decision pipeline with a deterministic gate | Identity first, risk tags, grounded drafts, gateway decides execution, latency by risk, failures → handoff, staged launch with kill switches. |
Six discovery areas (name them unprompted)
- Channel and volume
- Action authority
- Identity and data sensitivity
- Freshness of knowledge
- Escalation and human-in-the-loop
- Multilingual handling
Questions that move the risk boundaries
| Ask this | In plain words | It decides |
|---|---|---|
| Which channels, what volume and peak concurrency? | Chat only, or email and voice too? How many at once on Monday morning? | Gateway envelope, capacity, whether voice joins the pipeline |
| Which intents can be automated, which need approval? | Can it answer "where's my order" alone? Who approves refunds? | Risk tags, gateway rules, first-release scope |
| How is the customer verified? Which fields are sensitive (PII)? | How do we know it's really them before showing card digits? | Assurance levels, identity boundary, which tools stay locked |
| What's the refund approval threshold, and who owns it? | At what amount must a manager click yes? | The one number the gateway checks. Never invent it. |
| How fresh must policy, order and account data be? | If billing is 10 minutes behind, can we promise a refund? | What's fetched live, what's cached, what to do when stale |
| What does a human get at handoff, and how fast? | Full story in seconds, or a transcript later? | Handoff record fields, route, handoff p95 |
| How many languages? What if detection is unsure? | Guess Portuguese or hand off? | Language-neutral intake and multilingual escalation |
| Which legal, financial or safety cases stay human? | Can a lawsuit threat ever get an auto-reply? | Risk tags, non-goals, human-only gates, launch order |
Handling missing information
- Interviewers often answer only half the questions on purpose.
- Say your assumption out loud when numbers are missing.
- Safe defaults:
- Chat and email, no phone → text-based model.
- Unknown language mix → dominant language plus a fallback escalation path.
- Unknown volume → scalable, not over-engineered.
- Never assume silently:
- Identity is always verified.
- Any request can be automated.
- The model's answer is safe.
- The CRM is always the source of truth.
- When in doubt: no unauthorised action, no confidently wrong answer on sensitive topics.
- Never fill in an unknown refund threshold with a convenient value.
People and the failure each notices first
| Person | Notices first | System gives them | Approval role |
|---|---|---|---|
| Customer | A confident wrong answer or a broken promise | Fast grounded answers; clean handoff on risky cases | None |
| Support agent | A thin handoff that repeats work | Handoff with intent, evidence, attempted actions, reason codes | Sends every reply in phase one; approves gated actions |
| Support ops lead | Automation that pushes work into second contacts | Safe automation rate per intent, repeat-contact rate, kill switch | Owns go/no-go with product |
| Security / legal / privacy | An action taken before identity was verified | Immutable audit trail | Signs off each tool class |
Scope fence (declare before drawing any box)
First release excludes:
- Open-ended negotiation
- Autonomous legal complaints
- Unsupervised refunds or cancellations
- Cross-system data repair without human review
- Proactive outreach on ambiguous policy violations
Why: without a non-goals list, the design grows until risk takes over the interview.
2. Turn the Outcome into Testable Requirements
Constraint vs preference
- Constraint = a boundary the design must obey.
- Example: "Refunds above a threshold need human approval." It shapes trust, authorisation and audit.
- Preference = polish.
- Example: "Show recent purchases on the right side of the console." It decides nothing about safety.
- Rule: write each requirement so a test can fail it. Give it an owner and an observable failure.
Functional requirements (the pipeline, in order)
- Normalise intake: chat, email, web and voice become one case envelope.
- Classify intent and risk before choosing retrieval, drafting or action.
- Verify identity before showing account data or using account tools.
- Retrieve evidence: approved policy plus live CRM and order state. Draft from that evidence.
- Draft or send based on confidence and risk.
- Execute tools (refunds, address changes, subscriptions) only through a controlled layer that checks authorisation, validation, freshness, threshold and approval.
- Hand off with conversation, evidence, attempted actions and the reason automation stopped.
- Record everything: retrievals, decisions, tool calls, overrides and outcomes.
Non-functional requirements (tiered by risk)
p95 = the time that 95% of requests finish within.
| Area | Testable target |
|---|---|
| Latency | Routine < 3 s (auto by default) · Ambiguous < 8 s (retrieval + second pass) · High-risk handoff bundle < 15 s (decision never automated) |
| Availability | 2M tickets/month, 100 QPS peak. Routing, retrieval and escalation run independently. Bursts shed enrichment and reply "we're processing your request", never collapse. |
| Security | Customer text goes in a message channel, never a control channel. Tools scoped per workflow. Identity verified before any account tool. |
| Compliance | Immutable trail: actor, model version, tool, fields validated, policy version, human override. |
| Reliability | Timeouts or missing context → safe handoff. Reconcile side effects before retry. 409 when a state change is no longer allowed, 422 when validation fails. |
| Cost | NetValue = time saved − model cost − wrong-resolution cost − recontact cost. Never deflection alone. |
| First release | The five scope-fence exclusions above. |
Who owns each requirement
| Requirement | Owning component(s) |
|---|---|
| Classify and route | Intent router, policy classifier, escalation gate |
| Grounded context | Retrieval layer over CRM, order and policy sources |
| Draft or send by risk | Response policy engine with thresholds and approval paths |
| Controlled tool execution | Tool execution service (authorise, validate, log) |
| Handoff with history | Agent console and shared case timeline |
| No unauthorised action | Permission checks plus human approval |
| Low wrong-resolution rate | Conservative thresholds, grounding, human fallback |
| Fast human takeover | One-click escalation and context packaging |
| Full auditability | Append-only event trail (actor, time, reason) |
Spoken answer: "Functionally, I verify the customer, pull live facts, draft from evidence and gate any account action. Non-functionally: latency by risk tier, fail-closed money moves, audit, and net value rather than deflection."
3. Keep Business Truth in Its Source System
The rule
- The automation layer owns workflow state and decision evidence only.
- It never owns the customer's truth.
- If the source system says the account is locked, no cache can say otherwise.
Source of truth table
| Source | Holds | Before an action | Safe to cache? | Risk if broken |
|---|---|---|---|---|
| CRM | Profile, entitlements, case history | Live lookup before any account change | References or summaries only | Stale plan → wrong commitment |
| Order management | Orders, shipments, tracking | Live before refund, replacement or status promise | Summaries only (guide search, never override) | Stale shipment → confident wrong reply |
| Billing / payments | Charges, refunds, ledger | Live before every money move; reconcile after timeouts | Never | Duplicate refund; refund on wrong order |
| Policy KB | Versioned refund, warranty, cancellation policy | Policy version stamped on every answer and action | Yes, by version | Old policy quoted as current |
| Ticketing | Prior cases, tags, resolutions | Context only, never instructions | Scoped summaries | Prompt injection via old tickets |
| Identity provider | Authentication, assurance level | Every session and again at the action boundary | Never | "Sounds right" mistaken for verified |
Two kinds of staleness
- Stale shipping data → the answer is wrong.
- Stale ledger or identity → the action is harmful.
- For the double charge: fetch billing live, stamp the policy version on the proposal and the reply.
- Old tickets are evidence with provenance, never commands.
4. Trace One Request Through the Controls (Architecture)
The seven steps (whiteboard version)
- Receive: the channel gateway turns any channel into one conversation envelope.
- Verify: identity assigns an assurance level. Failure → generic help or handoff only.
- Route: tag as informational, account-sensitive, money-moving, legal or safety.
- Single lookup (order status) → direct read-only path.
- Multi-system case → bounded planner.
- Gather facts: retrieve policy plus live account facts. The LLM drafts a reply or proposes a typed tool action. It's still only a recommendation.
- Gate: the deterministic gateway checks assurance, allowlist, account and tenant scope, freshness, value threshold and need for human review.
- Choose the outcome: the calibrator picks auto-resolve, request approval or escalate with reason codes. High confidence can't override a failed rule.
- Execute and record: scoped execution with typed arguments and an idempotency key. Audit the decision. The quality store records solved, reopened, corrected and overridden outcomes.
Idempotency key = a unique operation ID, so a repeated request refers to the same operation instead of creating a new one.
Double-charge example
- Steps 1–4 → a refund proposal grounded in the live ledger and a versioned policy.
- Step 5 → checks assurance, that refunds are allowed in this workflow, and whether the amount crosses the threshold.
- Over the threshold → step 6 pauses for approval instead of executing.
Three boundaries to point at on the diagram
- Identity boundary: sits before the router.
- Unverified traffic gets generic FAQ only.
- Account reads and tools need verified assurance.
- Authorisation boundary: the tool policy gateway.
- Everything to its left may suggest. Nothing to its left may act.
- Confidence never grants permission.
- Sync / async boundary: at the action layer.
- Accept and route fast.
- Refunds and investigations run in the background. The customer hears "your request has been submitted" right away.
Components (in dependency order)
| Component | Job | Owns | When it fails |
|---|---|---|---|
| Omnichannel gateway | Normalise all channels into one envelope | No business state | Sheds enrichment, keeps the conversation |
| Identity verification | Confirm customer, assign assurance | Identity session | Fails closed: account tools off |
| Intent & risk router | Classify and tag risk | Routing decision | Narrower safe mode; low confidence escalates |
| Knowledge retrieval | Policy, account facts, prior cases | Nothing (reads sources) | Draft may continue; action blocked |
| Response generator | Draft reply or proposed tool call | Nothing; never final authority | Circuit-breaks; risky cases → humans |
| Tool policy gateway | Deterministic checks | Approval rules (the authorisation boundary) | Fails closed |
| Confidence calibrator | Auto-resolve, approve or escalate | Decision support | Escalates |
| Tool execution service | Run allowed actions safely | Action record | Queues for reconciliation; never blind retry |
| Human-agent queue | Escalations with full context | Handoff lifecycle | Prioritises by risk, not arrival order |
| Quality evaluation store | Outcomes for calibration | Analytics only | Answer still served; gap logged |
Two planes
- Data plane (the fast path): conversation, facts, draft and action results.
- Ingress → identity → routing → retrieval → draft → gateway → outcome → execution or handoff → trace events.
- Control plane (decides if the path may continue): versions everything.
- Risk tags, refund thresholds, tool allowlists, confidence thresholds.
- Prompts, models, policies, routing weights.
- Low-risk intent list, kill switches per intent and per tool.
- Every policy change has a version, so behaviour never changes unexplained.
- Author's view: most escalation failures are control decisions made too late or in the wrong place, not generation failures.
Partitioning and caching
- Partition queues by conversation, customer or account ID. Without it, you get duplicate replies and out-of-order handoffs under load.
- Cache: policy articles, language detection, non-authoritative summaries.
- Never cache: identity assertions, money movements, account status, authorisation decisions.
5. Decide What Can Happen and Who Decides
The gateway's five questions
- Is identity assurance sufficient?
- Is the action allowed?
- Does the refund exceed the threshold?
- Does the case require human review?
- Can this agent tier access the data?
Three possible outcomes
- High confidence + policy pass → auto-resolve.
- Plausible, but the action needs approval → pause for a human.
- Risky, ambiguous, missing context or a failed check → human queue with trail and reason codes.
Request type → default path
| Request | Path |
|---|---|
| Public FAQ | Approved policy or versioned cache. Answer, or queue if evidence is weak. |
| Order status | Verify if account-specific. Fetch live status. Answer only from returned facts. |
| Refund, cancellation, address or payment change | Live facts + assurance check. Gateway applies allowlist and threshold. Approval where policy says. |
| Legal, safety, unclear language, conflicting evidence | Escalate with reason codes and context. |
| Tool timeout after a possible side effect | Mark pending, check the action record or ledger, then confirm, wait or escalate. Never retry blind. |
Human approval at the risky tool
- Validate the proposal first, then pause at the risky tool. Read-only work can continue.
- Bind the approval to: tenant, customer, order, amount, arguments, case version and policy version shown to the reviewer.
- Recheck live eligibility on resume.
- Amount or order changed? → new proposal, fresh approval.
- Measure approval-queue volume and wait time. Don't assume it's small.
- Goes to the manager queue:
- Refunds above the threshold
- VIP escalations
- Account deletion
- Legal or compliance requests
- Payment information changes
Direct paths, planners and capabilities
- "Track my order" → one authorised tool call. No planner.
- "Laptop arrived damaged. Refund, cancel warranty, notify shipping, open a priority ticket." → one bounded planner coordinating several systems.
- A planner must earn its latency and cost.
- Every side effect it proposes still passes the gateway.
Capabilities, not a fixed pipeline
- RAG, tool calling and memory sit side by side. The orchestrator uses what it needs.
- "What's your refund policy?" → RAG over the knowledge base.
- "Refund my order" → tool call to a business system.
- The LLM does neither on its own.
Three memory layers
| Layer | Holds | Example | Guard against |
|---|---|---|---|
| Session (short-term) | Current conversation, references like "it" | "Where's my package?" → "Refund it" = same order | Losing the order or thread |
| Customer history (long-term) | Preferences, past interactions | Language, channel, past purchases | Treating stale or private history as current entitlement |
| Enterprise knowledge | Approved policies, docs, FAQs (RAG) | Refund policy, troubleshooting | Using an outdated policy version |
Why separate them: a stale preference and an outdated policy fail differently, so each must be fixable on its own.
Route models by risk
- Deterministic rules wherever a rule can do the job.
- Small model for classification and routine FAQs.
- Large reasoning model only for ambiguous or high-risk work, after retrieval and policy filtering.
- Don't downgrade globally (it hurts the cases that matter) or inflate context globally (it wastes budget).
- Levers: tiered routing, caching, shorter context, better retrieval.
- Quality drops? Inspect failed examples, then fix the route, evidence or model.
6. Make Uncertain Execution and Handoff Visible
The handoff
- A thin handoff is operational leakage, not a UX issue.
- The agent repeats questions, and the customer loses trust.
- A transcript alone hides which control failed.
- The handoff record carries:
- Original message
- Identity status
- Parsed intent and risk
- Retrieved evidence
- Policy checks
- Tool outputs and error codes
- Attempted or pending actions
- The specific reason automation stopped
- Explainability lives at the workflow level, not the model level.
Where the human queue sits
- On the boundary between automation and operations, not deep in the model path.
- Routine traffic never competes with slow manual work.
Backpressure in three places
- Ingress: shed non-essential enrichment, keep the conversation.
- Retrieval: degrade to a narrower safe mode, don't wait forever.
- Escalation: prioritise by risk and customer impact, not arrival order.
The six-row decision table
The source says this is the artefact interviewers ask for most.
| Situation | Default | Why |
|---|---|---|
| FAQ, no account access | Degrade or queue | Low risk; protect the experience |
| Order status lookup | Fail closed on bad input; degrade if tool is down | No irreversible action, but must be accurate |
| Refund or address change | Human above threshold | Irreversible or customer-impacting |
| Identity verification fails | Fail closed | No account tools without identity |
| Language detection fails | Degrade and escalate | A routing error beats a guessed conversation |
| Timeout after possible side effect | Queue for reconciliation | Avoid duplicate actions |
Recovery evidence needed
| Failure | Decision | Evidence to keep |
|---|---|---|
| Weak FAQ evidence | Queue, or answer with a clear limitation | Article version, confidence signals |
| Malformed order lookup | Fail closed | Validation error, original request |
| Order tool down | Degrade or hand off; never invent status | Timeout, last snapshot labelled stale |
| Refund over threshold | Human approval first | Gateway rule, approver, action record |
| Identity unavailable | No account tools | Assurance check, outage reason |
| Language uncertain | Language-neutral intake, escalate | Detection scores, chosen fallback |
| Timeout after side effect | Pending reconciliation | Idempotency key, action record, ledger result |
Replay the billing timeout
- Customer sends the double-charge message.
- Gateway checks whether identity is needed. Verification returns an assurance level.
- Router asks retrieval for policy and account context.
- Billing lookup times out.
- Generator still drafts, but the gateway blocks the action because the facts are incomplete.
- Case goes to the human queue with the failure reason and history.
- Quality store logs the outage and fallback for learning.
What it shows: who can decide, who can only suggest, which state is authoritative, and which failure needs a human rather than a retry.
The timed-out refund
- Execution status is unknown. Treat it as possibly successful.
- Never retry blind.
- Query the ledger or action record, then return success, keep waiting or escalate.
- Argument hash (
ProposedAction.args_hash) spots duplicates locally, but can't stop a second payment if the backend ignores idempotency. - Idempotency keys work only if the backend honours them. Otherwise, reconcile before resubmitting.
Incident shape: detect → contain → recover → prevent
Example: a wrong policy answer.
- Detect: policy-answer check or retrieval mismatch.
- Contain: stop automated delivery so it never becomes a promise. Keep the record.
- Recover: hand off to a human with the exact output and evidence.
- Prevent: grounding, policy versioning, answer validation, a regression test for the same failure.
What security wants to hear: "We will bound it, record it, stop it and learn from it", not "we'll fine-tune it more".
Dependency outages have fixed behaviours
- Identity provider down: account tools fully off. Generic help or escalate.
- Policy retrieval down or stale: never present an old rule as current. Withhold the commitment and hand off.
- Model endpoint flaky: circuit-break, queue eligible tickets, send risky ones to humans.
- Language detection fails: never guess. Language-neutral intake, short multilingual prompt, escalate if unsure.
- Stale account state: mark as possibly outdated, ask the customer to refresh, or route to an agent with the snapshot.
- Danger case: the model using old state to make a new commitment.
Timeouts and retries
- Short timeouts.
- Bounded, jittered retries.
- Dead-letter queues keep failed jobs for inspection.
- A timeout never turns a blocked action into an allowed one.
7. Size Calls, Queues and Cost by Workflow
Practice numbers
- 2M tickets/month ≈ 67,000/day on average.
- 100 QPS at peak → the control plane can't be single-threaded.
- 20 languages → English-only assumptions are unsafe.
- Size for the spike that breaks the system (incident or billing change), not the average.
- Don't mix this with the separate 1M-conversations-a-day case. Keep the units apart.
Tickets → model calls
| Ticket mix | Tickets | Calls each | Model calls |
|---|---|---|---|
| Routine (70%) | 1.4M | 2 | 2.8M |
| Ambiguous (20%) | 0.4M | 3 | 1.2M |
| Escalated (10%) | 0.2M | 1 | 0.2M |
| Total | 2.0M | ≈ 4.2M / month |
- That's before retries, moderation and tools.
- Retrieval calls: 1.4M + 0.8M + up to 0.2M = 2.2M–2.4M / month.
- Estimate retrieval separately. It drives freshness, caching and failure isolation.
- These are interview assumptions, not measured demand.
Staffing angle
- Fully manual: well over 1,000 agents (at ~1,500 tickets per agent per month).
- Deflecting 30–50% (conservative) means delayed hiring, less overtime and agents moved to complex work.
- It does not mean cutting half the team.
Pressure → design response
| Pressure | Response |
|---|---|
| Peak QPS / burst | Stateless gateway and router, ordered queues per customer or case, rate limits per user, tenant and tool, circuit breakers, shed enrichment |
| Latency | Budget by risk tier, direct lookups, bounded context, selective reasoning, streaming, background actions |
| Freshness | Cache policy by version and safe FAQs by tenant, permission and version. Fetch identity, money, account status and authorisation live. |
| Cost | Trace spend by intent. Rules or a small model for routine work, a strong model for hard cases, a planner only for multi-system work. |
| Growth to 10M/day | Partition retrieval by product, region, language and business unit. Isolate escalation and offline work. Regionalise for residency. |
At 10× growth
- Rethink partitioning, not server count.
- Split online answering from offline summarisation.
- Isolate escalation from routine classification.
- Move long enrichment off the critical path.
- Peak concurrency and escalation rate shape the architecture more than monthly totals.
The NetValue equation (most reusable move)
NetValue = value of time saved − model cost − wrong-resolution cost − recontact cost
- Include retrieval and operating cost too.
- A confidently wrong resolution usually costs more than the model bill.
- Saving 10 seconds per ticket while raising recontact is not a win.
- Measure cost per resolved case by intent, language and customer group.
8. Earn Each Expansion with Evidence
Deflection is not resolution
- Deflection = work moved somewhere else.
- Safe automation rate = automated cases resolved without correction, complaint or harmful escalation ÷ all automated cases.
- Fix the follow-up window. Count unique cases consistently.
- Also report automation coverage (automated ÷ all eligible). A high safe rate on a tiny easy subset is misleading.
- Read it alongside incorrect resolutions, repeat contact and first-contact resolution.
Outcome metrics
| Metric | How it's calculated | Owner | Alert when |
|---|---|---|---|
| Safe automation rate | Clean automated resolutions ÷ automated cases | Support ops + engineering | Drops for an intent or segment → roll back that intent |
| Incorrect-resolution rate | Cases marked wrong, reopened or corrected ÷ cohort with full window | Support QA | Above the intent's baseline |
| First-contact resolution | Resolved without a repeat contact | Support ops | Weakens after an expansion |
| Average handling time | Agent or assisted time per case | Operations | Improves only because work moved to follow-ups |
| Repeat-contact rate | Cases with another contact on the same issue | Support analytics | Rises after an automation change |
| CSAT | Post-contact survey | Product / support leadership | Throughput up, sentiment down |
| Cost per resolved case | Operational cost ÷ resolved cases | Finance-ops | Savings eaten by rework or escalation |
Four monitoring layers
| Layer | Question | Signals |
|---|---|---|
| Technical health | Is it alive and safe? | p95 by tier and stage, tool errors, queue depth, breaker trips, fallback rate, error budget |
| Model & decision quality | Does the AI decide well? | Answer accuracy, retrieval precision, unsupported answers, correct escalation, missed escalations |
| Adoption | Do people use it? | Agent-assist usage, accepted drafts, overrides, workflow share |
| Business outcome | Did the customer get value? | Safe automation, incorrect resolutions, FCR, repeat contact, CSAT, handling time, cost per case |
- Segment every view by intent, language and customer group.
Read across the layers
- Cost per case ↓ + repeat contact ↑ → work shifted to a second contact.
- Safe automation ↑ + CSAT ↓ → the wrong intents were automated.
- Handling time ↓ + FCR flat → typing time saved, not better resolution.
- Handle time ↓ + repeat contact ↑ → rework, not improvement.
- Rising incorrect resolutions, rising recontact or falling CSAT can veto a better deflection number.
The go/no-go gate
It's a checklist, not "the demo looked good".
- Retrieval accuracy on target intents is stable
- Human reviewers approve a representative sample
- Fallback behaviour is correct
- Logging is complete
- The rollback path has been exercised
Any missing item delays launch, however fluent the model sounds.
Ownership
- Product: the gate and the scorecard.
- Support ops lead: adoption and escalation policy.
- Engineering: reliability and guardrails.
- Security and legal: data access and tool permissions.
- Frontline manager: training and daily quality review.
Staged rollout (by intent and tool class)
| Week | Gate |
|---|---|
| 0–1 | Fix the scope fence (no negotiation, no autonomous legal, no unsupervised refunds or cancellations) |
| 1–2 | Agent-assist only: model drafts and suggests, a human sends every reply |
| 2–3 | Prove retrieval, escalation and handoff quality on real and historical tickets |
| 3–4 | Automate low-risk, reversible intents: order status, subscription FAQ, password-reset guidance, shipping ETA |
| 5 | Enable tools one class at a time: tagging → order lookup → refund initiation → address change |
| 6–8 | Human review samples automated cases. Kill switch per intent and per tool. |
| After | Expand only where the safe automation rate holds. Roll back one drifting intent, not the whole system. |
- Each tool expands the blast radius, so each gets its own gate.
- Example: warranty eligibility gets overconfident → roll back that intent or drop it to agent-assist. FAQs keep running.
- Canaries are tiny, visible and reversible, because one bad answer repeats across every similar ticket.
Risk register
| Risk | Owner | Mitigation | Trigger |
|---|---|---|---|
| Hallucinated policy answer | Support QA | Grounding, mandatory escalation on low-confidence policy intents | Spike in incorrect resolutions |
| Stale account lookup | Engineering | Freshness checks, timeout handling | Tool output vs CRM mismatches |
| Segment with unusual wording | Operations | Intent-specific tuning, agent-assist fallback | Rising override rates |
Deliver something the team can operate
- Training for agents.
- A triage playbook for support managers.
- Documentation of the intent catalogue, escalation triggers, approved tool actions and review process.
- If it needs a developer in the room to run, it isn't delivered.
Product vs customer wiring
- Rewriting approval logic per customer = a consulting script, not a product.
- Configuration: intent thresholds, escalation rules, routing weights, languages, retention windows, low-risk intent list.
- Adapters: CRM, ticketing, identity provider, knowledge base, survey platform, channels.
- Shared services: retrieval, policy evaluation, audit logging, prompt assembly, response classification, observability.
- Core product: trust boundary, escalation framework, safe tool execution, metrics pipeline.
MVP vs later
- MVP: gateway, identity, routing, retrieval, generation, deterministic gating, human escalation, outcome logging.
- Later: calibration models, smarter prioritisation, replay pipelines, proactive deflection, multilingual optimisation, automated policy regression tests.
- None of the later items replaces the control structure.
Quick Recall: Lines to Say in the Interview
- "The model suggests. The gateway decides."
- "Identity comes before any account tool, and it fails closed."
- "Billing is never cached. Policy is cached by version."
- "A timeout after a possible side effect means reconcile, never retry blind."
- "A thin handoff is operational leakage."
- "Latency is budgeted by risk tier: 3, 8 and 15 seconds."
- "I measure net value and safe automation rate, not deflection."
- "Roll out by intent and by tool class, with a kill switch for each."
Technical deep dives
What this part covers: the mechanisms behind the design. How state is stored, how writes stay safe, how security is layered, how it scales, two variants of the same system, and six concrete implementations.
30-Second Cheat Sheet
- Three records run the workflow:
Case,ProposedAction,Handoff. - Optimistic concurrency: every write carries the version it expects, so the machine never overwrites a human's newer decision.
- Idempotency on every write: a retried request returns the same result, never a duplicate case or payment.
- A timeout means "unknown outcome", not "try again". Check the ledger first.
- Security is a chain of four links: untrusted text, least-privilege tools, identity before account tools, immutable audit.
- Contain the blast radius by tenant, region, workflow and dependency.
- Scale by partitioning, not by adding servers: stateless services, partitioned RAG, a safe FAQ cache, async actions.
- Variants change one thing: multi-tenant adds a tenant predicate everywhere. ITSM adds change control.
1. Durable Case State and Write Contracts
The three records
| Record | Fields | Job |
|---|---|---|
| Case | id, customer_id, channel, intent, risk, state, version |
The live object. Kept hot while the support window is open. |
| ProposedAction | id, case_id, tool, args_hash, decision |
The proposed or executed step. Immutable once its outcome is recorded. |
| Handoff | case_id, summary, evidence_refs, attempted_actions |
What a human gets when the machine stops. Makes the agent faster and safer. |
Case lifecycle
new → triaged → waiting_approval → escalated → resolved
Optimistic concurrency (the version field)
- A write says "I expect version N".
- If a human already changed the case, the version no longer matches and the write fails cleanly.
- Why: the machine never silently overwrites a human's newer decision.
args_hash explained simply
- A hash of the action's arguments.
- Spots duplicate requests without storing raw sensitive values.
- Caveat: hashing low-entropy values (short IDs, small amounts) doesn't make them anonymous. Keep sensitive arguments only under the data policy.
What the Handoff also carries
- Identity status
- Checks that ran
- Error codes
- The precise stop reason
The API: small and boring
| Endpoint | Purpose |
|---|---|
POST /v1/support/messages |
New customer message → create or update a case |
POST /v1/cases/{id}/actions |
Propose or run an action |
POST /v1/cases/{id}/escalate |
Hand off to a human |
POST /v1/cases/{id}/quality-review |
Record a QA outcome |
Every request:
- Is authenticated and tenant-scoped.
- Validates its schema.
- Defines idempotency for every write.
Versioning:
- Payload schemas and API contracts are versioned separately from risk policy.
- A case written at an old version stays readable after the policy engine learns a new risk label.
Error codes:
- 409 Conflict: the state transition is no longer allowed.
- 422 Unprocessable: typed validation failed.
Drill 1: duplicate message
- Client sends
POST /v1/support/messageswithIdempotency-Key: msg_9f1c. - The server creates
case_123, but the response times out. - Client retries with the same key.
- Server returns the same
case_123. It does not createcase_124. - Logs: "duplicate deduplicated at the write boundary".
First (and repeated) response:
{"case_id": "case_123", "state": "triaged", "risk": "medium", "next_action": "draft_for_agent"}
Drill 2: refund timeout
- A timeout is an unknown outcome, not permission to pay again.
- Check the action record or ledger.
- Then confirm, keep pending or escalate.
Ordering and sync vs async
- Order queues by conversation, customer or account ID, so retries don't reorder replies or handoffs.
- Acknowledgement ≠ completion.
- A refund or shipping investigation may continue in the background.
- Tell the customer it was submitted until authoritative completion arrives.
Soundbite: "Every write is idempotent and versioned. A retry returns the same case, and a timeout triggers reconciliation, never a second payment."
2. Security as a Chain, and Containing the Blast Radius
Identity first
- "The customer sounds right" is not authentication.
- Billing, PII, address changes, password resets and account access all need identity confirmed through the approved path first.
- Verification returns an assurance level. The gateway checks it on every action.
- Pre-authenticated FAQ traffic stays in a limited generic mode with no account tools at all.
The four links in the chain
1. Untrusted text
- Customer text can carry:
- Prompt injection
- Malformed account numbers
- Copied ticket history
- Hostile instructions or social engineering
- Customer messages, retrieved articles and old tickets go in the message channel, never treated as privileged instructions.
- The model can still propose a malicious tool call after reading injected text.
- The gateway rejects it unless independently authenticated scope, validated arguments and current policy allow it.
- Key point: separating channels helps interpretation but does not enforce authorisation.
2. Least-privilege tools
- Tools are scoped per workflow.
- An order-status assistant never gets refund, cancellation or payment-history power.
- Credentials are scoped the same way.
3. Identity before account tools
- As above.
4. Immutable audit
- Who requested the action
- Which model version suggested it
- Which tool ran
- Which fields were validated
- Which policy version was in force
- Whether a human reviewed or overrode it
- The evidence survives the incident.
Why a chain: any single control can fail. Permissions live in retrieval and tool execution, even when the prompt also states them.
Blast radius in four layers
| Contain by | So that… |
|---|---|
| Tenant | One bad policy prompt doesn't break support for every customer |
| Region | A queue outage doesn't corrupt the global audit log |
| Workflow | A refund-tool failure doesn't affect FAQs |
| Dependency | A language-routing outage doesn't take down ticketing or audit |
- Allowed adaptations: ingress sheds enrichment, retrieval narrows to a safe mode, the human queue prioritises by risk.
- Never allowed: stale account facts becoming fresh promises.
Confident wrong policy answer: what to do
Ask three questions first, before patching the wording:
- Was any irreversible action taken?
- Was a customer sent down a harmful path?
- Can we preserve the raw prompt, model output and policy version?
Then:
- Stop automated delivery.
- Keep the evidence.
- Hand off.
- Add the failure to regression tests.
- Fix retrieval, versioning and validation before touching the model.
3. Scaling from a Support Pilot to Global Traffic
Units warning: this is the separate consumer scenario of 1M → 10M conversations a day. Don't mix it with the 2M-tickets-a-month example.
Seven scaling moves
- Stateless services: gateways, orchestrators and model routing behind load balancers, each scaling on its own.
- Partitioned RAG: split by product, region, language and business unit. Not one search over everything.
- Semantic FAQ cache after the intent classifier:
- "What is your return policy?" → served from cache, never reaches the orchestrator.
- "Where is my order?" → needs live customer data. Never served from another customer's answer.
- Cache keys include tenant, permission and content version.
- Never cached: identity, account status, authorisation decisions, money state.
- Async workflows for refunds, warranty cancellations and shipping investigations.
- Rate limits per user, tenant and tool, plus circuit breakers on dependencies.
- Enterprise identity on every tool call (OAuth, RBAC or ABAC, with audit).
- The LLM never bypasses application authorisation.
- Business systems stay the source of truth.
- Model routing by task.
RBAC = role-based access control. ABAC = attribute-based access control.
Going global
- Regional gateways and orchestrators.
- Indexes partitioned by geography where data residency requires it.
- Active-active stateless services.
- Separate online answers from offline summaries.
- Isolate human escalation from routine classification, so a surge in one doesn't starve the other.
4. Multi-Tenant Support and IT Service Management
The same pipeline, two more forms. Each changes one thing.
Variant A: multi-tenant SaaS support
What changes: tenant isolation becomes the dangerous constraint.
- The agent handles a tenant-specific question using that tenant's entitlements, configuration and logs.
- It must never expose another tenant's data.
- The fix: a tenant predicate on every retrieval and every tool call, carried through cache keys and logs too.
Records that gate visibility:
| Record | Fields |
|---|---|
| Tenant | id, plan, region, data_residency, features |
| Entitlement | tenant_id, feature, limits |
| RetrievalACL | tenant_id, role, doc_id (ACL = who may see a document) |
Red-team targets:
- Cross-tenant leakage
- Wrong entitlement advice
- Exposed internal logs
- Credits issued without approval
Release gate:
- An ACL red-team suite asks the same question as users from different tenants and roles.
- Zero permission violations is required to release.
Variant B: ServiceNow-style IT service management (ITSM)
What changes: change control and the CMDB.
The flow:
- New ticket arrives.
- Classify category and priority.
- Retrieve the KB article or runbook.
- Ask the requester for missing information.
- Draft a response.
- Propose an assignment group.
- Perform workflow actions only within policy.
Records that make every decision explainable:
| Record | Fields |
|---|---|
| Ticket | id, requester, category, priority, description, status, assignment_group |
| Asset (from the CMDB) | ci_id, owner, service, criticality |
| KBArticle | id, category, validity, approval_status |
| AssignmentRule | id, condition, group, confidence |
| WorkflowAction | id, ticket_id, action, approval_required, executed_by |
CMDB = configuration management database: the IT inventory of services, owners and dependencies.
Risks:
- Wrong priority or assignment group
- Tickets closed incorrectly
- Unauthorised access changes
- Leaked requester PII
- Injection in the ticket description
ITIL change control (mention once):
- Proposed configuration changes go through the customer's existing change process.
- The agent prepares the change record. It doesn't bypass approval.
- Reading the CMDB for context is a separate authorised lookup.
5. Six Implementation Examples, with Local Thresholds
Use these when the interviewer asks "how exactly?" Each adds one implementation detail. They are examples, not required choices, and their numbers belong to their own scenarios.
Quick comparison
| # | Example | Framework area | The one detail to remember |
|---|---|---|---|
| 1 | Multilingual ticket triage | LangChain foundations | Router with a required default arm; latency budget split per step |
| 2 | Human-gated ticket agent | LangGraph fundamentals | Interrupt inside the risky tool, durable checkpointer |
| 3 | Agentic RAG support assistant | RAG and retrieval | Two indexes, hybrid BM25 + vectors, 400 ms retrieval budget |
| 4 | Fragmented, growing KB | Advanced RAG | CRAG over Self-RAG, per-source α, cross-encoder rerank |
| 5 | Travel-booking agent | Agents | Supervisor + one write-capable specialist, refund amount by pure logic |
| 6 | Growing KB, parent docs | Parent-document retrieval | Small child chunks match, large parents give context |
1. Multilingual ticket triage (LangChain foundations)
- Pipeline: detect language → classify intent → route → draft → translate back.
- The framework brings batching, streaming and retries.
- Routing:
- Branch with named intents and a required default arm.
- An unrecognised class never falls through silently.
- An unknown language is never dropped.
- Example latency budget (p95 < 3 s):
| Step | Budget |
|---|---|
| Language detection | ~200 ms |
| Classification | ~300 ms |
| Streamed draft | ~1.5 s |
| Back-translation | ~500 ms |
| Total | ~2.5 s |
- That's an allocation to verify, not a measurement.
- Bounded retries on every LLM step.
- Fallback provider for the classifier: it must never strand a ticket.
2. Human-gated ticket agent (LangGraph fundamentals)
- Structured output:
{category, risk_level}. - The interrupt lives inside the refund or deletion tool, not before the whole turn.
- Read-only lookups never pause.
- Only the irreversible action does.
- Durable Postgres checkpointer keyed on ticket ID → a pod restart resumes mid-approval.
- Idempotency key:
ticket_id + action_typeworks only if a ticket allows one action of that type.- For multiple partial refunds, store a distinct logical-operation ID with the approved argument hash.
- Reuse that ID on retries. Reject changed arguments under it.
- Parallel reads (order history, account status, prior tickets) are fine.
- A failed graph step doesn't undo external calls already made. Reconcile and keep writes idempotent.
- After an interrupt, the node restarts from the top. Put the payment after approval and protect it against replay.
- Self-correction loop: max three iterations, then escalate.
- Below the confidence threshold: human review by default.
3. Agentic RAG support assistant (RAG and retrieval)
- Two separate indexes: product docs and runbooks.
- Hybrid search: BM25 lexical + vectors, so an exact error code still surfaces.
- Cheap semantic router chooses the index without an LLM call.
- Retrieve 20 per source concurrently.
- Rerank to 5 only when the top scores are close.
- Hard 400 ms retrieval budget. Fall back to whichever source answered in time.
- Prompt rules:
- Cite which source each claim came from.
- Say "I don't have that in my docs" below the relevance threshold.
- Weekly recall@k on a labelled set from real tickets gates any retrieval change.
4. Fragmented, growing knowledge base (advanced RAG)
- Three sources:
- 5,000-article wiki
- Ticket history with exact error codes
- Release notes with version numbers
- Grows ~50 items/day. Target p95 < 1.5 s.
- Hybrid search per source, with the lexical/vector weight α tuned separately.
- Tickets skew token-heavy. Wiki articles skew semantic.
- CRAG, not Self-RAG:
- CRAG (corrective RAG) grades retrieval and falls back.
- Chosen because the real failure is coverage gaps for new error codes, not hallucination.
- Below threshold: log for a human. Don't search the public web.
- Cross-encoder reranks the fused top 20. An LLM judge would eat most of the budget.
- Incremental appends with a
sourcemetadata field. No nightly reindex. - Live fallback rate = the coverage-gap signal.
5. Travel-booking support agent (agents)
- Supervisor + three specialists:
| Specialist | Power |
|---|---|
booking_lookup |
Read-only |
policy_qa |
RAG, no side-effect tools |
change_or_cancel |
Only agent with write access |
- Every routing decision is logged in one place.
- Refund amount is computed by pure logic, not by the model.
- Over $200 → interrupt before the refund tool (the mock's threshold, not universal).
- Refund is idempotent on booking ID + request ID.
- Memory:
- Thread state → durable checkpointer, one thread per conversation.
- Cross-session customer memory → separate store, read once at thread start.
- Limits: hard cap of 15 steps plus a per-conversation cost ceiling → forces resolution or handoff.
- Retry policy applies to the booking API, not to LLM calls.
- A malformed tool call re-plans through the supervisor.
- "What's your baggage allowance?" never enters the agent. It's a direct lookup wired as a workflow.
6. Growing KB with parent-document retrieval
- Child chunks (~400 chars) match support phrasing closely.
- Parent chunks (~2,000 chars) supply context and cap the worst-case prompt.
- These are LangChain's example sizes. Tune on your data.
- One Postgres for vectors and documents. Add an HNSW index once exact scans eat the latency budget.
- Daily 20-article job writes idempotently, keyed on
hash(article ID + last-modified). - Latency budget (p95 < 2 s), dominated by streamed generation:
| Step | Budget |
|---|---|
| Query embedding | 100–150 ms |
| Vector search (50,000 vectors) | 50–100 ms (generous; HNSW is often a few ms) |
| Document fetch | 20–50 ms |
| Streamed generation | ~1.5 s |
- Final k = 3 or 4.
- Below the similarity threshold: "I don't have a confident answer."
- Real index latency depends on data and hardware.
HNSW = hierarchical navigable small-world: a fast approximate nearest-neighbour index.
6. References and Source Boundaries
Two recovery facts to remember
- Graph recovery doesn't undo remote side effects.
- A resumed interrupted node can run again.
- Check backend idempotency-key scope and retention for the payment provider you actually use.
How to treat the numbers
- Intercom's 76% Fin resolution rate is vendor-reported context, not a promise or launch gate.
- Framework paths and chunk sizes are historical implementation references, not current guarantees.
- References were checked on 27 September 2026.
Reference list
| Reference | What it supports |
|---|---|
| Intercom blog: From resolutions to outcomes | Vendor-reported 76% resolution rate and deflection range |
| LangGraph docs: Interrupts | Interrupt inside the tool; durable checkpointer resuming by thread ID |
| LangGraph docs: Use the graph API | Parallel branches in a superstep succeed or fail together |
| Yan et al. 2024, Corrective RAG | CRAG retrieval grading with fallback |
| Asai et al. 2023, Self-RAG | Trained self-critique (the alternative to CRAG) |
| Sentence-Transformers: Retrieve & Re-Rank | Cross-encoder reranking of a small candidate set |
| pgvector README | Exact search by default, HNSW index option |
LangChain ParentDocumentRetriever source |
400 / 2,000-character example chunk sizes |
| Supabase: pgvector v0.5.0 HNSW | HNSW query latency at small scale |
Quick Recall: Lines to Say in the Interview
- "Writes carry an expected version, so the machine never overwrites a human."
- "Same idempotency key, same case. A retry never creates case_124."
- "A timeout is an unknown outcome. Reconcile against the ledger before anything else."
- "Channel separation helps interpretation. The gateway enforces authorisation."
- "Contain the blast radius by tenant, region, workflow and dependency."
- "Cache the return policy, never the order status or the identity."
- "Multi-tenant means a tenant predicate on every retrieval, tool call, cache key and log."
- "Put the interrupt inside the risky tool, and the payment after approval."
- "CRAG over Self-RAG when the failure is coverage gaps, not hallucination."
Quick review
One sentence: a support assistant is a routed decision pipeline. The model suggests, the policy gateway decides, and uncertain or risky work reaches a human with context.
Recall the Control Flow and First Release Gate
channel → verify identity → classify intent and risk → fetch policy and live facts → draft or propose → policy gate → answer, approval or handoff → audit and learn
Who does what
- Rules or a small model: route.
- LLM: drafts.
- Bounded planner: only for multi-system cases.
- Deterministic gateway: checks
- Identity assurance
- Action allowlist
- Scope
- Value (threshold)
- Freshness
- Need for human review
Five Rules
- Verify identity before any account data or account tool.
- Confidence is not permission. The gateway checks allowlist, threshold, freshness and approval.
- Systems of record stay the truth: billing, orders, CRM and identity.
- Every write is idempotent. Reconcile an uncertain side effect before any retry.
- Optimise safe resolution, not raw deflection.
Default Action per Case Type
| Case | Default |
|---|---|
| FAQ | Approved, versioned evidence or safe cache. Queue if evidence is weak. |
| Order status | Verify identity if needed, then a live order lookup |
| Refund, address or payment change | Live facts + assurance + gateway. Human approval over threshold. |
| Legal, safety or conflicting evidence | Human handoff |
| Identity failure | No account tools |
| Timeout after a possible side effect | Pending reconciliation. Never blind retry. |
State: The Three Records
- Case: versioned, so stale writes fail instead of overwriting humans.
- ProposedAction: keeps the immutable outcome.
- Handoff carries:
- Original message
- Identity status
- Intent and risk
- Evidence
- Policy checks
- Tool outputs and errors
- Attempted actions
- Why automation stopped
Numbers to Remember
| Item | Value |
|---|---|
| Tickets | 2M / month ≈ 67,000 / day |
| Peak load | 100 QPS |
| Languages | 20 |
| Model calls | ≈ 4.2M / month |
| Retrieval calls | 2.2M–2.4M / month |
| p95 latency by risk | 3 s routine · 8 s ambiguous · 15 s high-risk handoff |
| High-risk decisions | Made by humans |
NetValue formula:
NetValue = time saved − model and retrieval cost − wrong-resolution cost − recontact cost
Failures to Rehearse
| Failure | Response |
|---|---|
| Wrong policy answer | Stop delivery → keep evidence and versions → hand off → add a regression case |
| Billing lookup times out | Block the action → hand off with the missing-fact reason |
| Refund call times out | Check the action record or ledger before doing anything again |
| Model or language-route outage | Narrow safe path, or the human queue |
Release
Go / no-go gate
- Stable retrieval
- Representative QA sample approved
- Correct fallback behaviour
- Complete logging
- Rollback exercised
Metrics to track
- Safe automation rate
- Incorrect resolutions
- First-contact resolution
- Repeat contact
- CSAT
- p95 latency
- Cost per resolved case
Rollout sequence
agent-assist → narrow reversible intents → one tool class at a time → canary and sampling → kill switch per intent and tool
Variants (each changes one thing)
| Variant | What it adds |
|---|---|
| Multi-tenant | A tenant predicate on every retrieval and tool call. Gated on zero ACL red-team violations. |
| ServiceNow / ITSM | Priority and assignment using approved KB and CMDB context. Config changes go through the existing ITIL process. |
| Complex agent | A planner, used only for multi-system requests |
Cost Control
measure by intent → route by risk → bound calls, steps, tokens and retrieval → cache safe FAQ traffic
- Keep account facts live. Never cache them.
Interviewer Triggers: Short Answers
| Asked | Say |
|---|---|
| Why not a general chatbot? | It must decide whether to answer, approve, act or hand off. |
| The model is confident. | Confidence helps routing. It never overrides policy or missing facts, and the gateway still enforces permission. |
| Duplicate refund? | Idempotency, immutable action record, ledger reconciliation after a timeout. |
| Why a human? How does takeover work? | A structured handoff carries evidence, attempted actions and the stop reason. |
| What to automate first? | High-volume, low-harm, stable, reversible intents. |
| What proves success? | Safe automation and customer outcomes, not deflection alone. |
| They want 80% autonomy. | Define resolved-without-recontact first. Expand only where intent-level safety holds. |
| Costs spiked. | Measure by intent, route by risk, bound the work, cache safe FAQ answers. |
Flashcard drill
Final Mental Model
verify → classify risk → fetch authoritative facts → draft → policy gate → answer, approve or hand off → audit and learn
Closing line: "Reduce handling time without increasing harmful mistakes, and prove it with a gated rollout and customer outcomes."
Where next
- Practise this as a worksheet
- Customer Support Automation
- Revise the concepts