Data structure reference

You are viewing documentation for our open source project which is maintained by the community. If you want to get started building assistants with Rasa please check out our latest documentation here.

The data structure is created by the Analytics pipeline and treated as a public API. The versioning of the API follows the Rasa Product Release and Maintenance Policy. All Internal Tables should be considered private and may change without notice.

Database Table Overview

Common Terms

Tables

rasa_sender

A sender is a user who interacts with the assistant through a Rasa Channel. If the assistant supports more than one channel, a user might have multiple senders. For example, a user might have a sender for the Facebook channel and a sender for the Slack channel.

id sender identifier

The unique identifier of the sender is generated by Analytics. Sender gets a different, generated id assigned. The id differs from the sender_id used by the Rasa channels, the sender_id in Rasa is the sender_key in Analytics.

sender_key Rasa channel sender identifier

The unique identifier used by the Rasa channel to identify this sender. The sender_key is specific to the channel implementation in Rasa and the format depends on the channel.

channel Rasa channel name

Name of the channel that is used for this sender. The channel names are defined in the implementation of the respective Rasa channel.

first_seen first contact with this sender

The date and time of the first contact with this sender. Corresponds to the time of the first event of the first session created for this sender.

last_seen latest contact with this sender

The date and time of the last contact with this sender. Corresponds to the time of the latest event of the latest session created for this sender.

rasa_session

The rasa_session table contains information about all conversation sessions that users started with the assistant. New sessions are created for every new user and for users who return to the assistant. The conditions that trigger a new session to start can be configured in the Rasa Domain.

id session identifier

The unique identifier of the session. Every session gets a different, generated id assigned.

sender_id sender who started the session

The unique identifier of the sender who started the session. It is a foreign key to the rasa_sender.id column.

timestamp creation date time

The timestamp when the session was created. The timestamp is a UTC.

start_sequence_number start of the session

The sequence number of the first event in this session. All events belong to exactly one session. The start sequence number is always smaller or equal to the end_sequence_number. The difference between start and end sequence numbers does not equal the number of events in this session since sequence numbers are incremented across multiple conversations.

end_sequence_number end of the session

The sequence number of the last event in the session.

rasa_turn

The rasa_turn table contains information about all conversation turns. A turn is one interaction between a user and an assistant. A turn always starts with a user message. It ends with the last event before the next user message or with the end of a session. A turn will usually be one user message followed by one or multiple assistant responses.

id session identifier

The unique identifier of the turn. Every turn gets a different generated id assigned.

sender_id sender who started the turn

The unique identifier of the sender who started the turn. It is a foreign key to the rasa_sender.id column.

session_id session identifier

The unique identifier of the session this turn is part of. It is a foreign key to the rasa_session.id column.

start_sequence_number start of the turn

The sequence number of the first event in this turn. All events belong to exactly one session. The start sequence number is always smaller or equal to the end_sequence_number. The difference between start and end sequence numbers does not equal the number of events in this session since sequence numbers are incremented across multiple conversations.

end_sequence_number end of the turn

The sequence number of the last event in this turn.

rasa_event

The rasa_event table contains all events that an assistant created. Events are created for every user message, bot response, and action that is executed as well as for a lot of internal changes to a conversation session. Overview of all Rasa Events.

id event identifier

The unique identifier of the event. Every event gets different, generated id assigned.

sender_id sender whose conversation the event belongs to

The unique identifier of the sender whose conversation this event is part of. It is a foreign key to the rasa_sender.id column.

session_id session identifier

The unique identifier of the session this event is part of. It is a foreign key to the rasa_session.id column.

timestamp creation date time

The timestamp when the event was created. The timestamp is a UTC.

event_type kind of event

The type of the event. The event type is a string and can be one of the following:

The event type defines how the event is interpreted and how the event affects the conversation. For example, the user event type will be interpreted as a user message and the bot event type will be interpreted as a bot response.

