---
name: mastra-evals
description: Documentation for @mastra/evals. Use when working with @mastra/evals APIs, configuration, or implementation.
metadata:
  package: "@mastra/evals"
  version: "1.10.13"
---

## When to use

Use this skill whenever you are working with @mastra/evals to obtain the domain-specific knowledge.

## How to use

Read the individual reference documents for detailed explanations and code examples.

### Docs

- [Built-in scorers](references/docs-evals-built-in-scorers.md) - Choose built-in Mastra scorers for accuracy, reliability, context quality, output quality, safety, and fast deterministic checks in eval runs.
- [Evals](references/docs-evals-overview.md) - Evaluate Mastra agents and workflows with model-graded, rule-based, and programmatic scorers through live evaluations, trace scoring, and Quick Checks.
- [Quick Checks](references/docs-evals-quick-checks.md) - Add fast, deterministic Quick Checks to Mastra evals for assertions on output text and tool calls without using an LLM or changing scorer workflows.
- [Vitest integration](references/docs-evals-vitest-integration.md) - Run runEvals evaluations as Vitest tests with expectEvals, expectEval, custom matchers, and a score reporter using @mastra/evals/vitest.
- [Build an eval loop](references/docs-guides-build-an-eval-loop.md) - Use datasets, LLM judges, and Mastra Studio experiments to compare agent changes, investigate failures, and build regression checks.

### Reference

- [Reference: Answer relevancy scorer](references/reference-evals-answer-relevancy.md) - Use createAnswerRelevancyScorer() to evaluate how directly an LLM response addresses the input query, with configurable model and scoring options.
- [Reference: Answer similarity scorer](references/reference-evals-answer-similarity.md) - The createAnswerSimilarityScorer() function creates a scorer that evaluates how similar an agent's output is to a ground truth answer.
- [Reference: Bias scorer](references/reference-evals-bias.md) - Use createBiasScorer() to evaluate LLM output for gender, political, racial or ethnic, and geographic bias with an LLM judge.
- [Reference: Quick Checks](references/reference-evals-checks.md) - Use Mastra Quick Checks as zero-LLM, composable micro-scorers for text matching, tool usage, tool ordering, latency, and other deterministic assertions.
- [Reference: Completeness scorer](references/reference-evals-completeness.md) - The createCompletenessScorer() function evaluates how well an LLM's output covers the key elements present in the input.
- [Reference: Content similarity scorer](references/reference-evals-content-similarity.md) - The createContentSimilarityScorer() function measures the textual similarity between two strings, providing a score that indicates how similar they are.
- [Reference: Context precision scorer](references/reference-evals-context-precision.md) - The createContextPrecisionScorer() function creates a scorer that evaluates how relevant and well-positioned retrieved context pieces are for generating expected outputs.
- [Reference: Context recall scorer](references/reference-evals-context-recall.md) - The createContextRecallScorer() function creates a scorer that evaluates how well retrieved context covers the claims in a ground-truth reference answer.
- [Reference: Context relevance scorer](references/reference-evals-context-relevance.md) - The createContextRelevanceScorerLLM() function creates a scorer that evaluates how relevant and useful provided context was for generating agent responses.
- [Reference: Faithfulness scorer](references/reference-evals-faithfulness.md) - The createFaithfulnessScorer() function evaluates how factually accurate an LLM's output is compared to the provided context.
- [Reference: Hallucination scorer](references/reference-evals-hallucination.md) - The createHallucinationScorer() function evaluates whether an LLM generates factually correct information by comparing its output against the provided context.
- [Reference: Keyword coverage scorer](references/reference-evals-keyword-coverage.md) - The createKeywordCoverageScorer() function evaluates how well an LLM's output covers the important keywords from the input.
- [Reference: Multi-turn Judge scorer](references/reference-evals-multi-turn-judge.md) - The createMultiTurnJudgeScorer() function creates an LLM-as-judge scorer that grades a whole conversation against a single plain-English criterion.
- [Reference: Noise sensitivity scorer](references/reference-evals-noise-sensitivity.md) - The createNoiseSensitivityScorerLLM() function creates a CI/testing scorer that evaluates how reliable an agent is when exposed to irrelevant, distracting, or misleading information.
- [Reference: Prompt alignment scorer](references/reference-evals-prompt-alignment.md) - Use createPromptAlignmentScorerLLM() to evaluate whether an agent response follows the user's intent, requirements, completeness, and requested format.
- [Reference: Rubric scorer](references/reference-evals-rubric.md) - The createRubricScorer() function creates an LLM-as-judge scorer that grades an agent's output against a rubric (a checklist of criteria).
- [Reference: Scorer utils](references/reference-evals-scorer-utils.md) - Mastra provides utility functions to help extract and process data from scorer run inputs and outputs. These utilities are particularly useful in the preprocess step of custom scorers.
- [Reference: Summarization scorer](references/reference-evals-summarization.md) - Use createSummarizationScorer() to evaluate whether a summary is supported by its source text and preserves the source's important information.
- [Reference: Textual difference scorer](references/reference-evals-textual-difference.md) - The createTextualDifferenceScorer() function uses sequence matching to measure the textual differences between two strings.
- [Reference: Tone consistency scorer](references/reference-evals-tone-consistency.md) - The createToneScorer() function evaluates the text's emotional tone and sentiment consistency.
- [Reference: Tool call accuracy scorers](references/reference-evals-tool-call-accuracy.md) - Use tool-call accuracy scorers to evaluate whether an LLM selected the expected tools, either from recorded calls or against available tool definitions.
- [Reference: Toxicity scorer](references/reference-evals-toxicity.md) - The createToxicityScorer() function evaluates whether an LLM's output contains racist, biased, or toxic elements.
- [Reference: Trajectory accuracy scorers](references/reference-evals-trajectory-accuracy.md) - Use trajectory accuracy scorers to compare an agent or workflow's tool and step sequence with an expected execution path or ordered trajectory.


Read [assets/SOURCE_MAP.json](assets/SOURCE_MAP.json) for source code references.