Mastra 1.0: The TypeScript Framework That Takes AI Agents to Production
Server Adapters, Composite Storage, Observational Memory: what the stable v1 changes for your TypeScript agents and when it replaces three libraries.
On January 20, 2026, the team behind Gatsby released the stable version of Mastra 1.0. After a beta launched in November 2025, 94 fixes and several new features, the TypeScript framework for AI agents positions itself as the "batteries included" solution for teams that want to go beyond prototypes.
With over 300,000 weekly npm downloads, 21,000 stars on GitHub and production deployments at Replit, PayPal and Marsh McLennan, Mastra is no longer an experimental project. Here is what v1 brings to the table.
Where Mastra comes from
Mastra was founded in October 2024 by Sam Bhagwat, Abhi Ayer and Shane Thomas, who collaborated for nearly a decade on Gatsby and other open-source projects. The framework is backed by Y Combinator (W25 batch) and raised $13 million in seed funding from over 100 Silicon Valley investors.
The goal: give TypeScript developers a complete framework for building AI agents, without assembling disparate building blocks. Agents, workflows, memory, RAG, MCP, observability, evaluation: everything lives in a single ecosystem.
What v1 changes
Mastra 1.0 is not a rewrite. The team shipped features throughout the 0.x releases, then stabilized the APIs, unified conventions and fixed production feedback. The v1 bump marks framework maturity, not a pivot.
Stabilized APIs
Experimental APIs (agent.network(), Mastra Auth, multi-engine workflows via Inngest) are now stable. Conventions have been unified: get for a single object, list for a collection. Imports use subpath entry points (@mastra/core/agent, @mastra/core/tools).
To migrate from v0, an automated codemod handles most changes:
npx @mastra/codemod@latest v1Server Adapters: Mastra inside your existing server
This is the major architectural shift. Previously, Mastra required its own server process. Now, Server Adapters let you integrate Mastra directly into an Express, Hono, Fastify or Koa application.
import express from 'express'
import { MastraServer } from '@mastra/express'
import { mastra } from './mastra'
const app = express()
const server = new MastraServer({ app, mastra })
await server.init()
// Your agents, workflows and tools are automatically
// exposed as HTTP endpoints
app.listen(3001)Your agents, workflows, tools and MCP servers become HTTP endpoints with no extra configuration. You keep full control over middleware, authentication and deployment.
Composite Storage: one backend per domain
v1 introduces Composite Storage, replacing the single-storage model. You can assign a different backend to each domain: PostgreSQL for workflows, LibSQL for memory, ClickHouse for observability. This lets you optimize cost, latency and scalability per data type, instead of applying a single compromise across the board.
The features that matter
Beyond API stabilization, Mastra 1.0 ships features that do not exist elsewhere in the TypeScript ecosystem.
Agent Network
Agent Network is Mastra's multi-agent orchestration layer. Unlike predetermined workflows, it lets an agent dynamically route tasks to other agents, workflows or tools, with no predefined execution path.
import { NewAgentNetwork } from '@mastra/core'
import { openai } from '@ai-sdk/openai'
const network = new NewAgentNetwork({
id: 'support-network',
name: 'Support Network',
instructions: 'Coordinate support and research agents.',
model: openai('gpt-5.6-terra'),
agents: { triageAgent, technicalAgent, billingAgent },
workflows: { escalationWorkflow },
tools: { searchKnowledgeBase },
})
// Automatic routing to the right agent
const result = await network.generate(
'Customer reports a 500 error on the payment page'
)
// Autonomous multi-step orchestration
const plan = await network.loop(
'Analyze the last 50 tickets, identify patterns and write a report'
)Two execution modes: .generate() for simple routing (a single call), .loop() for complex tasks requiring multiple agents in sequence. Routing quality depends directly on how clearly you describe each agent and workflow.
Observational Memory
This is arguably the most significant innovation. Observational Memory makes a small context window behave like a large one, while preserving long-term memory.
The mechanism: when message history exceeds a threshold (30,000 tokens by default), an "observer" agent compresses messages into structured observations, 5 to 40 times smaller than raw messages. When observations exceed 40,000 tokens, a "reflector" agent removes obsolete observations.
Results on the LongMemEval benchmark: 94.87% with gpt-5-mini, over 3 points above any previous score. According to VentureBeat, this approach reduces costs by 10x compared to standard RAG on long contexts.
import { Agent } from '@mastra/core/agent'
import { Memory } from '@mastra/memory'
const agent = new Agent({
id: 'support-agent',
model: openai('gpt-5.6-terra'),
memory: new Memory({
observationalMemory: true,
}),
instructions: 'You are a technical support agent.',
})Built-in scorers
Mastra includes a scorer system to evaluate the quality of your agent outputs. The createScorer function supports both deterministic evaluations (coded rules) and the LLM-as-a-judge pattern. Scorers integrate into your CI pipeline to detect quality regressions whenever you change a prompt, tool or model.
Getting started with Mastra 1.0
For a new project:
npm create mastra@latestFor an existing project, the migration guide documents every change and the codemod automates the most common transformations.
The official documentation is comprehensive, and the team maintains an active Discord with close to 5,000 developers. Mastra Studio provides a visual interface to test and debug your agents without extra code.
It is the stack I often pick for agents and workflows powered by language models, when the all-in-one ecosystem saves weeks of plumbing.
When to choose Mastra
Mastra is not the only agentic framework in TypeScript. The Vercel AI SDK 6 offers a more native React/Next.js integration. The Claude Agent SDK excels at multi-agent orchestration with Claude. Google ADK is optimized for Gemini and multimedia streaming.
Mastra makes sense when you need an all-in-one framework: agents, workflows, memory, RAG, MCP, evaluation and observability in a single ecosystem. If you are already assembling three or four libraries to cover these needs, Mastra replaces them with a coherent solution.
The fact that companies like Replit, PayPal and Adobe use it in production is a strong signal. The framework is no longer a bet on the future, it is a tool that has proven itself.