GOGOGOLLC
Back to Blog
Agents7 min read

Classifying WhatsApp HR messages with a router agent.

Our biggest win on GoPeople wasn’t a smarter answer; it was a smarter router. We split intent classification from response so each agent stays cheap and inspectable.

GT

GoPeople team

WhatsApp HR

Classifying WhatsApp HR messages with a router agent.

When we launched GoPeople we built one big agent that read the message, figured out what the employee wanted, and answered it. It was clever. It was also expensive, slow, and impossible to audit. Splitting that one agent into a cheap router and a small zoo of workflow agents gave us back the latency budget, and it gave HR an actual log of what we did.

One brain is too many brains

The all-in-one agent was using a top-tier model on every turn, even for messages like ‘yes’ or ‘bana izin günü kaldı mı?’. It was also conflating two completely different jobs: deciding what kind of request this is, and serving that request. Those want different prompts, different tools, and very different cost profiles.

The router agent

Our router agent is a small, fast model that does one thing: classify the message into one of N intents. It returns a label and a confidence. If confidence is below a threshold, the orchestrator escalates to a clarification agent, never to a workflow agent. Workflow agents only ever see classified intents.

ts
// Router output is a value, not a sentence.
type Intent =
  | "leave.request"
  | "leave.balance"
  | "payroll.payslip"
  | "doc.request"
  | "policy.lookup"
  | "smalltalk"
  | "unknown";

const { intent, confidence } = await router.classify(message);
if (confidence < 0.6) return clarify(message);
return workflow[intent].run(message, ctx);

Why this routing pattern wins

  • The router is cheap. We can afford to call it on every message, even ‘ok’.
  • The workflow agents are dumber. They don’t need to second-guess intent; that decision is upstream.
  • Clarification has its own agent. We don’t pollute leave-request prompts with ‘maybe ask the user what they meant.’
  • Auditing is trivial. The audit log shows the intent, not just the reply, so HR knows what the system thought we were doing.

Multi-tenancy at the router

Holdings often run multiple sub-companies under one WhatsApp number. The first decision the router makes isn’t intent; it’s tenant. We classify the employee against the directory before we run the intent classifier. That way each sub-company’s policies, leave balances, and payroll lookups are isolated by construction.

What we measured

After moving to the router pattern, our average cost per message dropped by ~3.4x, and HR auto-classification rate climbed past 94%. Edge cases still escalate to a human, but the human now sees the system’s best guess; they’re reviewing, not re-doing.

What the router routes to

Behind the router sit GoPeople’s modules, each a workflow an employee can start from WhatsApp: leave (annual, excused and sick leave, with automatic balance calculation and a calendar that checks for clashes), announcements, surveys, celebrations, documents, equipment, transport, and complaints and suggestions. Photos sent on WhatsApp, for example one attached to a complaint, are analysed with AI as well. The assistant also offers a menu and keywords, so an employee who would rather tap than type reaches the same workflow.

A person makes the decision

Classification decides where a request goes, never what the answer is. A leave request lands in the leave screen with the employee’s department; an authorised manager or HR approves or rejects it in the panel; the leave is written to the calendar and the employee gets the result on WhatsApp. Every request and every approval is recorded, which is what makes the audit log described above worth having.

Where the data lives

For holdings, the same panel holds the whole structure: holding, parent company and subsidiaries, with one login, one-click switching between companies, permissions set per level and consolidated reports. That is the structure the router’s first decision, the tenant, maps onto.

HR messages carry personal data, so the plumbing matters as much as the prompts. GoPeople runs on SOC 2 Type II audited infrastructure (Railway for hosting, Supabase for the database). Connections are encrypted over HTTPS (TLS 1.2 and 1.3), the database is stored with the hosting provider’s storage encryption, access is role-based, data is kept in European data centres, traffic passes through Cloudflare for DDoS protection, and backups are automatic. A company that wants the data on its own servers can self-host GoPeople instead. Service status and measured availability are published on a public status page, and the KVKK notice on gopeople.io sets out what is processed and why.

“The biggest model isn’t a router. The smallest, cheapest, fastest model is the router.”

Want this for your business?

Tell us the workflow you'd build first. We'll come back with a 4-phase plan and the agents that fit.