Mastra is an open source TypeScript framework for building AI agents: agents, workflows, memory, and a model router that reaches dozens of providers through one interface, in one package. An agent wraps a model with instructions and tools and runs its own loop, planning, picking tools, and iterating until it produces a final answer or hits a stop condition. Workflows are the separate primitive for the parts of a pipeline you don't want left to a model's judgment: steps with typed schemas, chained with .then(), fanned out with .parallel(), and routed with .branch().
Tracing is built in rather than bolted on. Every model call, tool call, and workflow step becomes a span without manual instrumentation, and the OtelExporter package ships those spans in the OpenTelemetry GenAI semantic conventions: span names like chat {model} and execute_tool {tool_name}, with attributes such as gen_ai.usage.input_tokens and gen_ai.request.model. Prompt and completion content stays out of the span by default; turning it on is one option (includeContentAttributes), the same opt-in stance the GenAI conventions take generally. Logs correlate back to the span they happened inside through both OTel's own trace context and Mastra's own mastra.traceId and mastra.spanId attributes.
Evaluation runs through Scorers, graders that score an agent's output by one of three methods, model-graded, rule-based, or statistical, and return a 0 to 1 score with reasoning. Prebuilt scorers cover answer relevancy and faithfulness against retrieved context, and running them from CI is what catches a prompt change that quietly degrades output before it ships.
Scorers are the current name. Mastra's v1 release, in January 2026, replaced the evals API they're built on (runExperiment became runEvals, importing from @mastra/core/scores became @mastra/core/evals), so a guide written before that release describes the same mechanism under different names.
No questions answered under this concept yet. The rest of the index is filled in.
Try Tessary on Cloud.
free · 10,000 traces a month · 1 GB · 30-day retention · $10 one-time credit for triage and RCA · no credit card