AI Agents
MA

Mastra

TypeScriptOpen SourceAgentsWorkflows

TypeScript-first AI agent framework with built-in workflows, memory, and RAG — designed for production Node.js and Next.js apps.

License

Apache 2.0

Language

TypeScript

79
Trust
Good

Why Mastra?

Building AI agents in TypeScript without switching to Python

You need built-in workflow orchestration alongside agent logic

Next.js projects that want a unified TS agent + RAG solution

Signal Breakdown

What drives the Trust Score

npm downloads
40k / wk
Commits (90d)
260 commits
GitHub stars
5k ★
Stack Overflow
20 q's
Community
Growing
Weighted Trust Score79 / 100

Download Trend

Last 12 months

Tradeoffs & Caveats

Know before you commit

Python is your primary language — use PydanticAI or AutoGen

Simple one-shot LLM calls — this framework adds overhead

Pricing

Free tier & paid plans

Free tier

Open source, free to use

Paid

Free & open-source

Alternative Tools

Other options worth considering

PY
PydanticAI82Strong

Type-safe Python agent framework from the Pydantic team — build agents with structured inputs/outputs validated by Pydantic models.

OA
OpenAI Agents SDK84Strong

OpenAI's official Python SDK for building agents with tool calling, handoffs, and tracing — the successor to the Assistants API.

AG
AutoGen80Strong

Microsoft's framework for building multi-agent AI systems where agents collaborate, debate, and solve complex tasks conversationally.

Often Used Together

Complementary tools that pair well with Mastra

vercel-ai-sdk

Vercel AI SDK

LLM APIs

88Strong
View
openai-api

OpenAI API

LLM APIs

87Strong
View
LF

Langfuse

LLM Observability

85Strong
View

Learning Resources

Docs, videos, tutorials, and courses

Get Started

Repository and installation options

View on GitHub

github.com/mastra-ai/mastra

npmnpm install @mastra/core

Quick Start

Copy and adapt to get going fast

import { Mastra } from '@mastra/core';
import { openai } from '@ai-sdk/openai';

const mastra = new Mastra();

const agent = mastra.createAgent({
  name: 'assistant',
  model: openai('gpt-4o'),
  instructions: 'You are a helpful assistant.',
});

const result = await agent.generate('Hello!');
console.log(result.text);

Community Notes

Real experiences from developers who've used this tool