.to_text() method that returns an embedding-ready string.
ActionsPayload
Delivered when the connector forwards a batch of UI actions from a user session.to_text() example output:
Fields
Connector product identifier.
User session identifier.
None for anonymous sessions before identity linking.External user identifier passed at session boot.
None when the session is fully anonymous.User email if available from the identity store.
Ordered list of UI actions in this batch. See SlimAction below.
Number of actions in this batch. Equals
len(actions).Unix timestamp (float) when the connector forwarded this batch.
ActionsPayload.merge(payloads)
Merges a non-empty list of ActionsPayload objects for the same session into one.
- Actions are concatenated and re-indexed sequentially from
0 user_id/emailresolved from the first non-Nonevalue across all inputsforwarded_atset to the latest timestamp across all inputs- Raises
ValueErrorifpayloadsis empty
AsyncAgentContextWriter when debounce_ms > 0 to combine
payloads that arrive within the accumulation window before calling write_actions.
SummaryPayload
Delivered when the connector’s LLM summariser produces a prose description of a session. Replaces the raw action list for context-window efficiency in RAG pipelines.to_text() example output:
Fields
Connector product identifier.
User session identifier.
Prose description of what the user did during this session.
Number of individual actions this summary condenses.
Unix timestamp when the connector forwarded this summary.
SlimAction
A single UI action insideActionsPayload.actions.
Fields
0-based position of this action in the session sequence.
Lowercase event type. One of
"pageview", "click", "submit", "type", "focus", "blur".Human-readable label for the event (e.g.
"Page Load: Dashboard" or "Click Export CSV button").Natural-language description of what the user did (e.g.
"User landed on the dashboard page").Unix timestamp when this action began.
Unix timestamp when this action ended (equals the next action’s
timestamp_start).
For the last action in a batch this equals timestamp_start.Original URL as captured, before canonicalization (includes query strings and fragments).
Normalised page URL with dynamic path segments collapsed to
:id
(e.g. https://app.example.com/projects/:id).Using .to_text() for embeddings
Both payload types expose .to_text() so you can embed either without branching: