Data model

Conversations, participants, events, state and timeline, and the view a client builds from them.

Conversations

A conversation has a kind:

KindParticipantsAgents answer
directOne person and the agents named at creationAlways
groupAny number of people and agentsOnly 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.

FieldValuesNotes
kindmember, agent, party, systemparty is reserved for external parties
roleowner, member, guest, observerObservers cannot send messages. Guests have the same limits as members today.
membershipinvite, join, leaveAn invitee cannot read or speak until it joins
displaystringA label for people in the conversation
verificationunverified, channel-verified, authenticatedRecorded 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 typeKindContent
robotelos.conversationstateTitle and kind
robotelos.participantstateParticipant kind, role, membership, display
robotelos.messagetimelineParts, mentions, and the agent that wrote it, when there is one
robotelos.outcometimelinesucceeded, failed or unknown, with parts and a robotelos.cause relation on failure
robotelos.obligationstateAn approval request (Approvals)
robotelos.surfacestateA 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_typeMeaning
robotelos.replyThis event answers the event it names
robotelos.causeThis 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