Skip to main content
Cascade provides a built-in evaluation system to score your agent’s performance. The Evaluator SDK covers the core evaluation flow: configuring evals, creating scorers, and running evaluations. The Python SDK (separate section) covers deeper APIs like failure reports, tasks, and trace access.

1. Add evals to init_tracing

Pass scorer names to init_tracing() and every trace is automatically evaluated. No extra code required.
Rubrics from the Platform: Create rubrics (scorers) in the Cascade dashboard (Evaluations → Rubrics). Use the rubric name in evals:
Session-level evals: For multi-turn conversations, use session_evals to run scorers when a session ends (via end_session()):

2. create_scorer

Create custom scorers programmatically. Full signature and options:
scope output_type and scoring
  • numeric — Use min_score and max_score. Judge returns a number in that range.
  • categorical — Use choices. Judge picks one label; each label has a score.
variable_mappings Maps template placeholders to span attributes. Use the placeholder name as the key and the attribute path as the value.
Example: trace-level numeric scorer
Example: span-level categorical scorer (tool spans)

3. evaluate

Score a specific trace after it completes:
Parameters

4. evaluate_spans

Run span-level scorers on matching spans within a trace. Use span_type to target LLM or tool spans:
Parameters