Conversations

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

A conversation is an ordered journal of events between participants. Clients do not write the journal directly. They send commands; the server accepts them, appends events, and streams the events to every subscribed client.

Participants

A participant is a person or an agent that takes part in a conversation. Each has an ID, an account it belongs to, and a display name. The server authenticates a bearer token to a principal, and the principal’s participant ID is the author of the commands it sends.

Agents are registered with the server by ID and version. A conversation names the agent it talks to when it is created.

Events

Every change to a conversation is an event with a position in the journal. Positions are contiguous: a client that has seen position n and then receives n+1 has missed nothing.

Event typeMeaning
robotelos.conversationThe conversation exists and names its agent
robotelos.participantA participant joined or was described
robotelos.messageA message from a participant or an agent. Agent replies carry a robotelos.reply relation to the message they answer
robotelos.outcomeThe result of an agent turn: succeeded or failed. A failure carries a robotelos.cause relation
robotelos.obligationA state event: something a participant must answer, such as an approval (Approvals)
robotelos.surfaceA state event: a rendered interface for an obligation, with a plain-text fallback

Timeline events (messages, outcomes) are kept in order. State events (obligations, surfaces) describe the current state of something and are replaced as they change.

The view

The server gives each client a view: the conversation’s state reduced from its events. A client subscribes and gets:

  1. a snapshot: the view up to a cursor;
  2. then frames: the events after that cursor, in order, each with its own cursor.

A client that disconnects resumes from its last cursor. If the server can no longer serve that cursor, it asks the client to resnapshot (resnapshot_required) rather than sending a gap. The Go client applies the same reducer the server uses, so a client and a test see the same state.

Creating and using a conversation

Create a conversation with the robotelos.create_conversation command, then send messages with robotelos.submit_message. Both are commands, so both return a receipt. See Commands and receipts and the command reference.

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)
A command is answered with a receipt. Events reach subscribers as frames, in order.

Limits

The same events reach every client that follows the conversation. See Multiple clients for how several devices stay in step.

The protocol bounds identifiers and payload sizes. A command over the limit is refused with payload_too_large. The exact limits are listed in the protocol reference.

Next steps