•
By Paul Scanlon Introducing Rubric Scorers for Mastra Agents
You can now evaluate your agent’s output with a rubric scorer. Define an array of criteria and an LLM-as-judge grades responses against each one.
A rubric scorer returns a pass/fail score (1 or 0) and a reason summarizing each criterion’s outcome. Failed checks are fed back to the agent so it can re-run — set strategy: 'all' if every criteria should pass, or 'any' if one is enough.
Before rubric scorers, checking an agent’s output against a checklist meant using a post-run eval or hand-rolling a retry loop that fired on failure. With a rubric scorer, the judge validates against the checklist as part of the agentic loop.
Attach it declaratively to your agent’s config, or imperatively at runtime when you call .stream() or .generate().