Mastra
Prototype and productionize AI features with a modern JS/TS stack
Mastra
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack. It includes everything you need to go from early prototypes to production-ready applications. Mastra integrates with frontend and backend frameworks like React, Next.js, and Node, or you can deploy it anywhere as a standalone server. It's the easiest way to build, tune, and scale reliable AI products.
Some of its highlights include: Model routing, agents, workflows, human-in-the-loop, context management, and MCP.
The documentation is organized into key sections:
- Docs: Core documentation covering concepts, features, and implementation details
- Models: Mastra provides a unified interface for working with LLMs across multiple providers
- Guides: Step-by-step tutorials for building specific applications
- Reference: API reference documentation
Each section contains detailed docs that provide comprehensive information about Mastra's features and how to use them effectively.
These are the most popular starting points:
- Get Started with Mastra: Create a new project with the
create mastraCLI or use one of the framework quickstart guides - Agent Overview: Agents use LLMs and tools to solve open-ended tasks. They 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.
- Workflows Overview: Workflows let you define complex sequences of tasks using clear, structured steps rather than relying on the reasoning of a single agent.
- Memory Overview: Memory gives your agent coherence across interactions and allows it to improve over time by retaining relevant information from past conversations.
Docs
- Get Started
- Fundamentals
- Studio
- Agents
- Memory
- Workflows
- Editor
- Streaming
- MCP
- Workspaces
- Browser
- Server
- Deployment
- Observability
- Evals
- Mastra platform
- RAG
- Voice
- Build with AI
- Community
Models
Guides
- Overview
- Getting Started
- Concepts
- Agent Frameworks
- Agentic UIs
- Deployment
- Tutorials
- Fundamentals
- Multi-agent systems
- Workspaces
- GitHub Actions: PR Description
- Channels: Slack Assistant
- Publishing an MCP Server
- WhatsApp Chat Bot
- Migrations
Reference
- Overview
- Configuration
- ACP
- Agents
- Agent Class
- Channels
- DurableAgent
- .generate()
- .generateLegacy()
- .getDefaultGenerateOptionsLegacy()
- .getDefaultOptions()
- .getDefaultStreamOptionsLegacy()
- .getDescription()
- .getInstructions()
- .getLLM()
- .getMemory()
- .getMetadata()
- .getModel()
- .getTools()
- .getVoice()
- .listAgents()
- .listScorers()
- .listTools()
- .listWorkflows()
- .network()
- AI SDK
- Auth
- Browser
- CLI
- Client SDK
- Core
- Mastra Class
- MastraModelGateway
- .addGateway()
- .getAgent()
- .getAgentById()
- .getDeployer()
- .getEditor()
- .getGateway()
- .getGatewayById()
- .getLogger()
- .getMCPServer()
- .getMCPServerById()
- .getMemory()
- .getScorer()
- .getScorerById()
- .getServer()
- .getStorage()
- .getTelemetry()
- .getVector()
- .getWorkflow()
- .listAgents()
- .listGateways()
- .listLogs()
- .listLogsByRunId()
- .listMCPServers()
- .listMemory()
- .listScorers()
- .listVectors()
- .listWorkflows()
- .setLogger()
- .setStorage()
- Deployer
- Editor
- Evals
- createScorer()
- filterRun()
- MastraScorer
- runEvals()
- Scorer Utils
- Built-in scorers
- Answer Relevancy Scorer
- Answer Similarity Scorer
- Bias
- Completeness
- Content Similarity Scorer
- Context Precision Scorer
- Context Relevance Scorer
- Faithfulness
- Hallucination
- Keyword Coverage Scorer
- Noise Sensitivity Scorer
- Prompt Alignment Scorer
- Textual Difference Scorer
- Tone Consistency Scorer
- Tool Call Accuracy Scorers
- Toxicity
- Trajectory Accuracy Scorers
- Datasets
- Dataset Class
- DatasetsManager Class
- .addItem()
- .addItems()
- .compareExperiments()
- .create()
- .delete()
- .deleteExperiment()
- .deleteItem()
- .deleteItems()
- .get()
- .getDetails()
- .getExperiment()
- .getItem()
- .getItemHistory()
- .list()
- .listExperimentResults()
- .listExperiments()
- .listItems()
- .listVersions()
- .startExperiment()
- .startExperimentAsync()
- .update()
- .updateItem()
- Harness
- Mastra platform
- Memory
- Observability
- Logging
- Metrics
- Tracing
- Configuration
- Instances
- Interfaces
- Span filtering
- Spans
- Bridges
- Exporters
- Processors
- Processors
- BatchPartsProcessor
- CostGuardProcessor
- LanguageDetector
- MessageHistory
- ModerationProcessor
- PIIDetector
- PrefillErrorHandler
- Processor Interface
- PromptInjectionDetector
- ProviderHistoryCompat
- RegexFilterProcessor
- ResponseCache
- SemanticRecall
- SkillSearchProcessor
- StreamErrorRetryProcessor
- SystemPromptScrubber
- TokenLimiterProcessor
- ToolCallFilter
- ToolSearchProcessor
- UnicodeNormalizer
- WorkingMemory
- PubSub
- RAG
- Server
- Signals
- Storage
- Streaming
- Templates
- Tools & MCP
- Vectors
- Amazon S3 Vector Store
- Astra Vector Store
- Chroma Vector Store
- Cloudflare Vector Store
- Convex Vector Store
- Couchbase Vector Store
- DuckDB Vector Store
- ElasticSearch Vector Store
- Lance Vector Store
- libSQL Vector Store
- MongoDB Vector Store
- OpenSearch Vector Store
- PG Vector Store
- Pinecone Vector Store
- Qdrant Vector Store
- Turbopuffer Vector Store
- Upstash Vector Store
- Voice
- AWS Nova Sonic
- Azure
- Cloudflare
- Composite Voice
- Deepgram
- ElevenLabs
- Events
- Google Gemini Live
- Inworld
- Inworld Realtime
- Mastra Voice
- Murf
- OpenAI
- OpenAI Realtime
- PlayAI
- Sarvam
- Speechify
- xAI Realtime
- .addInstructions()
- .addTools()
- .answer()
- .close()
- .connect()
- .getSpeakers()
- .listen()
- .off()
- .on()
- .send()
- .speak()
- .updateConfig()
- Workflows
- Workspaces
- AgentCoreRuntimeSandbox
- AgentFSFilesystem
- AzureBlobFilesystem
- BlaxelSandbox
- DaytonaSandbox
- DockerSandbox
- E2BSandbox
- FilesSDKFilesystem
- GCSFilesystem
- GoogleDriveFilesystem
- LocalFilesystem
- LocalSandbox
- ModalSandbox
- S3Filesystem
- SandboxProcessManager
- VercelMicroVMSandbox
- VercelSandbox
- Workspace Class
- WorkspaceFilesystem
- WorkspaceSandbox
Meet the modern standard for public facing documentation. Beautiful out of the box, easy to maintain, and optimized for user engagement.
Search through billions of items for similar matches to any object, in milliseconds. It’s the next generation of search, an API call away.
Build and deploy reliable background jobs with no timeouts and no infrastructure to manage.
Get the simple developer experience of SQLite in production, and scale your multi-tenant backend with unlimited databases.
Upstash is a serverless data platform providing low latency and high scalability for real-time applications.
One-click deployments built for teams, tuned for Laravel, loaded with tools and goodies you're going to love.