Multilingual Email Orchestration

Hospitality · 2020-Present

PublicRepresentative · synthetic data
ingestcleantriagespam / OOOlanguagelid.176productbge-m3issue+ churn flagenrichbackend factsdraftwriterQCcheckerrouteto agentmetered · LLMdeterministic · $0
Live diagram - the 9-stage pipeline. Only draft and QC are metered LLM calls; language and classification run on local models at $0.
ingest$0triage$0language$0product$0issue$0enrich$0$draftmetered$QCmeteredroute$0COST LEVER · triage filter
Live diagram - spend accrues only on draft and QC; triage and enrichment-grounding constrain or stop a case before generation.
ASPECTCLOUD · capable readOSS · recordedDraft fluency (DE/NL)natural phrasingstiffer but correctDraft tonewarm, on-policyflatterQC claim-checkcalibratedmore conservativeFR refund-nuance replydraftednot captured - routed to a human
Live diagram - Cloud (claude-haiku-4-5) vs recorded OSS (Qwen3-8B) on draft + QC; the deterministic grounding rule holds in both modes.

One pipeline, nine stages

A single orchestration pipeline runs end to end, each stage a pure typed function emitting the uniform trace row: ingest + clean → triage pre-filter → language detect → product classify → issue classify → fact enrichment → draft assembly → QC / verify → route to agent. Language detection and the product/issue classifiers are small local models; triage, enrichment and routing are deterministic; only draft and QC call a hosted LLM.

The design is deliberately layered so the cheap stages do most of the work. Triage ends spam and bounces before any model runs; the local classifiers route for free; enrichment grounds the draft in real looked-up facts so the writer has something true to say. The draft's grounding rule and the QC claim-check are the guardrails that keep fluency from turning into fabrication.

The cost story and the cost lever

Only two stages ever cost money: draft and QC. Everything else is deterministic or runs on local open-source models in both modes, so the cost meter only moves in Cloud mode, and only on those two stages.

The cost lever is the triage pre-filter together with enrichment-grounding. A spam or out-of-office message is dropped before generation; a case with no resolvable facts is constrained or routed rather than drafted from nothing. This is the honest downscale of "lightweight for most, heavy only when needed" - not a hidden routing model, but free deterministic and local stages plus a filter that refuses to pay to answer a non-question.

Dual approach - cloud vs on-prem OSS

The two metered stages run one of two ways. Cloud uses a hosted model (claude-haiku-4-5) for both the writer and checker roles, cost-capped and fail-closed - at the budget cap it falls back to the $0 OSS path. OSS uses a self-hosted open model (Qwen3-8B) recorded on local M4 hardware and replayed at $0, with the language and classification models running locally in both modes.

The honest finding, shown as recorded divergences in the inspector: the cloud model writes more natural, on-tone replies - especially in Dutch and German - while the smaller open model is correct but stiffer, and its QC tends to be more conservative, flagging more for human review. The deterministic grounding rule holds identically in both modes, so neither path invents facts. One divergence pair is shown as "not captured" rather than fabricating an OSS draft.

Out of scope (the real system)

Several production capabilities are deliberately excluded and represented honestly. Real CRM and order-system integration is stood in for by a simulated, labelled enrichment lookup. Real email send is simulated - there is no real-send flag - and unattended auto-send is represented by a staged-automation governance model that always keeps a human in the loop and pins sensitive issue types to manual. Specialized fine-tuned production classifiers are downscaled to a local nearest-label classifier plus a compact language detector. Multi-tier model routing is downscaled to one cloud model plus the recorded OSS model. The multilingual surface is six languages with labelled mock translation, the product breadth is five synthetic neutral lines, and the corpus is a small synthetic set rather than thousands of emails a day. Model retraining is represented by the audit log, owner overlay, feedback capture and regenerate-with-feedback - not live learning.