Overview
Contacts are the core identity layer in Ravi. Every person or group that interacts with your agents is tracked as a contact, with one or more identities (phone numbers, WhatsApp LIDs, Telegram IDs, etc.) linked to a single record. Contacts control who can message your agents, how messages are routed, and what level of access each person has.Contact Lifecycle
Every contact follows a status lifecycle:
The typical flow is:
- Discovered contacts are created automatically when Ravi encounters group members it hasn’t seen before. They have
source: "discovered". - Pending contacts are created when someone sends a message and Ravi doesn’t have them as allowed. They have
source: "inbound". - Manually added contacts skip directly to
allowedwithsource: "manual".
Multi-Identity System
A single contact can have multiple identities across platforms. This allows Ravi to recognize the same person whether they message from a phone number, a WhatsApp LID, or a group.Supported Platforms
Managing Identities
Add an identity to link a new platform to an existing contact:Auto-Linking
When Ravi detects that a phone number and a WhatsApp LID belong to the same person (e.g., from message metadata), it automatically links them. If both exist as separate contacts, Ravi merges them — keeping the contact with the higher-priority status (allowed > pending > discovered > blocked).
Viewing Identities
Useinfo to see all identities for a contact:
Contact Properties
Each contact has the following fields:Setting Properties
- to clear a field:
Reply Modes
Each contact has a reply mode that controls when the agent responds:
This is particularly useful for groups where you don’t want the agent to respond to every message:
Approval Workflow
When a new contact messages your bot and is not yet registered, Ravi creates them aspending. You can review and approve pending contacts:
List Pending Contacts
- Global pending: Contacts awaiting approval across all accounts
- Account pending: Contacts that messaged a specific account but no route matched
Approve a Contact
Block a Contact
Allow a Previously Blocked Contact
Tags and Search
Tags are arbitrary string labels attached to contacts. They are used for filtering, grouping, and REBAC-based contact scoping.Adding and Removing Tags
Group-Specific Tags
You can assign per-group tags to a contact. This lets you label someone differently in each group they belong to (e.g., “manager” in one group, “observer” in another):notes.groupTags object.
Searching
Agent Assignment and Contact Scoping
Restricting Contacts to Agents
Useallowed_agents to restrict which agents can interact with a contact. When set, only the listed agents will receive messages from that contact:
Contact Scoping via REBAC
Agents have scoped visibility into the contacts database, controlled by REBAC permissions:
Configure with:
Routing Priority
When a message arrives, the agent is resolved in this order:contact.allowed_agents— if set, only these agents receive the message- Route match via
ravi instances routes— pattern-based routing - Account-agent mapping — from
ravi whatsapp connect --agent - Default agent — fallback
Merging Duplicate Contacts
When the same person exists as two separate contacts (e.g., one created from a phone number and another from a WhatsApp LID), you can merge them:- Moves all identities from the source contact to the target
- Fills in blank fields on the target (name, email) from the source
- Merges tags and notes if the target has none
- Sums interaction counts
- Deletes the source contact