Global Support Automation Scenario: Cut the Options, Route Each Ticket by Risk, Gate Every Change by Language
A global retailer's support desk faces many languages, sale-day spikes and costly refunds. Cut four designs to two, pick triage lanes with grounded drafts, route five tickets by risk, and watch a cheaper translation step get blocked because Japanese scores 0.33 while the average says 0.83.
What you will learn
- Cut support-desk architectures on four hard constraints and rank the survivors on cost and quality
- Route each ticket to auto, approve or human by confidence, reversibility and amount
- Gate every proposed change on its weakest language, not on the average
- Name the monitoring gap an average hides and the per-language monitor that closes it
Before you start
- Working an architecture scenario: hard and soft constraints
- A RAG bot release gate per slice
A support desk that serves the world has three problems at once: many languages, sudden spikes, and refunds that cost real money. This lesson works one scenario in three moves: cut the options using the constraints, route each ticket by risk, and gate every proposed change.
The method is the one from working a full scenario. The project is plain Python and calls no model; it's the reasoning an architect does on paper. All scores, amounts, golden-set grades and cost shares are scenario data, not measurements.
Mark every sentence
A global retailer. The ask: choose the architecture for the support desk.
| Sentence | Kind | Stage |
|---|---|---|
| Data of EU customers must stay in the EU (C1) | Hard | Processing |
| Refunds over the limit always need a person's approval (C2) | Hard | Output |
| Every policy claim has to come from current documents (C3) | Hard | Processing |
| Customers must get a reply in their own language (C4) | Hard | Output |
| Sale days bring spikes, so cost per ticket should fall | Soft | Processing |
| Support leads would like a weekly quality review | Soft | Feedback |
Cut first, then rank
Four options. choose.py cuts and ranks them exactly as before. The recorded output:
ask: Choose the architecture for the global support desk.
constraints: 4 hard | 2 soft
A One big agent, every tool, every ticket | cut: breaks C2, C3
B Triage lanes, grounded drafts, people for risk | kept | soft score 2
C Keyword FAQ bot, English replies | cut: breaks C4
D Large model on every ticket, all replies read | kept | soft score 6
chosen: B | beats D on the soft constraints
stage check: C1 processing | C2 output | C3 processing | C4 output
every hard constraint covered: True
A has a refund tool with no approval and answers from memory, so it breaks C2 and C3. C answers only in English and breaks C4. B scores 2 and D scores 6; lower wins. On the soft side, A would score 5 and C would score 3. They're still out: a good soft score never rescues a broken hard constraint.
B is chosen, and you say what it gives up: people stay in the loop for risk.
Then check B end to end. Input holds the triage lanes. Processing holds EU hosting and grounded drafts from current documents. Output holds the approval lane for large refunds and the reply in the customer's language. Feedback holds the eval gate, which checks every language on every change. The router guards the front door. The gate guards every later change.
Route each ticket: routing.py
Think of a hospital emergency desk. A nurse triages at the door by how sure the symptoms are and how risky the case is. Minor cases go home with a plaster; no doctor needed. A risky case sees a doctor who signs it off. Nobody sends every patient to a doctor, and nobody sends a risky case home.
"""Route a ticket: auto, approve or human."""
CONFIDENCE_FLOOR = 0.60
REFUND_LIMIT = 100
def route(ticket):
if ticket["confidence"] < CONFIDENCE_FLOOR:
return "human"
risky = not ticket["reversible"]
over = ticket["amount"] > REFUND_LIMIT
if risky or over:
return "approve"
return "auto"
Below the confidence floor, a person takes over. If the action can't be undone or the amount is over the refund limit, a person approves. Everything else is auto. desk.py routes five tickets:
T1 de | confidence 0.93 | auto
T2 fr | confidence 0.90 | auto
T3 ja | confidence 0.88 | approve
T4 es | confidence 0.91 | approve
T5 en | confidence 0.42 | human
lanes: auto 2 | approve 2 | human 1
T3 is a large refund and T4 closes an account, so both wait for approval even though triage is sure. T5 is a legal complaint and triage is unsure at 0.42, so a person takes over.
Gate every change: gate.py
A desk doesn't stay still. People propose changes: a smaller model here, a cheaper step there. The gate decides whether a change may ship. It scores each language separately on a small golden set.
"""Eval gate: ship only if every check passes."""
LANGUAGE_FLOOR = 0.66
def per_language(change):
out = {}
for lang, grades in change["grades"].items():
out[lang] = grades.count("g") / len(grades)
return out
def gate(change):
marks = change["grades"].values()
unsafe = sum(g.count("!") for g in marks)
if unsafe:
return "BLOCK", f"{unsafe} unsafe reply"
rates = per_language(change)
lang = min(rates, key=rates.get)
rate = rates[lang]
if rate < LANGUAGE_FLOOR:
return "BLOCK", f"language {lang}"
if change["cost"] > 1.0:
return "REVIEW", "cost"
return "SHIP", "all pass"
In the golden set, g means grounded and correct, . means not grounded, and ! means an unsafe reply. One unsafe reply blocks a change. Then the weakest language must hold the floor. A change that costs more than today's desk (cost above 1.0) goes to review. Only then does it ship.
smaller model on the FAQ lane | avg 0.92 | low ja 0.67 | 0.6x | SHIP: all pass
cheaper translation step | avg 0.83 | low ja 0.33 | 0.7x | BLOCK: language ja
skip the grounding check | avg 0.92 | low es 0.67 | 0.5x | BLOCK: 1 unsafe reply
largest model on every ticket | avg 1.00 | low de 1.00 | 1.8x | REVIEW: cost
- The smaller model on the FAQ lane ships: its weakest language, Japanese, is at 0.67, just above the floor.
- The cheaper translation step is blocked by Japanese at 0.33.
- Skipping the grounding check is blocked by one unsafe reply, even though it's the cheapest at 0.5x.
- The largest model on every ticket is perfect on quality, but at 1.8x the cost it goes to review.
The average hides the weak language
German, French and Spanish all score 1. Japanese scores 0.33. The average is 0.83, and a rule on the average would ship it. The gate blocks it because of Japanese.
The same blind spot exists after release. If production monitoring only watches the overall average, Japanese can slip and nobody sees it until users do. The monitor that closes this gap is live quality split by language. Gate on the weakest slice, and watch it in production too. The release-gate side of this idea, for a RAG bot, is covered in a release gate per slice.
The trap: the largest, the cheapest, the average
A scenario names its constraints, and three answers are tempting: the largest model for every ticket, the lowest cost per ticket whatever else it breaks, and trusting the average score even when one language fails. None of them respects the whole scenario.
The decision rule: cut, route, then gate, on the hard constraints and on the weakest slice. The best answer meets every hard constraint, then wins on cost, quality and risk. For a regulated version of the same routing and gating, see the regulated dispute desk.
Try it yourself
Raise LANGUAGE_FLOOR to 0.7 and predict which change flips from SHIP to BLOCK. Then add a sixth ticket: a reversible refund of 80 at confidence 0.65, and route it in your head before you run it. The project files for this lesson are in the community, free to join.
Recap
| Move | Rule | In the run |
|---|---|---|
| Cut | Break one hard constraint and the option is out | A and C cut, B chosen over D |
| Route | Confidence floor, then reversibility and amount | auto 2, approve 2, human 1 |
| Gate | No unsafe reply, weakest language above the floor, cost reviewed | 1 ship, 2 block, 1 review |
| Monitor | Live quality split by language | Catches the slipping slice an average hides |
Hard constraints pick the design. Risk picks the lane. The weakest language picks the release.
Related course on Udemy
Claude Certified Architect - Professional (CCAR-P) Exam Prep
Architecting with Claude: design, models, context, integration, evals, governance and stakeholders.View on Udemy ↗: Claude Certified Architect - Professional (CCAR-P) Exam Prep (paid course, opens in a new tab)Related posts
The Claude Messages API: Your First Call, Field by Field
One request in, one Message out. The four fields of a Messages API call (model, max_tokens, system, messages), how to read content blocks, stop_reason and usage, and why every turn resends the history.
Claude Tool Use: How tool_use and tool_result Work in the Messages API
Follow one order question through Claude's tool round trip: define a tool, read the tool_use block, run your own function and send a matching tool_result back, including parallel calls and is_error.
Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared
Every Claude client SDK wraps the same REST request: a POST to /v1/messages with a JSON body. See it built by hand, through the Python and TypeScript SDKs, as typed errors, and as async calls that wait together.
Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move
Configure the Anthropic SDK client (timeout, max_retries, with_options, async, pagination), see which errors it retries by itself, then repair a retry wrapper so a 429, a 529, a 400 and a timeout each get the move the docs support.
