Skip to main content
You can use Galtea to log and evaluate real user interactions from your production environment. This helps you monitor your product’s performance over time.
This tutorial evaluates production sessions on demand, one call at a time. To score production sessions automatically and continuously, create a Monitor instead: an always-on rule that samples and scores a product’s production sessions with a set of metric families, with no run to trigger by hand.
If your application already has its own conversation or chat ids, you can keep using them as the handle for a Galtea session, so you never store Galtea’s own session id. First, create the session once with galtea.sessions.create(custom_id=<your id>, ...). Then log every turn with session_custom_id=<your id> (plus a version_id or product_id anchor): each call finds that session by your custom id and appends to it.
The same works for logging turns without evaluating them:
Sessions are created only through the sessions API. If no session matches your session_custom_id and anchor, the call returns a 400 error. Create the session first with galtea.sessions.create(custom_id=...).
If your system already emits OpenTelemetry traces, you can create production sessions without any SDK calls. See Monitor Real User Traffic via OpenTelemetry.

Single-Turn Production Monitoring

For simple, single-turn interactions, create a production session and use galtea.inference_results.create_and_evaluate() to log and evaluate the interaction in a single call. You can pass Specification IDs so the API resolves their linked metrics automatically (recommended), or list metrics explicitly.

Multi-Turn Production Monitoring (Conversations)

For multi-turn conversations, use the session-based workflow to log the entire interaction first and then evaluate it. If your application has its own conversation ids, prefer the session_custom_id flow above: create the session once with a custom_id in step 1, then pass session_custom_id (plus version_id or product_id) instead of session_id in step 2.
1

1. Create a Session

First, create a session at the start of the conversation. For production monitoring, make sure to set is_production=True.
2

2. Log Conversation Turns

Next, log the user-assistant interactions. You can do this individually as each turn happens or in a single batch after the conversation ends.
This approach is useful for logging interactions in real-time in a live application.
3

3. Evaluate the Session

Finally, once the conversation is complete and all turns are logged, you can run an evaluation on the entire session. Pass Specification IDs so the API resolves their linked metrics automatically (recommended), or list metrics explicitly.
For more details on evaluating multi-turn conversations, see the Evaluating Conversations guide.

Reading Monitor Results

If you have set up a Monitor on the Galtea dashboard to continuously evaluate a sample of your production sessions, you can pull its results with a single call:
The days query parameter sets the trailing window to aggregate, bucketed by day. It defaults to 7 and accepts up to 90. The response is built to give you an honest read of your product’s quality, not just a bare average. Keep these ideas in mind when you interpret it:
  • Each metric family gets its own score series. A metric family is a metric and every later revision of it (for example, when you edit its judge prompt), grouped as one line of history. The response returns one series per family bound to the monitor, each with a whole-range headline score and one point per day bucket.
  • Scores are sampling-weighted. A monitor does not evaluate every session; it evaluates a sample to control cost. Sessions from a period when sampling was lower count for more in the average, so a period with a smaller sample does not silently pull the score toward its own noise.
  • A confidence interval tells you how much to trust a score. The confidence interval is the range that most likely contains the true score. Galtea publishes a 95% interval once a bucket has scored at least 30 sessions. Below that floor, confidenceInterval is null and collectingData is true, so you know the score is a preview, not a settled number, until more sessions land.
  • The worst metric family drives the headline, never an average. worstMetric is the lowest-scoring family over the whole range, not a blended score across families. Use it to see which quality dimension needs attention first.
  • Markers flag context changes. markers.metricRevisions marks when a bound metric family was edited, and markers.samplingChanges marks when the sampling rate changed. Both can explain a shift in the score series that isn’t a real quality change.
  • Spend shows your current billing cycle. spend.spentCredits and spend.pendingCredits are the credits already used and reserved for evaluations still running this cycle; spend.capCredits is the monthly cap you configured for the monitor (null if you did not set one). If spend nears the cap, the monitor lowers its sampling rate to stay within budget, which is exactly what the sampling-change markers and sampling-weighted scores are designed to absorb.
  • Sessions are listed, not just counted. sessions.scored lists the most recently evaluated sessions (capped at 200), each with the turn count it was scored at. sessions.waiting lists production sessions that have not closed yet (capped at 100); a session is scored only once it closes. A session closes when it is explicitly finished, or when the product’s auto-close setting closes it after inactivity.

Next Steps

Evaluating Conversations

Evaluate full multi-turn production conversations.

Tracing Agent Operations

Capture and analyze internal agent operations in production.