What are composite evaluators?
A composite evaluator is a custom evaluator that has access to other evaluators computed on the current step or any of its child steps. This allows you to:- Combine multiple evaluator scores into a single comprehensive evaluation
- Apply conditional logic based on evaluator values
- Create hierarchical evaluations that aggregate scores across sessions, traces, and spans
- Build context-aware evaluators that only calculate when certain conditions are met
required_metrics parameter to specify which evaluators
they depend on. These required evaluators are guaranteed to be computed before the
composite evaluator runs, and their values are accessible via the step_object.metrics
dictionary.
Common use cases
Conditional evaluation
Calculate an evaluator only when another evaluator meets certain criteria: Example: Only calculate adherence if the input prompt is correct Required evaluators:SplunkAOEvaluators.correctness, SplunkAOEvaluators.context_adherence
Hierarchical aggregation
Aggregate evaluator values across different levels of your application hierarchy: Example: Calculate average evaluator scores across all spans in a session Required evaluators:SplunkAOEvaluators.context_adherence
Multi-evaluator analysis
Combine multiple evaluators to detect specific patterns or issues: Example: Check for PII and count occurrences if found Required evaluators:SplunkAOEvaluators.output_pii
Cross-span evaluation
Use evaluators across different span types in a trace: Example: Combine retriever and LLM evaluators for RAG evaluation Required evaluators:SplunkAOEvaluators.context_relevance, SplunkAOEvaluators.context_adherence
Specifying required evaluators
Therequired_metrics parameter tells Splunk Agent Observability which evaluators must be computed
before your composite evaluator runs. This ensures the evaluator values are available
when your scorer function executes.
You specify required evaluators when creating your code-based custom evaluator:
- In the UI: Select evaluators from the “Required Evaluators” dropdown (see how)
- In the Python SDK: Pass the
required_metricsparameter
Splunk Agent Observability preset evaluators
For Splunk Agent Observability’s built-in evaluators, use theSplunkAOEvaluators enum. For example, you
might select:
SplunkAOEvaluators.context_adherenceSplunkAOEvaluators.context_adherence_lunaSplunkAOEvaluators.correctness
Custom evaluators
For your own custom evaluators, reference them by name as strings. You can also mix custom evaluators with Splunk Agent Observability preset evaluators:"My Custom Evaluator"(string for custom evaluator)"Compliance Check"(string for custom evaluator)SplunkAOEvaluators.output_pii(Splunk Agent Observability preset evaluator)
Accessing evaluator values
Once you’ve specified required evaluators, access them through thestep_object.metrics dictionary:
Boolean vs. float evaluators
Different Splunk Agent Observability evaluators return different value types:- Boolean evaluators (e.g.
correctness,context_adherence) are evaluated by multiple judges and return alist[int]at the root level, where each element is0(false) or1(true) — one value per judge. - Float evaluators (e.g.
completeness) return a singlefloatbetween 0 and 1.
Complete example: multi-level session evaluator
This example demonstrates a comprehensive composite evaluator that aggregates scores from all hierarchy levels. Required evaluators to select (in UI dropdown or SDK parameter):SplunkAOEvaluators.conversation_qualitySplunkAOEvaluators.action_completionSplunkAOEvaluators.agent_efficiencySplunkAOEvaluators.action_completion_lunaSplunkAOEvaluators.action_advancementSplunkAOEvaluators.context_adherenceSplunkAOEvaluators.context_relevanceSplunkAOEvaluators.tool_error_rate
Best practices
Be specific with required evaluators
Only include evaluators you actually use. This improves performance and makes your evaluator’s dependencies clear:Use appropriate step types
Match your composite evaluator’s step type to where the required evaluators exist:- Session: Can access session, trace, and span evaluators
- Trace: Can access trace and span evaluators
- Span: Can only access evaluators on that specific span
Execution restrictions
Composite evaluators depend on the successful completion of theirrequired_metrics:
- While any required evaluator is not yet final (e.g., queued or computing), the composite evaluator remains queued.
- If any required evaluator finishes without a successful final status (e.g., failed, not computed, or not applicable), the composite evaluator raises an error that includes the failed statuses of those required evaluators.
- Evaluators not listed in
required_metricsdo not affect the composite evaluator—only the required ones gate execution.
Creating composite evaluators
Composite evaluators can be created in two ways:- Splunk Agent Observability UI: Use the custom code-based evaluators editor and select required evaluators from the “Required Evaluators” dropdown
- Python SDK: Add the
required_metricsparameter when creating code-based evaluators
Composite evaluators are only supported for code-based custom evaluators.
LLM-as-a-judge evaluators do not support the
required_metrics parameter.Create composite evaluators in the UI
Learn how to create composite evaluators using the Splunk Agent Observability UI
Python SDK reference
View Python SDK documentation for evaluators
Custom evaluators overview
Learn about custom code-based evaluators in Splunk Agent Observability
Next steps
Custom code-based evaluators
Learn how to create custom code-based evaluators in Splunk Agent Observability
Evaluators overview
Explore Splunk Agent Observability’s comprehensive evaluators framework
Run experiments with evaluators
Learn how to use evaluators in experiments