Mastra
agent-framework28,892MIT

Mastra

TypeScript agent framework with built-in model routing, agent memory, tools, and observability.

Updated Oct 19, 2026
Platforms
linux, macos, windows
Pricing
free-open-source
Status
active
License
MIT

What it does

Core capabilities at a glance

  • Model routing with fallback and ensemble strategies
  • Built-in agent memory (vector, KV, file)
  • Tool creation and automatic function calling
  • Workflow and chain definitions
  • Built-in observability and tracing
  • TypeScript-first developer experience

Deep dive

The full breakdown - performance, comparisons, and setup

Mastra

Mastra is the TypeScript-native agent framework that the JavaScript ecosystem has been waiting for. It brings agent capabilities to the Node.js and TypeScript world with clean APIs.

What it is

Mastra is a TypeScript framework for building AI agents. It includes model routing (with fallback and ensemble strategies), built-in memory systems, tool creation, workflow definitions, and observability.

Get started

npm install mastra
import { Agent } from "mastra";
import { ollama } from "@mastra/ollama";
 
const agent = new Agent({
  model: ollama("qwen3:30b"),
  instructions: "You are a helpful assistant"
});
await agent.send("Hello!");

When to use something else

From the community

What users are saying

“Congrats on launching! Curious how early the Mastra team thinks people should be thinking about evals and setting up a pipeline for them.”

“Language, although an important factor, should not be the only factor to decide using a tool. I'm curious is there something unique Mastra is bringing to the table, compared to other alternatives.”

“Mine is written in TypeScript and I still think it's more ergonomic than anything else I'm seeing in the wild. Maybe there's finally an appetite for this stuff and I should release it. The Mastra dashboard looks pretty nice, might take some notes from it.”

Frequently asked

Quick answers to common questions

What is Mastra?

Mastra is a agent-framework tool for local AI workloads. TypeScript agent framework with built-in model routing, agent memory, tools, and observability.

Is Mastra free and open source?

Yes, Mastra has 28,892 GitHub stars and is licensed under MIT. You can self-host it for free on linux, macos, windows.

What platforms does Mastra support?

Mastra runs on linux, macos, windows.

What hardware do I need for Mastra?

The hardware requirements depend on which models you run. Check our hardware directory for compatible GPUs and systems. Mastra has 28,892 GitHub stars and an active community.

Does Mastra support GPU acceleration?

Mastra supports GPU acceleration via CUDA, Metal, or Vulkan depending on your platform. For the best performance, pair it with an NVIDIA RTX 4090 or 5090.

What are the best alternatives to Mastra?

Popular alternatives include other agent-framework tools in our directory. Browse our full collection at /tool for comparisons, community reviews, and benchmark data to find the right fit for your workflow.

How much does Mastra cost?

Mastra is free-open-source. It is completely free and open source to self-host.

Pairs well with

Complementary tools, models, and hardware