Skip to content

Article

Mastra Classifiers

Mastra's classifier primitive defines choice, score, and boolean questions against an evaluation model such as jev-latest, returning a probability for each criteria key so workflow branch logic can act on the answer.
Format
Article
Reading time
2 min
Published by
Community
Author
Paul Scanlon
Last verified
Oct 2026

Highlights

  • npm install @mastra/core @ai-sdk/typesafe-ai; classifiers need @mastra/core 1.69.0 or later, added in PR #24458.
  • A classifier has an id, a model, and questions typed choice, score, or boolean; boolean answers with the probability the answer is true.
  • Questions are keyed by name and all evaluate the same input; instructions and criteria accept any JSON-compatible value, objects and arrays included.
  • Each criteria key receives a probability and the highest one becomes the choice the workflow branches on to select an agent.
  • Classifiers register on the Mastra instance beside agents, tools, and workflows, and a workflow calls .classifier() before mapping the answer and branching.

Watch out

A vendor feature announcement: it shows one marketing example and links the classifier, workflow, ClassifierProcessor, and createClassifierScorer references, but reports no accuracy, cost, or latency figures. Using it requires a TypeSafe API key, Mastra 1.69.0 or newer, and inputs that fit the declared question types.

Questions about this entry

Short answers drawn from the linked project or page.

Reactions & coverage

Posts, threads, and videos about this entry from around the web.

Facebook: Intake Router keeps diagnosis out of the answer space at the front desk.

FacebookClinicnotes

X: OpenRouter Decision Model Rankings

X: herdr + jev, an agent router

X: A group chat bot with decision room routing

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai