Skip to main content

What is an agent?

An agent is an LLM-powered processor that takes an inbound WhatsApp message and returns structured actions — predictable JSON your backend can parse and execute. No free-text, no guessing.
Agents are domain-specific — one agent handles hotel requests, another handles customer support, another handles logistics. WhatsRB routes each message to the right agent automatically.

Inbound message flow

Every inbound message goes through this pipeline:
2 LLM calls per message. Cost: ~$0.0004 with gpt-4o-mini.

Interactive Flow Diagram

See the full inbound pipeline with conversation context loop, human takeover check, and early exit points.
PreFilterRules catches spam, greetings, and irrelevant messages before any LLM call — saving tokens on messages that don’t need AI processing.

Configuring an agent

Key features

Allowed Actions

Constrain which action types the agent can return. Schema-level enum guarantee — the LLM cannot output a type outside your list.

Structured Fields

Define typed fields (text, number, date, boolean) the AI must fill in every action payload. Predictable, parseable output.

Conversation Context

Agents remember previous exchanges for the same phone number. Follow-up messages like “medium ones” are understood in context.

Human Takeover

Pause the agent per-conversation when a human needs to respond. Auto-expires, auto-extends on outbound messages.

Action Confirmation

Require human approval before executing AI-proposed actions. Accept or reject each action individually via widget or API.

Output structure

Every agent run produces a standardized output via the propose_actions tool:

Webhook delivery

When an agent run completes, WhatsRB sends an agent_run.completed webhook to your endpoint:
Your backend handles the actions — WhatsRB stays decoupled from your business logic.