Data model
For adapter authors
Conversations
A conversation has a kind:
| Kind | Participants | Agents answer |
|---|---|---|
direct | One person and the agents named at creation | Always |
group | Any number of people and agents | Only when mentioned |
The creator is the owner. Only group conversations change their participants after creation. See Groups and participants for the behavior.
Participants
A participant has a kind, a role and a membership.
| Field | Values | Notes |
|---|---|---|
kind | member, agent, party, system | party is reserved for external parties |
role | owner, member, guest, observer | Observers cannot send messages. Guests have the same limits as members today. |
membership | invite, join, leave | An invitee cannot read or speak until it joins |
display | string | A label for people in the conversation |
verification | unverified, channel-verified, authenticated | Recorded on the participant. |
Each participant is a state event keyed by its participant ID. An agent participant has an owner, and it leaves when its owner leaves.
Events
Every change to a conversation is an event. An event has a position in the journal, and a position is an integer that never skips.
| Event type | Kind | Content |
|---|---|---|
robotelos.conversation | state | Title and kind |
robotelos.participant | state | Participant kind, role, membership, display |
robotelos.message | timeline | Parts, mentions, and the agent that wrote it, when there is one |
robotelos.outcome | timeline | succeeded, failed or unknown, with parts and a robotelos.cause relation on failure |
robotelos.obligation | state | An approval request (Approvals) |
robotelos.surface | state | A rendering of an obligation |
A timeline event is never replaced. A state event is replaced by the next event with the same type and state_key. A client that applies events in order gets the same result as a server that applies them in order.
The view
A view is the conversation reduced to:
- the current state, as a map from (type, state key) to the latest state event;
- the timeline, as the ordered list of timeline events;
- the cursor of the last event applied.
A view is built from a snapshot and then extended with frames (Delivery). Two views with the same cursor are equal. A client MUST NOT modify a view except by applying events from the server.
Relations
An event MAY carry relations to other events. Version 1 defines:
rel_type | Meaning |
|---|---|
robotelos.reply | This event answers the event it names |
robotelos.cause | This event was caused by the event it names |
A server MUST NOT send more relations on one event than max_relations.
Identifiers in events
Events carry participant IDs, never personal contact details. An external identifier such as a phone number or a messaging-app ID is kept in the account’s party directory, not in conversation events. Participants see a display name. Events contain only participant IDs and display names.
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.