Problem
A bank replaced a vendor chat platform with its own. The new bot matched messages to scripted scenarios by exact key phrases. With real customers, the share of chats closed without an operator fell to 40%, against about 60% at the vendor, and contact-center queues formed at peak hours. Customers write with typos, slang and several questions per message, so string matching fails. An LLM was not an option: no free GPUs and no AI experts on the team.
Example from the article: "card was stolen what to do urgent" missed the base phrase "block card".
Solution in brief
A small multilingual encoder (MiniLM, int8 ONNX) on CPU embeds each message, and candidates are scored by cosine similarity plus Postgres full-text rank. Three zones decide: launch a scenario, show up to four clarification buttons, or hand over to an operator. The model only picks the scenario; answers and actions come from validated scenarios and deterministic code. Automation rose to about 75%.
Questions this case answers
- How to classify short noisy free-text messages into a few hundred predefined intents on CPU-only infrastructure, with answers that come only from validated content
- How to decide automatically between acting, asking a clarifying question and escalating to a human when the intent scores are close
- How to route free-text customer messages to the right scripted scenario when keyword matching resolves only 40% of chats and no GPU is available?
- How to choose between launching a scenario, asking the customer to clarify and handing over to an operator?
Tools and methods
- paraphrase-multilingual-MiniLM-L12-v2 (int8 ONNX) — message to a 384-dimensional vector on CPU.
- ONNX Runtime, Hugging Face tokenizers — inference without PyTorch.
- PostgreSQL full-text search — second signal against confident but false vector matches.
- Threshold zones, clarification buttons — launch, ask or escalate by score and gap.
- LLM as offline checker — audits answer accuracy, not in production.
Google or a one-time email code. No password.
