Skip to main content
By the end of this page, a dedicated WhatsApp number is linked to Ravi, the agent main answers you in a direct message and in a group, strangers cannot reach it, and you are the owner with full permissions. Slack is the recommended channel (Connect Slack). Use WhatsApp when the people you work with live there.
WhatsApp runs through Omni, a separate service that ravi setup installs. Omni holds the WhatsApp session as a linked device and runs the NATS server Ravi uses (omni-nats) plus an API (omni-api). A native WhatsApp channel without Omni is planned work and is not in this release.
In the commands below, wa-main is the instance (Ravi’s record of the number), main is the agent, and 5511987654321 stands for your personal number: country code, area code and number, digits only, no + or spaces.
1

Check what you need

  • A dedicated number with WhatsApp or WhatsApp Business active on a phone. Ravi links to it as a linked device, so the phone keeps the number.
  • A second number to talk from. Messages sent from the connected number count as the agent’s own and never start a turn. You write to the agent from your personal number.
  • Ravi installed and answering in the terminal. Follow Install Ravi, then confirm:
    If this fails, fix the provider first. WhatsApp will not work until this does.
  • Omni running. ravi daemon status lists omni-nats and omni-api as online.
If Omni is missing, install it and restart the daemon. Ravi looks for Omni only when the daemon starts, so restart it after every Omni install or reconfiguration:
Omni stores its data in PostgreSQL. omni install uses a local pgserve (autopg) server when one is on your PATH and prints how to install it when it is not. To use a database you already run, pass it explicitly: omni install --database-url postgresql://user:pass@host:5432/omni.
2

Link the number

With the daemon running:
On the phone with the dedicated number, open WhatsApp, go to Settings > Linked devices > Link a device, and scan the latest code in your terminal. The command ends with ✓ Connected as <profile name>.
  • It waits up to 120 seconds. On Timed out waiting for instance connection., run it again.
  • connect creates the instance in Omni and in Ravi. Do not run ravi instances create first.
  • If the agent in --agent does not exist, connect creates it, so check the spelling.
  • In scripts, --json returns at the first QR ("status": "qr_required") and does not wait for the scan. Check the result later with ravi instances status wa-main.
3

Lock who can reach the agent

Every ravi instances connect resets the instance’s policies to open for DMs and groups. That includes a re-pairing after WhatsApp logs the device out. Run these two commands right after every connect.
In the status output, check that Connected is true, Agent is main, DM Policy is pairing and Group Policy is allowlist.
  • pairing: only contacts with status allowed reach the agent in DMs. Everyone else is saved for your review.
  • allowlist: only groups you approved (an explicit route) reach the agent. Other groups are saved for review.
With open, anyone who messages the number, and any group someone adds it to, reaches the agent. The WhatsApp policy questions in ravi setup do not configure instances. Policies are also what makes ravi contacts block work: under open, a blocked contact still reaches the agent. Change an existing instance with ravi instances set; re-running ravi instances create on it wipes its Omni id, agent and policies.
4

Make yourself the owner

  • full-access sets the agent’s ceiling: what any turn can do at most.
  • contacts add creates you with status allowed, so you pass pairing and your messages resolve to you. Without a contact, the agent still answers but runs with no tools. Do not pass --agent here: it restricts the contact to the listed agents.
  • permission-owner gives you admin:system:* and makes you the person who can approve requests in chat.
Make yourself the owner explains each layer. If you already did it there with this number, skip to the next step.
5

Test a DM

From your personal phone, send hi to the dedicated number. The agent replies within a few seconds. Then check from the terminal:
Ask the agent to run ravi agents list. If it says it cannot use tools, your number did not resolve to your contact.No reply? Look at the review queue:
Approving a contact only marks it allowed. If the daemon log says No route for message, saved as pending, the instance has no agent: run ravi instances set wa-main agent main.
6

Add a group

Create a group in WhatsApp with you and the dedicated number, then send a message in it. Under allowlist it waits for review:
pending list shows the group under Pending chats with its route pattern. Approving creates the route group:120363012345678901 → main. Send a new message after approving.You can also route a group directly. Find its id first:
Always pass --account wa-main to ravi whatsapp group. Without it, the command uses the first enabled instance in alphabetical order, which is slack-main if you also connected Slack.

How the agent behaves in groups

  • There is no mention gate. Every message in a routed group reaches the agent.
  • When a group has three or more known members, the agent is told to mostly stay silent and to answer when it is @mentioned or clearly useful. This is an instruction to the model, not a filter. In a group with only you and the number, it answers everything.
  • A contact’s reply mode (auto or mention) is stored but not enforced. Do not rely on it.
  • Debounce combines messages that arrive close together into one prompt:
  • Start a message with !! to record it without starting a turn, or with >> to deliver it when the current turn ends.

Optional: a group with other people

In a group without per-chat grants, every member whose number resolves to a contact gets the agent’s full ceiling. To keep tools to yourself, grant yourself a profile in that chat. The first grant makes the chat governed: other members keep chatting but get no tools until they receive their own grant.
Do not call this profile owner. ravi permissions allow owner maps to the tag permission-owner, which ravi contacts tag already created, and the command refuses to reuse it (is not provider-owned by permissions). Any other name, such as chat-admin, works.
Governed chats are not in ravi.bot@latest. See Permissions for grants, denials and approvals.

Smoke test

Troubleshooting

More in Troubleshooting and Instances and routing.

Risks of using a personal number

Use a dedicated number. If you link your personal number instead:
  • Every DM and group of that number reaches Ravi. Right after a connect the policies are open, so all your contacts get answers from the agent until you redo step 3.
  • You cannot talk to the agent from that number, because its messages count as the agent’s own.
  • If the number is also linked to Omni as another instance, Omni drops its messages to prevent loops.
  • Omni links through an unofficial WhatsApp client. WhatsApp can log the device out or ban the number.
  • Your contacts and chats are stored in Ravi’s database as messages arrive.
If you do it anyway, keep dmPolicy closed (or pairing) and groupPolicy allowlist, and check them after every connect.