# Mastra

A TypeScript framework for building AI-powered applications and agents, with model routing across many providers, a graph-based workflow engine, memory and built-in evaluation.

Mastra is a TypeScript framework for building AI-powered applications and agents, meant to cover everything from early prototypes to production. It integrates with frontend and backend frameworks such as React, Next.js and Node, or can be deployed as a standalone server.

It routes model calls to more than 40 providers, including OpenAI, Anthropic and Gemini, through one interface. Agents reason about goals, choose tools and iterate until they produce a final answer, while a graph-based workflow engine, using `.then()`, `.branch()` and `.parallel()` syntax, orchestrates more explicit multi-step processes, including suspending and resuming a run for human-in-the-loop approval. Agents can be given conversation history, data retrieved from APIs, databases or files, and longer-term memory.

Mastra can author Model Context Protocol servers to expose agents and tools to other systems, integrates with UI libraries such as Vercel's AI SDK UI and CopilotKit, and includes built-in evaluation and observability features.

Website: https://mastra.ai