model_id model identifier

The identifier of the Rasa model that was running as part of the assistant when this event was created.

environment name of the assistant environment

The name of the environment of the assistant that created this event. The environment is a string that is set up during the start of the assistant,

sequence_number start of the event

The sequence number of the event. The events of a session always have increasing sequence numbers. Sequence numbers are not guaranteed to be sequential for events following one another. But sequence numbers can be used to order the events of a session.

rasa_bot_message

A message sent by the assistant to a user will be tracked in the rasa_bot_message table. The table contains information about the sent message.

id bot message identifier

The unique identifier of the bot message is generated by Analytics.

event_id id of the event of this message

The unique identifier of the event that created this bot message. It is a foreign key to the rasa_event.id column.

sender_id sender whose conversation the message belongs to

The unique identifier of the sender whose conversation this message is part of. It is a foreign key to the rasa_sender.id column.

session_id session identifier

The unique identifier of the session this message is part of. It is a foreign key to the rasa_session.id column.

timestamp creation date time

The timestamp when the message was created. The timestamp is a UTC.

template_name name of the template used to generate the message

The name of the template that Rasa used to generate the bot message. Might be empty if the message was not generated from a template but a custom action.

text message content

The text of the bot message.

model_id model identifier

The identifier of the Rasa model that was running as part of the assistant when this message was created.

sequence_number start of the event

The sequence number of the message. The events of a session always have increasing sequence numbers. The sequence number of this message is the same as the one of the underlying event.

rasa_user_message

A message sent by a user to the assistant will be tracked in the rasa_user_message table. The table contains information about the sent message.

id user message identifier

The unique identifier of the user message is generated by Analytics.

event_id id of the event of this message

The unique identifier of the event that created this user message. It is a foreign key to the rasa_event.id column.

sender_id sender whose conversation the message belongs to

session_id session identifier

intent classification of the text

The name of the intent that Rasa classified the text as. One of the intents in the domain used to train the model.

retrieval_intent classification of the text

The name of the retrieval intent that Rasa classified the text as. Only populated if there is a configured retrieval intent.

confidence certainty the model predicted for classifications

The confidence of the ML model's intent prediction. The confidence is a value between 0 and 1. The higher the value, the more certain the model is that the intent is correct.

text message content

The text of the user message.

timestamp creation date time

The timestamp when the message was created. The timestamp is a UTC.

model_id model identifier

The identifier of the Rasa model that was running as part of the assistant when this message was created.

sequence_number start of the event

message_id unique id for the message text

A unique id that identifies the text of the message.

rasa_action

An action executed by the assistant. All actions the bot executes are tracked in the rasa_action table. The table contains information about the executed action and its prediction.

id action identifier

The unique identifier of the action execution is generated by Analytics.

event_id id of the event of this action execution

The unique identifier of the event that created this action execution. It is a foreign key to the rasa_event.id column.

sender_id sender whose conversation triggered this action execution

The unique identifier of the sender whose conversation triggered this action execution. It is a foreign key to the rasa_sender.id column.

session_id session identifier

The unique identifier of the session this action execution is part of. It is a foreign key to the rasa_session.id column.

name name of the executed action

The name of the action that Rasa has predicted and executed. One of the actions in the domain used to train the model.

confidence ML models certainty of the predicted action

The confidence of ML model's action prediction. The confidence is a value between 0 and 1. The higher the value, the more certain the model is that the action is correct.

policy name of the policy that predicted the action

The name of the policy that predicted this action. The policy is a component in the Rasa assistant that makes a prediction. The policy can be a rule policy, a memoization policy, or an ML policy.

timestamp creation date time

The timestamp when the action was executed. The timestamp is a UTC.

model_id model identifier

The identifier of the Rasa model that was running as part of the assistant when this action was executed.

sequence_number start of the event

The sequence number of the executed action. The events of a session always have increasing sequence numbers. The sequence number of this executed action is the same as the one of the underlying event.

