What is a Session?
A session represents a single conversation between your AI and a user. Each session contains one or more messages exchanged back and forth, and Thunder analyzes these messages to extract insights. Sessions are the primary unit of analysis in Thunder. When you query metrics, you’re typically aggregating data across sessions - counting how many sessions discussed a topic, how many contained satisfaction signals, or how many revealed knowledge gaps.Session Structure
Each session has:| Field | Description |
|---|---|
sessionId | Unique identifier (UUID) |
instanceId | The instance this session belongs to |
endUserId | The user who initiated the conversation |
title | Auto-generated title summarizing the conversation |
summary | Brief summary of what was discussed |
language | Detected language of the conversation |
createdAt | When the session started |
lastActiveAt | When the last message was added |
Creating Sessions
Sessions are created automatically when you ingest messages. If you don’t provide asessionId, Thunder creates one for you:
sessionId - store this to add more messages later.
Adding Messages to Existing Sessions
Include thesessionId to continue a conversation:
Querying Sessions
UsegroupBy=SESSION to get per-session metrics:
Filtering Sessions
Filter sessions by various criteria:| Filter | Description |
|---|---|
topicIds | Sessions that discussed specific topics |
signalIds | Sessions containing specific satisfaction signals |
gapIds | Sessions where specific gaps were detected |
repeatedRequestIds | Sessions with specific repeated requests |
language | Sessions in a specific language |
Best Practices
Use consistent session IDs
Use consistent session IDs
If you’re managing session IDs on your end, use UUIDs and ensure the same conversation always uses the same session ID. This ensures accurate analysis.
Include user IDs
Include user IDs
Always include
userId in your messages so Thunder can track end user engagement and link sessions to users.Ingest complete conversations
Ingest complete conversations
For best analysis results, ingest both user and assistant messages. Thunder needs both sides to detect satisfaction signals and gaps.