Skip to main content

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:

Creating Sessions

Sessions are created automatically when you ingest messages. If you don’t provide a sessionId, Thunder creates one for you:
The response includes the sessionId - store this to add more messages later.

Adding Messages to Existing Sessions

Include the sessionId to continue a conversation:

Querying Sessions

Use groupBy=SESSION to get per-session metrics:
This returns each session with its metrics and metadata:

Filtering Sessions

Filter sessions by various criteria: Example - find all sessions about a specific topic:

Best Practices

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.
Always include userId in your messages so Thunder can track end user engagement and link sessions to users.
For best analysis results, ingest both user and assistant messages. Thunder needs both sides to detect satisfaction signals and gaps.