rasa_slot

A slot that has been set for a session. All changes to slot values are tracked in the rasa_slot table. The table contains information about the change in the value of the slot.

id slot change identifier

The unique identifier of this change in slot values is generated by Analytics.

event_id id of the event that triggered this slot change

The unique identifier of the event that triggered this change in the slot value. It is a foreign key to the rasa_event.id column.

sender_id sender whose conversation triggered this slot change

The unique identifier of the sender whose conversation triggered this slot change. It is a foreign key to the rasa_sender.id column.

session_id session identifier

The unique identifier of the session this slot change is part of. It is a foreign key to the rasa_session.id column.

slot_path path of the slot

A path to the slot that was changed. The path identifies the slot by its name, the sender and the session. The path is a string that looks like <sender_id>/<session_id>/<slot_name>.

name name of the slot

The name of the changed slot. The name of the slot is the same as the name of the slot in the domain.

value new slot value

The new value of the slot for the session. The value is a dumped JSON object.

timestamp creation date time

The timestamp when the slot value was changed. The timestamp is a UTC.

sequence_number start of the event

The sequence number of the slot change. The events of a session always have increasing sequence numbers. The sequence number of the slot change is the same as the one of the underlying event.

rasa_session_slot_state

The state of a slot at the end of a session. The state of a slot is the value of the slot at the end of a session. The state of a slot is stored in the rasa_session_slot_state table.

id path of the slot

A path to the slot. The path identifies the slot by its name, the sender and the session. The path is a string that looks like <sender_id>/<session_id>/<slot_name>.

sender_id sender whose conversation this slot is part of

The unique identifier of the sender whose conversation this slot is part of. It is a foreign key to the rasa_sender.id column.

session_id session identifier

The unique identifier of the session this slot is part of. It is a foreign key to the rasa_session.id column.

name name of the slot

The name of the slot. The name of the slot is the same as the name of the slot in the domain.

value last value of the slot in the session

The value of the slot at the end of the session. The value is a dumped JSON object. If a slot is changed multiple times during a session, the value is set to the last change.

timestamp creation date time

Time of the last update of the slot in this session. The timestamp is a UTC.

rasa_patterns

Patterns are marker definitions that have been received from Rasa. This table is called patterns to distinguish them from extracted markers which are stored in rasa_markers table. It stores the configuration of markers (which can be thought of as a pattern of conversational events) along with their metadata.

id pattern identifier

The unique identifier of the rasa pattern is generated by Analytics.

name pattern name

Name of the pattern

description pattern description

Description of the pattern

config pattern configuration

Pattern configuration dictionary stored as an escaped string

is_active soft-delete flag

Only patterns with is_active==True are processed during real-time analysis

created_at creation date time

Time of creation of this pattern. The timestamp is a UTC.

updated_at update date time

Time of the last update of the pattern in this session. The timestamp is a UTC.

rasa_markers

Extracted markers from the conversations. Each row in this table corresponds to a marker along with details of the pattern, sender, session and the last event where it was extracted.

id marker identifier

The unique identifier of the extracted rasa marker is generated by Analytics.

pattern_id pattern which was applied in this marker

The unique identifier of the pattern which was applied in this marker. It is a foreign key to the rasa_patterns.id column

sender_id sender identifier

The unique identifier of the sender whose conversation this marker is part of. It is a foreign key to the rasa_sender.id column.

session_id session identifier

The unique identifier of the session this marker is part of. It is a foreign key to the rasa_session.id column.

event_id event identifier

The unique identifier of the event from event broker where this marker was applied. Note that a marker can be applied across multiple events, this is the ID of the last event in the sequence.

num_preceding_user_turns Number of Proeeding User turns

an integer indicating the number of user turns preceding the event at which the marker applied.

created_at creation date time

Time of creation of this marker. The timestamp is a UTC.