Build AI agents your users actually depend on.

Mastra is a TypeScript framework that gives you everything you need to prototype fast and ship with confidence. Create your first agent with a single command and start building.

Quickstart

Use this pre-built prompt to get started faster.

Create a new Mastra project

Mastra = framework for AI apps + agents on modern TypeScript stack. Before run command, ask these questions one by one. Wait for answers unless already given:

  1. Project name? (default: "my-mastra-app")
  2. Provider? (default: "openai", options: "openai", "anthropic", "groq", "google", "cerebras", "mistral")

Provider rules:

  • Allowed provider -> use it.
  • Any other value -> use "openai".

Run with answers:

npm create mastra@latest <project-name> --default --llm <provider>

After project created, go to project dir. Start dev server:

npx bgproc start -n <project-name> -w -- npm run dev

Start Mastra Studio at http://localhost:4111. Studio = UI for build, test, manage agents, workflows, tools.

Also tell: Mastra model router give 3000+ models from many providers: Models

Create a new project

Run this command to create a new project:

  • npm
  • pnpm
  • Yarn
  • Bun
npm create mastra@latest
pnpm create mastra
yarn create mastra
bunx create-mastra

You can open Studio immediately, which is an interactive UI for your Mastra project. See the quickstart guide for a full walkthrough.

Integrate with your framework

Add Mastra to an existing project, or create a new app with your preferred framework:

For other frameworks, see the framework integration guides.

What you can build

Here are some of the ways you can use Mastra:

  • Embed agents in your product
    Add AI capabilities to your platform so your users can build or interact with agents.
  • Customer-facing assistants
    Build agents that handle inquiries, schedule appointments, send reminders, and answer questions via chat, WhatsApp, or voice.
  • Internal copilots
    Help employees work faster with AI that understands your domain—HR queries, clinical documentation, sales prep, or document generation.
  • Data analysis agents
    Let users query databases and dashboards in natural language. Connect to your data sources and return answers, charts, or reports.
  • Content automation
    Generate, transform, and manage structured content at scale—whether for a CMS, knowledge base, or documentation system.
  • DevOps & engineering automation
    Automate deployments, debug production issues, manage infrastructure, and handle on-call workflows.
  • Sales & GTM workflows
    Turn customer conversations into structured tasks, generate investment memos, or automate outreach sequences.

Not ready to build yet?

Watch this quick introduction:

Mastra10K subscribers