Multi-tenancy
A lead (person) can interact with multiple organizations on the platform. The same phone number can be a customer of Org A and unknown to Org B. Lead identity is global (one person = one Lead). All behavioral data is scoped per organization via LeadOrganization.| Data | Scope |
|---|---|
| Name, email, phone | Global — person identity |
| Channel identities | Global — ways to reach the person |
| Memories (purchases, interests) | Per org — bought from Org A, not from Org B |
| Events | Per org — Org A’s Stripe webhook |
| ML features | Per org — feature vector relative to that org’s context |
ChannelIdentity as sole source of resolution
ChannelIdentity is the sole source of identity resolution.Lead.phone and Lead.email are profile data — they are not used to resolve “who does this event belong to”.
When an event arrives (e.g., WhatsApp message from +5511999999999):
Data Model
Lead
The person. Exists exactly once regardless of how many organizations they interact with.email and phone are profile data. Identity resolution is done exclusively via ChannelIdentity.
ChannelIdentity
Lead’s identity on a channel. A lead can have N identities. Sole source of identity resolution.(channel, channel_identifier).
LeadOrganization
The relationship between a lead and an organization. All behavioral data hangs from this entity.(organization_id, lead_id).
Classifications like “is customer?”, “how engaged?”, “churn risk?” are multi-dimensional and live in features and memories, not as fixed fields. A lead can be a Whey customer and a Creatine prospect within the same org.