Lattice
Skip to content

Mastra

frameworkSelf-hostedmastra.ai

Mastra is a self-hosted framework in the Agent Frameworks layer of the AI stack. TypeScript agent framework with typed workflows and evals.

By Facts verifiedmethod

Licence
Apache-2.0
Language
TypeScript
Cost
free
Owned by
Applied Engineering

Use Mastra when

TypeScript agents with typed workflows and evals built in.

Skip Mastra when

You are working in Python.

Turns a model call into a multi-step program. See every agents tool.

Also belongs in

  • Evaluation & ObservabilityIts eval harness ships inside the framework, so grading an agent is part of running it rather than a separate tool.
Badge this entry
Lattice badge: Mastra verified 2026-09
[![Mastra on Lattice: verified 2026-09](https://lattice.kunjshah.in/agent-frameworks/mastra/badge.svg)](https://lattice.kunjshah.in/agent-frameworks/mastra)

Rules of thumb

  • An agent loop that cannot survive a deploy will eventually cause real damage. Durability and tool permissions are the controls, not the prompt.
  • Start with a single model call and plain code. Add an agent framework when the control flow genuinely depends on the model's output.
  • Give every side-effecting tool an idempotency key. Retries are guaranteed; duplicate payments should not be.

Quick answers

Is Mastra open source?
Yes. Mastra is open source under the Apache-2.0 licence. It is free to use.
What are the alternatives to Mastra?
The closest alternatives to Mastra are Vercel AI SDK and OpenAI Agents SDK.

Ask an AI about this page

Opens the assistant with this page’s link and a question already filled in.

Reading on agents

Alternatives to Mastra

Listed as an alternative to

  • Vercel AI SDK

Also in agents

  • LangChain
  • LlamaIndex
  • Pydantic AI
  • AutoGen
  • CrewAI
  • Semantic Kernel
  • OpenAI Agents SDK
  • Agno
  • Claude Agent SDK
  • Letta
  • smolagents
  • Vercel AI SDK