Framework · Orchestration Frameworks

Mastra

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).

Solution

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

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related