
Sam Bhagwat
CEO
Sam Bhagwat is the founder and CEO of Mastra. He co-founded Gatsby, which was used by hundreds of thousands of developers. A Stanford graduate and veteran of web development, he authored 'Principles of Building AI Agents' (2025).
Posts by Sam Bhagwat
The 6 Best AI Agent Frameworks (July 2026): Features, Tradeoffs, and Use Cases
This guide compares six leading frameworks, explains where each one excels, and helps you choose the right foundation for your next AI application.
Multi-agent orchestration and how it works
What multi-agent orchestration is, the four workflows Anthropic names (orchestrator-workers, prompt chaining, parallelization, routing), and runnable Mastra code for each, with an interactive explainer.
The 6 Best AI Agent Browser Platforms (July 2026): Features, Tradeoffs, and Use Cases
This guide compares six leading browser platforms for AI agents, explains where each one excels, and helps you choose the right browser infrastructure for your next AI application.
How to Build an AI Software Factory with AI Agents in TypeScript
A governed, observable system where specialized agents own the repetitive work of software development, and humans own the judgment.
The 8 Best AI Agent Email Providers (July 2026): Features, Tradeoffs, and Use Cases
This guide compares eight leading AI agent email providers, explains where each one excels, and helps you choose the right email infrastructure for your next AI application.
What is LLM observability? A span-by-span breakdown
LLM observability records what an agent did at the level of individual model calls and tool executions. This reads the trace of a live agent run span by span from storage, shows what a hallucination and a failed tool call look like, covers where the OpenTelemetry GenAI conventions stand in mid-2026, and walks the four dials that control tracing cost in production.
What are durable AI agents? How state persistence and checkpoints survive a restart
A long-running agent is a durable record that short-lived processes take turns with. This walks through why a context window is not a persistence layer, the three granularities of persistence, how Mastra checkpoints a run to JSON and resumes it on a fresh machine, why a worker can't judge its own work, and the two kinds of state a durable agent has to keep.
What is the Agent2Agent (A2A) protocol? How AI agents delegate work
A2A is a shared standard for one agent to hand work to another on a remote server. This walks through its five-object data model, the agent card, the eight task states, the three ways to watch a task, how trust is decided before work is sent, and how Mastra implements both sides on the official @a2a-js/sdk.
Agent memory: types, techniques, and implementation guide
Learn how agent memory works, from short-term buffers to observational recall. Explore types, engineering patterns, and production implementation strategies.
Agentic workflows: how they work, key components, and how to build them
Learn how agentic workflows work, what components you need, and how to build one step by step, including observability, testing, and real-world use cases.
AI agent framework: a practical guide to choosing and using the right one
Compare AI agent frameworks, learn key selection criteria, and explore TypeScript patterns for agents, workflows, memory, and observability.
AI agent hosting: options, setup, and deployment for production
Compare AI agent hosting options from serverless to containers. Learn how to deploy, observe, and scale TypeScript agents in production.
AI agent observability: a complete guide for production teams
Learn how AI agent observability works, its core pillars, best practices for tracing and evals, and how to monitor agents reliably in production.
AI agent workflows: a complete guide for developers
Learn how AI agent workflows work, common patterns like routing and parallelization, and how to build, evaluate, and monitor agentic workflows in production.
AI agents: what they are, how they work, and how to build with them
Learn what AI agents are, how they reason and act with tools, the five classical types, and practical guidance for building, testing, and deploying your own.
AI workflow automation: how to build reliable pipelines that handle complexity at scale
Build AI workflow automation that handles complexity at scale, with branching, conditions, and human-in-the-loop checkpoints that adapt where rules can't.
LangChain alternatives: the best frameworks for LLM development in 2026
Compare the best LangChain alternatives for 2026, from AI agent frameworks and RAG tools to enterprise platforms and direct LLM access.
RAG chatbot: a complete guide for TypeScript developers
Learn how to build a RAG chatbot in TypeScript, from embeddings and chunking to retrieval, evals, and deployment with Mastra.
RAG framework guide: how retrieval-augmented generation works and which tools to use
Learn how a RAG framework connects LLMs to external data. Covers RAG architecture, tools like LangChain and LlamaIndex, and how to build a pipeline.
Announcing Mastra Harness
Build interactive AI agents with multiple modes, persistent threads, tool approval, and model switching.
Anatomy of a harness: building a coding agent that can run for hours
How Mastra Code's harness wraps the agent loop: conversation-as-channel, event-to-display-state translation, human-in-the-loop tools, observational memory, subagents, modes, and an ordered tool-approval chain.
Building Low-Latency Agents That Help Humans Respond on Live Calls
The engineering and context principles Micro uses to deliver sub-3s answers on live calls with Mastra.
The Rise of Multi-User, Multi-Channel Agents
A look at how Mastra solves the multi-user agent problem: concurrency, memory scoping, tool approval, and per-thread sandboxes.
Announcing Agent Builder
Your internal agent platform.
Announcing Mastra Observability
Production observability for every Mastra project.
Announcing Mastra Platform
Studio, Server, and Memory Gateway. Everything you need to run your agents at scale.
We raised a $22M Series A to help every developer build agents
Mastra raises a $22M Series A led by Spark Capital, bringing total funding to $35M. Plus: the Mastra platform launches today.
Announcing Mastra 1.0!
APIs are locked, server adapters are the new default, and we've shipped thread cloning, composite storage, AI SDK v6 support, and more.
Mastra UI Dojo: Choose your frontend
We have a new UI dojo. It's a collection of working examples showing Mastra agents integrated with the most popular AI UI frameworks. Try it out at ui-dojo.mastra.ai.
Announcing our new logo and brand
We're excited to announce the launch of our new logo and brand for Mastra. We believe developers deserve beautiful tools that match the sophistication and dynamism of the systems they're building.
Announcing our second book: Patterns for Building AI Agents
We're excited to announce the release of our new book: Patterns for Building AI Agents. This book helps you take your agents from prototype to production.
Announcing Mastra v1 beta
Mastra v1 is now in beta, marking the production-ready release of the leading TypeScript framework for AI agents, trusted by top global companies.
Introducing Mastra’s Agent Studio
We've renamed Playground to Studio and it's now shareable with your team.
You can suspend/resume workflows in playground
Mastra workflows now support suspend and resume in Playground. You can also use the new resumeStream API to close streams on suspend and resume them later.
Workflow State: Share Data Across Steps
Workflow state lets you share values across steps without threading them through every `inputSchema` and `outputSchema`.
Announcing our $13m seed round from YC, pg, Gradient, Amjad, Guillermo, Balaji, and 120+ others
Mastra secures $13m from a coalition of legendary investors to fuel AI agent development and production.
Migration Guide: VNext to Standard APIs
Learn how to migrate from Mastra’s VNext streaming methods to the new standard APIs, with details on renaming, compatibility, and key differences between AI SDK v4 and v5.
Model fallbacks: Your safety net for production AI
Model fallbacks ensure your application stays online by automatically switching to backup models when your primary provider fails.
Mastra now supports AI Tracing
Mastra introduces AI Tracing: filter out noise and use multiple observability platforms.
The next evolution of Mastra streaming
We're making our new streaming architecture the default experience starting from `@mastra/core v0.19.0.`
Building agentic copilots with CopilotKit and Mastra
Learn how to build interactive, real-time agentic apps using CopilotKit as a frontend for Mastra agents.
Introducing Output Processors
Introducing output processors: the gatekeepers that sit between your language model's response and your users.
Introducing Cloneable Scorers
Cloneable scorers let you copy, customize, and extend Mastra’s evals into your project.
Introducing Mastra's improved agent orchestration with AI SDK v5 support
Mastra now controls the agent loop and tool calling with increased orchestration capabilities—while maintaining backward compatibility with AI SDK v4 and v5.
Mastra is now Apache 2.0 licensed!
Mastra is now licensed under Apache 2.0, making it easier for everyone to use, modify, and contribute.
Building an AI Research Assistant with vNext Workflows
A deep dive into building MastraManus, an AI research assistant powered by Mastra's vNext workflows.
Announcing the second edition of Principles of Building AI Agents
We're excited to announce the release of v2 of Principles of Building AI Agents.
Announcing Mastra 0.10
Deploy Mastra anywhere
AI prompting techniques
Learn about effective AI prompting techniques, including types of prompts, handling their output, and evals.
FlashGenius: instantly generate flashcards on any topic
How we vibecoded Flash Genius, an instant flashcard generator, in 1 hour
Dynamic Agents: Inserting Runtime Context in Mastra
Mastra's dynamic agents provide a powerful way to handle context in AI applications, without exposing sensitive information to the LLM or relying on globals.
AI with JavaScript in 2025
A dive into four leading open-source JS AI libraries: Vercel AI SDK for model routing, Mastra for agents and workflows, Langfuse for observability, and Stagehand for web automation.
Choosing a JavaScript Agent Framework
When choosing a JavaScript agent framework, consider the needs of your project and the team's expertise. Mastra and LangGraph.js are two leading options.
Introducing Mastra's MCP Registry Registry
Mastra's MCP Registry Registry simplifies the process of finding MCP registries.
Mastra Changelog 2025-03-20
Mastra MCP documentation server, AgentNetwork updates, and more
Mastra Changelog 2025-03-14
Major workflow enhancements, new Mastra Voice features, and more
Announcing our new book: Principles of Building AI agents
Mastra founder Sam Bhagwat is excited to announce the release of our new book: Principles of Building AI agents. This book is a guide for developers who want to rapidly build AI applications.
Building a Code Assistant with Large Context Windows
How we used Mastra and Gemini Flash 2.0 to build a natural language interface for code repositories
Mastra is moving into beta
Mastra moving into beta
Solving the hardest problem in computer science with LLMs
How we use LLMs at Mastra to design clean, intuitive APIs by improving naming, structure, and developer workflow.
Mastra Changelog 2025-02-10
Major updates including AI SDK integration, optimized bundle size through subpath imports, and enhanced storage layer with tracing capabilities
Mastra Changelog 2025-01-31
New Memory API, speech providers, vector store integrations, and core improvements
Multi-Agent AI Travel Planning with Mastra
A demo using Mastra to show how multiple AI agents can work together to plan travel itineraries.
Mastra Changelog 2025-01-24
New `mastra build` command, evals in dev playground, new model support, and an abstracted deployer package
Introducing TTS in Mastra
Use Mastra's TTS system with OpenAI's speech models to create text-to-speech applications, covering voice selection, audio generation, streaming capabilities
Mastra Changelog 2025-01-17
Mastra's changelog for Jan 10th, 2025 through Jan 17th, 2025
Building a NotebookLM clone with an agent orchestrator
A technical guide showing how to build a NotebookLM clone that transforms documents into AI-generated podcasts using Mastra's agent orchestration, Pgvector vector storage, and LlamaIndex for content processing.
Mastra Changelog 2025-01-10
Mastra's changelog for Dec 27th 2024 through Jan 10th, 2025
A framework for the next million AI developers
The next generation of AI products will be built with Apis written in Typescript
AI engineering, two years later
What's changed in AI engineering over the last two years: models, agents, knowledge, tracing, evals