Skip to main content

Analytics Database

Overview

Studio ingests conversation events from a Kafka topic (rasa-events) and stores them in a PostgreSQL database. An event ingestion service consumes each message and writes structured records into analytics tables — capturing individual conversation events as well as aggregated daily statistics by channel/version and by flow.

These tables are available as a standard PostgreSQL database, which means you can connect any SQL-compatible BI tool — such as Metabase, Tableau, Looker, Grafana, or Redash — directly to the database and build custom dashboards on top of the data.

Connecting to the database

Studio uses a standard PostgreSQL connection. Use the following connection string format:

postgresql://<DB_USER>:<DB_PASSWORD>@<DB_HOST>:<DB_PORT>/<DB_NAME>
ParameterDefault valueDescription
DB_HOSTHostname or IP of the PostgreSQL server
DB_PORT5432PostgreSQL port
DB_NAMEstudioDatabase name
DB_USERstudio_backendDatabase user
DB_PASSWORDPassword for the database user

Example (local development):

postgresql://studio_backend:studio_backend@localhost:5432/studio

For production deployments, ask your administrator for the host, port, and credentials. It is recommended to create a dedicated read-only database user with SELECT privileges on the analytics tables before connecting your BI tool.

Data model

Analytics database schema

Table reference

Conversation

Each row represents a single conversation session between a user and the assistant.

ColumnTypeDescription
idstring (UUID)Primary key. Unique identifier for the conversation.
assistantNamestringName of the assistant that handled the conversation.
assistantVersionstringVersion of the assistant at the time of the conversation.
totalNumberOfUserMessagesintegerNumber of messages sent by the user during the conversation.
startDatedatetimeTimestamp of the first event in the conversation (set on session_started).
ingestedbooleantrue once the conversation has been fully processed (set on session_ended or conversation_inactive).
reviewStateenumReview status of the conversation. Values: UNREVIEWED, PARTIALLY_REVIEWED, REVIEWED.
csatRatingenum | nullCustomer satisfaction rating, if collected. Values: SATISFIED, UNSATISFIED, UNANSWERED.
lastReviewedAtdatetime | nullTimestamp of the most recent review action. null if never reviewed.
escalatedAtdatetime | nullTimestamp when the conversation was escalated to a human agent. null if not escalated.
environmentIdstring (UUID) | nullForeign key to the Environment table. Identifies which environment (e.g. production, staging) the conversation occurred in. null if not set.

ConversationEvent

Each row represents a single Rasa event within a conversation, such as an action execution, slot update, or flow transition.

ColumnTypeDescription
idstring (UUID)Primary key. Unique identifier for the event.
conversationIdstring (UUID)Foreign key to Conversation.id. The conversation this event belongs to.
timestampdatetimeWhen the event occurred.
modelIdstring (UUID)Foreign key to MachineLearningModel.id. The model that generated this event.
typeenumType of Rasa event. See values below.
rawDatajsonFull raw event payload as received from Rasa.
metadatajsonAdditional metadata attached to the event. Defaults to {}.
actionTextstring | nullName of the action executed (for ACTION events).
namestring | nullEvent name, if applicable.
slotValuejson | nullSlot value set by the event (for SLOT events).
flowIdstring | nullIdentifier of the flow associated with the event (for flow-related events).
stepIdstring | nullIdentifier of the step within the flow.
agentIdstring | nullIdentifier of the subagent that generated the event, when using multi-agent setups.

type enum values:

ACTION, SESSION_STARTED, SLOT, RESET_SLOTS, FLOW_STARTED, FLOW_INTERRUPTED, FLOW_RESUMED, FLOW_COMPLETED, FLOW_CANCELLED, FORM, ACTIVE_LOOP, RESTART, CONVERSATION_INACTIVE, SESSION_ENDED, ENTITIES, FOLLOWUP, ACTION_EXECUTION_REJECTED, STACK, ROUTING_SESSION_ENDED, REMINDER, CANCEL_REMINDER, REWIND, UNDO, EXPORT, PAUSE, RESUME, LOOP_INTERRUPTED, AGENT_STARTED, AGENT_COMPLETED, AGENT_INTERRUPTED, AGENT_CANCELLED, AGENT_RESUMED


VersionDailyStatistics

Each row contains aggregated daily metrics for a specific channel and assistant version combination. This table is the primary source for time-series dashboards tracking volume, automation rate, latency, and CSAT.

ColumnTypeDescription
idstring (UUID)Primary key.
datedatetimeThe calendar day this row covers. Combined with channelName and version, this is unique per row.
channelNamestringName of the channel (e.g. rest, socketio).
versionstringAssistant version identifier.
totalSessionsintegerTotal number of conversation sessions on this day.
automatedCountintegerNumber of sessions that were fully handled without escalation.
escalatedCountintegerNumber of sessions escalated to a human agent.
averageLatencyMsfloatMean response latency in milliseconds.
p50LatencyMsfloat50th percentile (median) response latency in milliseconds.
p95LatencyMsfloat95th percentile response latency in milliseconds.
p99LatencyMsfloat99th percentile response latency in milliseconds.
csatSatisfiedintegerNumber of sessions rated as satisfied.
csatUnsatisfiedintegerNumber of sessions rated as unsatisfied.
csatUnansweredintegerNumber of sessions where CSAT was not answered.
customSuccessCountinteger | nullNumber of sessions meeting a custom success criteria, if configured.
customFailureCountinteger | nullNumber of sessions failing a custom success criteria, if configured.
createdAtdatetimeWhen this row was first created.
updatedAtdatetimeWhen this row was last updated.
successCriteriaIdstring (UUID) | nullForeign key to the SuccessCriteria table. References the custom success criteria definition used to compute customSuccessCount and customFailureCount. null if no custom criteria is configured.

FlowDailyStatistics

Each row contains aggregated daily metrics for a specific flow, allowing you to compare flow-level engagement and escalation rates over time.

ColumnTypeDescription
idstring (UUID)Primary key.
datedatetimeThe calendar day this row covers.
flowNamestringName of the flow.
totalSessionsintegerTotal number of sessions that entered this flow on this day.
automatedCountintegerNumber of sessions that completed the flow without escalation.
escalatedCountintegerNumber of sessions that were escalated while in this flow.
createdAtdatetimeWhen this row was first created.
updatedAtdatetimeWhen this row was last updated.

SuccessCriteria

Stores the custom success filter configured per assistant, which defines which flows must (or must not) be executed for a session to be counted as successful. Referenced by VersionDailyStatistics to compute customSuccessCount and customFailureCount.

ColumnTypeDescription
idstring (UUID)Primary key.
assistantNamestringName of the assistant this criteria applies to.
includedFlowsstring[]List of flow names that must be executed for a session to count as successful.
excludedFlowsstring[]List of flow names that must not be executed for a session to count as successful.
createdAtdatetimeWhen this criteria was created.
updatedAtdatetimeWhen this criteria was last updated.