Evaluation Models
Data structures for agent success evaluation results.
AgentSuccessEvaluationResultmodelRepresents an agent performance evaluation result.
| Prop | Type |
|---|---|
result_id | integer |
user_id | string |
agent_versionrequired | string |
session_idrequired | string |
is_successrequired | boolean |
failure_type | string |
failure_reason | string |
evaluation_name | string |
created_at | integer |
regular_vs_shadow | RegularVsShadow |
number_of_correction_per_session | integer |
user_turns_to_resolution | integer |
is_escalated | boolean |
tags | array[string] | null |
GetAgentSuccessEvaluationResultsRequestrequest modelRequest model for getting agent success evaluation results.
| Prop | Type |
|---|---|
agent_version | string |
limit | integer |
start_time | datetime |
end_time | datetime |
GetAgentSuccessEvaluationResultsResponseresponse modelResponse model for getting agent success evaluation results.
| Prop | Type |
|---|---|
successrequired | boolean |
agent_success_evaluation_resultsrequired | array[AgentSuccessEvaluationResult] |
msg | string |
RetrievedLearningEvaluationResultmodelThe latest per-learning relevance/impact verdict for one target interaction. One row per (user_id, session_id, interaction_id, kind, learning_id); the stored set is the most recent successfully persisted evaluation for the session, not an append-only history. The same learning used on multiple interactions is evaluated separately against each response. Produced automatically when a session that published interactions with retrieved_learnings goes through group evaluation.
| Prop | Type |
|---|---|
result_id | integer |
user_idrequired | string |
session_idrequired | string |
agent_version | string |
interaction_id | integer | null |
interaction_created_at | integer | null |
kindrequired | "profile" | "user_playbook" | "agent_playbook" |
learning_idrequired | string |
is_relevant | boolean | null |
relevance_reason | string |
impact | "positive" | "negative" | "neutral" | null |
impact_reason | string |
diagnosis | PlaybookDiagnosis | null |
evaluated_playbook_digest | string | null |
diagnosis_evidence_complete | boolean |
created_at | integer |
PlaybookDiagnosismodel| Prop | Type | Description |
|---|---|---|
categoryrequired | "content_defect" | "application_failure" | "external_failure" | "no_issue" | "unknown" | |
reasonrequired | string | 1–4,000 characters |
evidence_interaction_ids | list[int] | At most 20 entries. Defaults to []. |
Diagnosis explains the observed problem; it is not replay evidence or proof of improvement.
Missing or unknown diagnosis does not disqualify otherwise eligible historical evidence.
Out-of-session citations are discarded; only verified, supported diagnoses can influence tuning. See diagnosis and tuning.
GetRetrievedLearningEvaluationResultsRequestrequest modelRequest model for POST /api/get_retrieved_learning_evaluation_results.
| Prop | Type |
|---|---|
user_id | string |
session_id | string |
start_time | datetime |
end_time | datetime |
limit | integer |
GetRetrievedLearningEvaluationResultsResponseresponse modelResponse model for POST /api/get_retrieved_learning_evaluation_results.
| Prop | Type |
|---|---|
successrequired | boolean |
resultsrequired | array[RetrievedLearningEvaluationResult] |
msg | string |
EvaluationSourceSetRequestmodelOne labeled request-source cohort for evaluation comparison. Sources match Request.source exactly, including the empty string for requests published without a source.
| Prop | Type |
|---|---|
labelrequired | string |
sourcesrequired | array[string] |
SourceSetEvaluationMetricsmodelMetrics for one source set in SourceSetComparison.
| Prop | Type |
|---|---|
labelrequired | string |
sourcesrequired | array[string] |
session_countrequired | integer |
session_ids | array[string] |
success_rate_pprequired | float |
bucketsrequired | array[HeroBucket] |
context_tilesrequired | ContextTile |
score_distributionrequired | ScoreDistribution |
rule_attributionrequired | array[RuleAttributionRow] |
braintrust_tiles | array[BraintrustTileRow] |
SourceSetComparisonmodelRequest-source comparison payload. Each evaluation result is assigned by joining to the session's first request and reading that request's source.
| Prop | Type |
|---|---|
available_sources | array[string] |
source_sessions | array[{ source: string, session_ids: array[string], sessions: array[{ user_id: string, session_id: string }] }] |
sets | array[SourceSetEvaluationMetrics] |
unmatched_session_count | integer |
GetEvaluationOverviewRequestrequest modelInput for the Evaluation Overview endpoint (POST /api/get_evaluation_overview).
| Prop | Type |
|---|---|
from_tsrequired | integer |
to_tsrequired | integer |
bucket | string |
include_shadow | boolean |
source_sets | array[EvaluationSourceSetRequest] |
GetEvaluationOverviewResponseresponse modelResponse model for the Evaluation Overview endpoint. The global fields populate the all-source hero, context, and rule-attribution sections. Source-set metrics are returned separately in source_set_comparison; the web portal uses those source-set metrics to scope the page when a user selects a single source.
| Prop | Type |
|---|---|
herorequired | HeroBlock |
context_tilesrequired | ContextTile |
rule_attributionrequired | array[RuleAttributionRow] |
score_distributionrequired | ScoreDistribution |
braintrust_tiles | array[BraintrustTileRow] |
shadow_win_rate_trend | ShadowWinRateTrend |
recent_results | array[AgentSuccessEvaluationResult] |
source_set_comparison | SourceSetComparison |
ShadowComparisonOutputmodelLLM judge verdict for a single per-turn Emend-vs-shadow comparison (F1). The position of the two responses shown to the judge is randomized per call to mitigate position bias; the mapping is recorded on ShadowComparisonVerdict.emend_is_request_1.
| Prop | Type |
|---|---|
better_requestrequired | string |
is_significantly_betterrequired | boolean |
comparison_reason | string |
ShadowComparisonVerdictmodelOne per-turn comparison verdict, stored per (interaction_id, judge_prompt_version) in the shadow_comparison_verdicts table.
| Prop | Type |
|---|---|
verdict_idrequired | integer |
interaction_idrequired | string |
session_idrequired | string |
agent_versionrequired | string |
emend_is_request_1required | boolean |
outputrequired | ShadowComparisonOutput |
judge_prompt_versionrequired | string |
created_atrequired | datetime |
ShadowWinRateTrendPointmodelOne daily bucket of per-turn shadow comparison verdicts (F1). Buckets are UTC-aligned and surfaced in ascending date order.
| Prop | Type |
|---|---|
daterequired | string |
nrequired | integer |
winsrequired | integer |
lossesrequired | integer |
tiesrequired | integer |
ShadowWinRateTrendWindowTotalmodelAggregate of all shadow verdicts across the trend window (F1). Used to render the headline win-rate tile on the Evaluation page.
| Prop | Type |
|---|---|
nrequired | integer |
winsrequired | integer |
lossesrequired | integer |
tiesrequired | integer |
win_raterequired | float |
net_winrequired | float |
ShadowWinRateTrendmodelF1 shadow win-rate trend payload. Carried on GetEvaluationOverviewResponse.shadow_win_rate_trend.
Verdicts produced under a previous rubric epoch are filtered out at storage time by judge_prompt_version, so the dashboard never silently mixes incompatible rubrics into the headline number.
| Prop | Type |
|---|---|
daily | array[ShadowWinRateTrendPoint] |
window_total | ShadowWinRateTrendWindowTotal |
judge_prompt_version | string |
GetRecentShadowComparisonsResponseresponse modelReturned by GET /api/evaluations/shadow_comparisons/recent.
| Prop | Type |
|---|---|
verdicts | array[ShadowComparisonVerdict] |
GET /api/evaluations/shadow_comparisons/recentendpointReturns the N most recent per-turn shadow comparison verdicts (F1). Powers two surfaces on the Evaluation page:
- The drawer triggered from the per-turn comparison tile — shows the N most recent verdicts so you can spot-check the judge.
- The “Top 10 disagreements” widget — fetches a wider pool and the frontend filters to
is_significantly_better=Truelosses to surface actionable rule-correction candidates.
Verdicts are restricted to the org's currently pinned Config.shadow_comparison_judge_prompt_version so verdicts from an older rubric never mix into the drawer. A 30-day lookback is enforced server-side so the storage layer can use an index range scan instead of a full table read.
Query parameters
| Prop | Type |
|---|---|
limit | integer |
Response
GetRecentShadowComparisonsResponse.
Errors
503Storage not configured — the server has no storage backend wired.- Returns
verdicts: [](200) when the storage backend does not implement theshadow_comparison_verdictsfeature (e.g. the disk backend), or when no verdicts in the 30-day window match the pinned prompt version.
RegenerateRequestrequest modelInput for POST /api/evaluations/regenerate — kicks off a replay-the-judge job over a closed window.
| Prop | Type |
|---|---|
evaluation_name | string |
from_tsrequired | integer |
to_tsrequired | integer |
RegenerateStartResponseresponse modelReturned by POST /api/evaluations/regenerate.
| Prop | Type |
|---|---|
job_idrequired | string |
totalrequired | integer |
RegenerateFailuremodelOne failed session in a regen job's failure list.
| Prop | Type |
|---|---|
session_idrequired | string |
reasonrequired | string |
RegenerateStatusResponseresponse modelReturned by GET /api/evaluations/regenerate/{job_id}. Carries the live lifecycle state of the regen worker plus the F3 sampling and concurrency counters described in Measuring Emend's Impact.
| Prop | Type |
|---|---|
job_idrequired | string |
statusrequired | string |
totalrequired | integer |
completedrequired | integer |
failedrequired | integer |
failuresrequired | array[RegenerateFailure] |
started_atrequired | float |
finished_at | float |
total_candidates | integer |
sampled_count | integer |
concurrency_limit | integer |
GradeOnDemandRequestrequest modelInput for POST /api/evaluations/grade_on_demand — single-session click-through grading triggered when a dashboard user opens a session that wasn't in the sampled regen set. See Sampling and freshness.
| Prop | Type |
|---|---|
session_idrequired | string |
agent_versionrequired | string |
evaluation_name | string |
GradeOnDemandResponseresponse modelReturned by POST /api/evaluations/grade_on_demand. Results are cached for 24 hours via the operation-state mechanism — the second call for the same (session, agent_version) within the cache window will return cached: true with the original result_id.
| Prop | Type |
|---|---|
session_idrequired | string |
result_id | integer |
cached | boolean |
skipped_reason | string |
retrieved_learning_status | string |