Evaluators
Evaluators are server-side quality checks that run on span data (inputs/outputs/metadata) after spans are exported to Basalt. They run asynchronously, so they don’t block your application. Use evaluators to score things like correctness, safety/toxicity, hallucinations, or domain-specific rules.How attachment works
There are two common ways to attach evaluators:- Propagating (recommended): attach to a span/trace and it flows to child spans created under it.
- Span-only: attach to a single span without affecting children.
Propagating evaluators (recommended)
Attach evaluators to a root span so everything in the trace inherits them:Span-only evaluators
Attach an evaluator to just one span (useful when only a specific step needs checking):Sampling (cost control)
Some evaluators can be expensive. Use sampling to run them on a fraction of traces/spans:Evaluator metadata (optional)
If an evaluator needs extra context (expected output, rubric, references), attach evaluator-specific metadata to the span:Best practices
- Start with 1–2 evaluators on your main flows, then expand.
- Prefer propagating attachment at the root; use span-only attachment for targeted checks.
- Use sampling for expensive evaluators.
- Keep evaluator metadata small and structured.