Logs
focus on discrete events or exchanges and are perfect for reliability analysis.Traces
capture multi-step workflows and execution paths across tools and agents.
Log Schema
Most Quotient logs follow a predictable structure:user_query
: the prompt or question issued to the model.model_output
: the raw model response.documents
: evidence retrieved to answer the query. Can mix strings and{ page_content, metadata }
objects.tags
: custom metadata to help slice analytics (feature flag, customer tier, model version, etc.).
When to Log
- Development – capture every interaction for rapid iteration and benchmarking.
- Production – sample strategically to balance coverage with cost while keeping detections active.
- Evaluations – log curated test sets to compare models, retrievers, or prompts over time.
End-to-End Example
Best Practices
- Use distinct
environment
values (dev
,staging
,prod
) to keep dashboards segmented. - Keep
detection_sample_rate=1.0
in early development; adjust in production to control spend. - Attach consistent
tags
to power comparisons across prompts, models, or customer segments. - Redact or hash PII before logging to maintain compliance.
- Rotate API keys per environment and store them securely (dotenv, secret manager, etc.).
Next: Initialize the Logger