Skip to main content

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.
Attach evaluators to a root span so everything in the trace inherits them:
This is the simplest “set it once” approach and works well with auto-instrumentation: provider spans (OpenAI, vector DBs, etc.) inherit evaluators automatically.

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.

Next steps