What is a Trace?
A trace represents a single end-to-end operation in your AI pipeline. Each trace captures:- Inputs and outputs at each stage
- State that existed at inference time (documents, config)
- Timing and metadata
Naming Traces
The trace name should describe what the operation does, not how."answer-question"-"classify-page"-"generate-summary"
"llm-call-1"-"step-2"-"function-x"
Creating a Trace
Metadata is searchable in the Artanis dashboard, making it easy to filter
traces by user, session, or other dimensions.
Recording Data
input() - Data going into the operation
input() - Data going into the operation
Use for user questions, prompts, and model parameters.
output() - Final result of the operation
output() - Final result of the operation
Use for LLM responses and classification results.
state() - Context needed for replay
state() - Context needed for replay
Use for document IDs, config, and guidelines that existed at runtime.
Basic Example
Multi-Stage Pipeline
For complex pipelines with multiple steps:Error Handling
Capture errors when operations fail:Getting the Trace ID
The trace ID is useful for linking user feedback:Learn how to link feedback to traces in the Feedback
Integration guide.