Guides
These guides explain how Mastra's features work together when building AI applications. They cover design decisions, runtime behavior, and patterns you can apply to your own projects.
Multi-agent systems
Compare handoffs, workflows, supervisors, and council patterns to choose how agents collaborate.
Context engineering
Combine instructions, tools, retrieval, and memory to give agents the context they need.
Agent lifecycle
Follow an agent run from input preparation through model and tool calls to the final result.
Authentication and identity
Protect endpoints, pass trusted user context to agents and tools, and enforce data boundaries.
MCP authentication
Choose connection credentials, protect an MCP server, and control access to tools and data.
Streaming
Stream agent and workflow responses, handle events, and integrate with AI SDK interfaces.
Build an eval loop
Use datasets, judges, and Studio experiments to compare agent changes and build regression checks.