Full-Code · Orchestration Frameworksactive

Mastra

Type: full-code  ·  Vendor: Kepler Software, Inc.  ·  Language: TypeScript  ·  License: Apache-2.0 (ee/ directories under Mastra Enterprise License)  ·  Status: active  ·  Status in practice: emerging  ·  First released: 2024-08-06

Links: homepage docs repo

Provide a TypeScript-native framework for AI agents and multi-step workflows, where Agents run an LLM tool-calling loop bounded by maxSteps, Workflows give graph-based control flow with suspend/resume snapshots, and integrations cover MCP (client+server), RAG, memory, voice, and evals.

Description. Mastra is an Apache-2.0 TypeScript framework from Kepler Software, Inc. ('from the team behind Gatsby', per repo). It ships two execution shapes: Agents which 'reason about goals, decide which tools to use, retain conversation memory, and iterate internally until the model emits a final answer or an optional stop condition is met' (docs/agents/overview), and Workflows which give 'full control over how tasks are broken down' via .then() / .branch() / .parallel() / .dountil() / .dowhile() / .foreach() over typed steps. Both can suspend and resume — snapshots persist to the configured storage provider across deployments and restarts. Integrates with 40+ model providers, exposes Mastra tools/agents/workflows over MCP via MCPServer (and consumes external MCP via MCPClient), and ships built-in evals (Scorers), memory, RAG, and voice (TTS/STT/STS).

Agent loop shape. Imperative tool-calling agent loop with explicit maxSteps cap (default 5). Starting v0.14.0 Mastra owns the loop directly rather than delegating to AI SDK. Workflows compose typed steps via graph operators (.then/.branch/.parallel/.dountil/.dowhile/.foreach) with suspend()/resume() snapshots. Workflows and agents compose — workflow steps can call agents, agents can be configured with sub-agents (supervisor pattern), agents can be exposed over MCP.

Primary use cases

  • TypeScript-native agents with workflow orchestration
  • long-running agents that pause and resume across deployments
  • supervisor agents with subagents
  • multi-channel voice + chat assistants

Key concepts

  • Agent react (docs)Reasons about goals, uses tools, retains memory, iterates internally.
  • Workflow (docs)Graph-based orchestration with .then/.branch/.parallel/.dountil/.dowhile/.foreach.
  • createTool tool-use (docs)Custom tools with Zod-typed input/output schemas.
  • Memory (docs)Working memory + semantic recall + conversation history across interactions.
  • Suspend & Resume agent-resumption (docs)suspend() persists workflow state to storage; resume continues across deployments and restarts.
  • Supervisor Agents supervisor (docs)Supervisor coordinates subagents (configured on the agents property); migration path from deprecated AgentNetwork.
  • MCPServer / MCPClient mcp (docs)Bidirectional MCP — consume external MCP and expose Mastra tools/agents/workflows over MCP.

Patterns this full-code implements

Neighbourhood

Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.