Mastra
agent-framework24,848MIT

Mastra

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

Updated Jun 7, 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

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 24,848 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 24,848 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

Comments coming soon

Configure NEXT_PUBLIC_GISCUS_REPO_ID and NEXT_PUBLIC_GISCUS_CATEGORY_ID at giscus.app to enable.