@devicai/ui, an inbox, Slack, Microsoft Teams and WhatsApp. It keeps the same instructions, tools, knowledge and memory on every one. You do not build a conversation engine per channel, and you do not host an adapter for any of them: the four messaging channels are native.
What makes it one assistant for one customer rather than six disconnected bots is attribution. Every message, whichever way it arrived, is attributed to the same three identifiers.
The three identifiers
tenantId and subtenantId describe who. chatUid describes which conversation. Keep them apart: the who is what carries across channels; the conversation usually does not.
Who sets them
On the API and the widget, you do. Your backend sends them with each message, and in a browser a tenant session proves them instead of trusting what the page says. On a channel, nobody sends them: the message comes from Slack, Meta or a mail server. Devic works them out from who wrote, in this order:- The directory. If the workspace, organisation, number or address was mapped to one of your tenants, through a link or by hand, that mapping wins.
- The platform’s own ids, when nothing has been mapped yet.
Once a channel is mapped to a tenant, the person writing is attributed like this:
- WhatsApp and email links can name the person (
subtenantId) directly. - Slack and Teams links map a whole workspace or organisation. Each person in it is then matched to one of that tenant’s existing subtenants by email, when their profile email equals one Devic already has for that tenant. The match never looks outside the tenant.
The tenant never comes from the model or from the text of a message. It comes from a link you issued, a mapping you made, or the API key and tenant session of the call.
What carries across channels, and what does not
Shared, through tenantId and subtenantId
Memory: with the default scope, one memory per tenant and subtenant, whichever channel wrote it.Costs, usage and limits: one tenant’s consumption, wherever it came from.Conversations: every channel’s chats are listed and filtered by the same tenant and subtenant.
Kept per channel
The conversation itself. A WhatsApp chat and a widget chat are two conversations, each with its own history. The assistant knows on which channel each message arrived.Delivery rules, such as WhatsApp’s 24-hour window or replying in a Slack thread.
tenantId and subtenantId.
Use the
subtenant or tenant memory scope for cross-channel memory. The user owner relies on a signed-in Devic user; runs started by an inbound channel fall back to the assistant’s own bucket.Making one person the same person everywhere
The rule is simple: choose the id your own product already uses for each user, use it assubtenantId in the API and the widget, and attach each channel to it.
Verified link between a phone number and your user
This is the question every WhatsApp integration has to solve: how do I know this phone belongs to user 42 of my SaaS? Devic solves it without SMS codes or your own verification flow.1
Your product issues the link, for the signed-in user
From your backend, with the user’s ids. The link is shown only inside your authenticated product, so only that user sees it.The response contains a
url (a hosted page with a QR code), a waUrl (a click-to-chat link with the code already written), the joinCode on its own, and the invite id. The link and the code are returned once: only their hashes are stored.2
The user sends the message from their phone
Show the page, or
waUrl as a button on mobile. Sending the message is the proof: only the phone that sends the code gets bound. The code is single-use, works only on that number, and expires. It is removed from the text before the assistant reads it.3
Every later message is attributed
That contact now resolves to
acme / user-42: the same tenant, person and memory as in your widget.maxBindings(1 by default) caps how many phones one link may bind.requireApprovalholds each new binding until someone approves it in the console.- A WhatsApp binding can refuse unknown contacts: anyone not mapped gets one fixed sentence and no run starts.
Overriding the defaults
Each channel binding exposes the templates that compute these values (chatUidTemplate, tenantIdTemplate, subtenantIdTemplate, userNameTemplate and messageTemplate) under its receiving settings. A template written by hand takes precedence over the directory, so only override when you need something other than the mapping. An empty template means use the default, not none.
Related
Channels
Setting up email, Slack, Teams and WhatsApp, and issuing links.
Channels API
Issue links and list mapped identities from your backend.
Tenant sessions
Proving the tenant and subtenant in the browser.
Memory buckets
How memory is partitioned by tenant and subtenant.