Mastra tutorial: build, deploy and debug TypeScript agents

Learn to build a TypeScript teammate with Slack and Notion, inspect traces and compare models. Mastra Connect requires the hosted platform.

Player not loading? Watch on YouTube

Alex Booker builds an AI agent with Mastra, an open source TypeScript framework. The workshop starts with a CLI project template and a local development server, then uses Studio to test tools for web search, scheduled tasks and file operations. A website generation example shows the agent using its workspace and a locally installed Playwright setup.

Booker deploys the teammate to Mastra's platform and connects it to Slack and a Notion knowledge base. He explains that the underlying Node.js server can run on other infrastructure. The demonstrated Connect service, however, requires Mastra's platform. A self-hosted implementation can use custom tools, but developers must maintain authentication themselves. Connect uses a shared team account in this workshop; individual user OAuth is described as planned support.

The memory section explains how an observer condenses message history in the background. In the travel demo, Booker shows roughly 3,000 tokens reduced to 480. He also notes that memory still has limits and eventually drops details, with an option to retain important information for later retrieval.

The final demos inspect a failed tool call through traces and run a small dataset against different models. Viewers learn to compare outputs, latency and cost; automated scorers are discussed but not configured. Booker also says Mastra supports local models, though this workshop does not demonstrate their setup.