Published · 1 min read
When the right bot has no model in it
Nexus answers WhatsApp messages for small businesses. The obvious build is a language model behind every message. Many of those businesses need something else: “press 1 for hours, 2 for prices, 3 for a person”, working every time and costing nothing per message.
Two modules behind one webhook
Each connected number runs exactly one of two modules, chosen in its settings. Both receive messages from the same signed webhook and write to the same client and conversation tables, so the owner's dashboard looks the same either way and switching is a setting, not a migration.
The deterministic one
The flow engine keeps each client's position in a menu tree. It compares the reply with the current menu's triggers, answers with text, a file or a submenu, and goes back to the main menu after a final answer. When the reply matches nothing, it does not improvise: it repeats the options.
const match = await findOptionByTrigger(currentMenuId, messageText);
if (!match) {
const reply = `Sorry, I didn't get that. Please choose one of the options below:\n\n${formatMenu(
menuData.menu,
menuData.options,
)}`;
await addMessage(clientId, 'agent', reply, 'flow');
await updateClient(clientId, { lastContactAt: new Date() });
await sendWhatsAppMessage(channel!.phoneNumberId!, client!.whatsappNumber, reply);
return;
}There is no model call anywhere on this path, so its cost per message is zero and its behavior is the same on the thousandth message as on the first.
The one with a model, and its exit
In the other module a dispatcher classifies each message's intent and routes it to a sales, support, retention or content agent. The classification includes a confidence. Below 0.55, or when the message is angry or urgent, the dispatcher does not guess: it sends a holding reply and raises the conversation to the owner.
const CONFIDENCE_THRESHOLD = 0.55;
// ...
const classification = await classify(messageText, recentContext);
if (classification.confidence < CONFIDENCE_THRESHOLD || classification.intent === 'human_escalation') {
const event = await recordEvent({
channelId,
clientId,
agentType: 'dispatcher',
eventType: 'escalation',
summary: `Low-confidence classification (${Math.round(classification.confidence * 100)}%): ${classification.reasoning}`,
});
// ...
return { escalated: true, reply: HOLDING_REPLY, classification };
}The retention agent follows the same rule in the other direction. It drafts outreach to clients at risk, and the owner approves before anything is sent.
Limits
- The live event feed uses an in-process publish and subscribe, which does not scale across several server instances.
- There are no automated tests yet.
- Connecting a real number requires the owner to set up a Meta app and WhatsApp Business.