Groups and participants

Direct and group conversations, the four roles, how members join, leave and are removed, how agents join a group, and when an agent answers.

A conversation is either direct or group. A direct conversation is between one person and one agent. A group conversation has several people and any number of agents, and the rules for who may do what are the same for everyone in it.

Creating a conversation

robotelos.create_conversation takes a kind and an optional list of agents:

  • "direct": the agents listed (usually one) always answer every message.
  • "group": zero or more agents. The creator becomes the owner. Agents in a group answer only when they are mentioned.

Only group conversations change their participants after creation.

Roles

RoleCan readCan speakCan invite or removeNotes
owneryesyesyesThe creator, and anyone an owner promotes. The last owner cannot leave or be demoted.
memberyesyesnoJoins by accepting an invitation.
guestyesyesnoGuests can read and speak, like members.
observeryesnonoReads only. An observer’s messages are refused.

Agents are participants with the role participant. An agent belongs to the owner who added it, so it leaves with that owner.

Membership: invite, join, leave

All membership changes use one command, robotelos.update_participant. Its content has a membership field:

MembershipWhoWhat happens
invitean ownerInvites a member (the target) with an optional role. The invitee sees the invitation but cannot read or speak yet.
jointhe invitee, for themselfAccepts the invitation and gains the invited role.
joinan ownerAdds an agent with agent_id, or changes the role of a member who already joined (role).
leaveanyone, for themselfLeaves.
leavean ownerRemoves another participant.

A removed participant stops receiving events: its stream ends with resnapshot_required, and a new subscribe says the conversation is unknown to it.

Agents in a group

An agent is added by an owner, through join with agent_id. Its replies are authored by the agent, not by the owner who added it, and the message names the agent and its version.

An agent answers only when it is mentioned. A message in a group names the participants it addresses in its mentions field. A mentioned agent replies; an agent that is not mentioned stays quiet. This keeps a group from filling with replies to every message. In a direct conversation the agent always answers, because there is nobody else to address.

A command and its receipt A client sends a command, the server appends events and returns a receipt, and subscribers receive the new events as frames. Client Server Subscriber append events n+1…n+k command · submit_message receipt: ACCEPTED frames after cursor n frames (same events)
The same command and frame flow applies to a group. Only mentioned agents receive a turn, so only they add events after the message.

What a participant sees

Every participant sees the same events, except where a role limits what it may do. An observer sees everything a member sees. A participant that is removed sees nothing more.

Every participant has a kind (member, agent, party or system) in the conversation state. By design, external identifiers such as a phone number are kept out of conversation events; the participant state shows only the channel and the verification level.

Rules worth knowing

  • The last owner of a group cannot leave or be demoted, so a group never loses all control.
  • An agent leaves with its owner. Removing an owner removes the agents they added.
  • The same rules apply on every transport and on PostgreSQL. These rules are covered by automated tests on every transport.

For the multi-device behavior of these roles, read Multiple clients. The command fields are in the command reference.

Next steps