BASE

Mastra

Mastra

AI / ML development tool · Free + paid

A TypeScript framework for AI agents, workflows, and retrieval with model integrations: it helps build an AI application backend in a single stack.

Also known as: mastra-ai/mastra; mastra-ai; mastra; mastra-agent-framework

Resource illustration: Mastra

Open resource ↗

What you can use for free

Core Apache-2.0 packages for your own agent application.

Paid features and costs

EE modules, managed services, and selected model APIs are paid for separately.

Access and limitations

Core Apache-2.0 packages for your own agent application. EE modules, managed services, and selected model APIs are paid for separately.

Use cases

  • Build an application's TypeScript agent workflow
  • Connect retrieval/state to the backend and inspect the execution trace

Example workflow

A possible workflow; this is not a report of hands-on testing.

Build an application's TypeScript agent workflow.

Before you start

  • Test documents or tasks, and a quality criterion.
  • Models, a runtime, and a computing budget.

Steps

  1. Define agent tools, the model provider, and workflow stages.
  2. Connect retrieval/state to the backend and inspect the execution trace.
  3. Connect the workflow to the application and make errors observable.

Check your result

  • Check the result against reference examples and invalid inputs.
  • Inference costs, model rights, and data handling have been established.

Choosing Mastra

Build an application's TypeScript agent workflow

Choose this when

  • Build an application's TypeScript agent workflow
  • Connect retrieval/state to the backend and inspect the execution trace

Requirements

  • Configured storage is required to preserve workflow state.

Things to consider

  • Costs and limits of free use: EE modules, managed services, and selected model APIs are paid for separately.
  • Terms of use: Code outside ee/ is Apache-2.0; ee/ uses the Mastra Enterprise Edition License. Development/Testing is permitted in an environment without user data, customer data, or business operations; redistribution is not permitted. Production requires a current written agreement and a valid scoped License Key.
  • The EE Development and Testing grant excludes processing data of end users/customers/business operations and does not permit redistribution. Production requires both a written Agreement and a valid scoped License Key.

Frequently asked questions

What can you use for free in Mastra?

Core Apache-2.0 packages for your own agent application.

What additional costs might arise with Mastra?

EE modules, managed services, and selected model APIs are paid for separately.

What terms of use matter for Mastra?

Code outside ee/ is Apache-2.0; ee/ uses the Mastra Enterprise Edition License. Development/Testing is permitted in an environment without user data, customer data, or business operations; redistribution is not permitted. Production requires a current written agreement and a valid scoped License Key.

How do you get started with Mastra?

Define agent tools, the model provider, and workflow stages. Connect retrieval/state to the backend and inspect the execution trace. Connect the workflow to the application and make errors observable.

When should I choose a Mastra workflow over an independently acting agent?

Agents decide which tools to call; graph workflows explicitly define order through .then(), .branch(), and .parallel(). Workflows can suspend/resume, and storage retains execution state. Mastra connects to React/Next.js/Node.js applications or runs as a standalone server; model routing and MCP separate orchestration from a specific provider.

License

Code outside ee/ is Apache-2.0; ee/ uses the Mastra Enterprise Edition License. Development/Testing is permitted in an environment without user data, customer data, or business operations; redistribution is not permitted. Production requires a current written agreement and a valid scoped License Key.

Apache 2.0 — permissive license with patent terms

Mastra code outside ee/; dependencies retain their own terms.

You can use and modify the code in commercial and closed-source projects. When distributing it, retain the license and relevant notices, identify modified files, and include NOTICE if provided. Authors grant a limited patent license for their contributions; it does not grant permission to use trademarks.

License terms

Proprietary terms — the vendor determines your rights

Mastra Enterprise Features/ee/: a limited Dev/Test grant; Production requires an Agreement and a valid License Key.

Use of the software or service is governed by its Terms/EULA and the chosen plan. Free access does not automatically grant rights to modify and distribute source code, resell assets, or use outputs commercially. The specific product's terms define permitted use, export, and commercial rights.

Technologies and topics

  • Mastra
  • ml
  • Development

Sources

Other resources