Inbound message anatomy
An incoming message is a Message. The same shape applies whether it came from Slack, the web chat, or any other adapter.
Node
Python
Message
ConversationHistory
HistoryMessage
Timestamp (google.protobuf.Timestamp)
User
Attachment
Attachment.type values: TYPE_UNSPECIFIED, IMAGE, FILE, VIDEO, AUDIO, LINK.
PlatformContext
PlatformContextEventKind
Edited messages
In the web chat, a user can edit a message they sent. The chat keeps the old message and its replies as another version, and the user can switch between versions. The history your agent stores for the conversation then holds turns the user replaced.
When that happens, the next message carries history: the turns before it, on the version the user is looking at. Replace the history you store for conversationId with history, then handle the message as usual. An empty history means the message has no earlier turns, as when the user edits their first message. The same field arrives when the user switches to another version and continues there, and after a turn your agent did not answer.
history carries text only; a user turn that carried only files arrives as a line naming them. It holds the newest turns that fit in 512 KiB, and isComplete is false when it left older ones out.
The chat offers editing only for agents that set supportsHistory in the config they send at startup. The Mastra and LangChain adapters and the AI SDK adapter set it and reset their memory for you. In your own adapter the flag defaults to off, so an agent that ignores history never receives an edit.
Node.js
Python
For web-chat file input and agent-produced downloads, see Files in chat.
Next steps
- Sending a response: reply to what arrived
- Receiving platform feedback: reactions, edits, and stream control