Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Mastra AI Agents: TypeScript, RAG, MCP & Production Systems
New
2 students

Mastra AI Agents: TypeScript, RAG, MCP & Production Systems

Build TypeScript AI agents with Mastra: RAG, MCP, workflows, memory, multi-agent systems, security and deployment
Last updated 11/2026
English

What you'll learn

  • Build and configure TypeScript AI agents with Mastra, model providers, clear instructions, and validated structured outputs.
  • Create custom tools with Zod validation, external API integrations, and safe execution controls.
  • Implement context-aware agents using dynamic instructions, request context, conversation threads, and persistent memory.
  • Build RAG pipelines with document ingestion, chunking, embeddings, vector search, reranking, and grounded answers with citations.
  • Design workflows with conditional logic, parallel execution, loops, human approvals, persistence, and error recovery.
  • Build and connect MCP servers that expose tools, resources, and prompts with appropriate security boundaries.
  • Coordinate multiple agents using handoffs, supervisor patterns, delegation, and shared workflows.
  • Apply context engineering, dynamic tool selection, planning, and model routing with fallback strategies.
  • Develop durable and event-driven agent systems with background execution, scheduling, and sandboxed workspaces.

Course content

22 sections • 168 lectures • 26h 22m total length
  • Welcome & Course Overview6:01
  • Explore the Mastra Learning Platform4:29
  • Guided Learning Walkthrough: Study, Practice, and Track Your Progress5:02
  • AI Tutor Live Lab: Choose a Claude Model, Ask Questions, and Save Answers5:24
  • TypeScript Walkthrough: Listen, Follow the Code, and Continue Each Explanation4:41
  • Install and Run the Mastra Learning Platform5:31
  • Platform Tech-Stack and Architecture6:03
  • Learning platform github repo10:15

Requirements

  • Basic JavaScript or TypeScript knowledge, including functions, objects, modules, and async/await.
  • Familiarity with Node.js, npm, terminal commands, and basic HTTP API concepts.
  • A computer with internet access, Node.js, and a code editor such as Visual Studio Code.
  • Access to an LLM provider account and API credentials for exercises that use hosted models. Provider usage charges may apply.
  • No previous Mastra, RAG, MCP, or multi-agent development experience is required. These topics are introduced progressively before moving into advanced production patterns.
  • Familiarity with Git, databases, and Docker is helpful for the advanced sections, but is not required to begin.

Description

This course contains the use of artificial intelligence
Build AI agents that do more than answer questions. Create systems that retrieve knowledge, use tools, coordinate workflows, and handle real production challenges.

Welcome to Mastra AI Agents: TypeScript, RAG, MCP & Production Systems, a comprehensive, 80-lecture course that takes you from project setup and your first agent to advanced architectures for enterprise applications.

You will explore how to connect language models to tools, memory, documents, external services, and other agents. Along the way, you will learn how to validate responses, inspect execution, recover from failures, evaluate quality, and control access and costs.

Start with strong foundations

Understand the Mastra ecosystem, project architecture, and core building blocks. Configure model providers, write agent instructions, register your first agent, and inspect its behavior in Mastra Studio. Then make responses more dependable through structured output, typed results, streaming, error handling, and retries.

Give your agents useful tools and context

Build custom tools with Zod validation and connect external APIs. Explore dynamic instructions, request context, context-aware tools, execution options, and input and output processing. Learn how validation and authorization support safer tool execution.

Build conversations, memory, and knowledge retrieval

Work with threads, conversation state, short-term memory, and persistent memory. Develop retrieval-augmented generation (RAG) systems using document ingestion, preprocessing, chunking, embeddings, vector stores, metadata, and reranking. Learn patterns for producing grounded answers with supporting citations.

Orchestrate workflows and human decisions

Move beyond a single model call with conditional branches, parallel execution, loops, reusable sub-workflows, and persistent workflow state. Explore human-in-the-loop decisions, event-driven execution, and recovery strategies for workflows that encounter errors.

Connect services with Model Context Protocol

Understand MCP servers, transports, tools, resources, and prompts. Learn how to build and connect custom MCP servers, then examine the security boundaries and operational considerations involved in using them in production.

Coordinate multiple agents

Explore collaborating agents, handoffs, supervisor patterns, coordinated workflows, and delegation. Advance into context engineering, dynamic tool selection, planning and replanning, and model routing with fallback strategies.

Prepare for production operation

Study durable agents, background execution, scheduled agents, workspaces, sandboxed execution, and coding-agent harnesses. Address prompt injection, authentication, authorization, guardrails, resilience, token economics, and cost optimization.

Finally, learn how to assess agent behavior through evaluation, LLM-as-a-judge techniques, tool-call and trajectory evaluation, regression testing, observability, and service-level objectives.

Bring the concepts together through projects

The curriculum includes an AI Research Assistant Workflow Project, a production RAG system, a Research Team Capstone, a Final Production Capstone, and an Enterprise Autonomous Agent Capstone. These projects connect individual concepts into larger systems with clear responsibilities and operational boundaries.

Who this course is for

This course is designed for TypeScript and JavaScript developers, backend engineers, AI application developers, and technical architects who want to build agent applications with Mastra.

You should be comfortable with JavaScript or TypeScript, asynchronous programming, Node.js, and basic API usage. Previous Mastra experience is not required. Depending on your chosen providers and deployment services, practical exercises may require API credentials and incur usage charges.

By the end of the course, you will understand how to design, build, evaluate, and deploy Mastra-based agent systems—and how to make informed decisions about their reliability, security, and cost.

Who this course is for:

  • JavaScript and TypeScript developers who want to build AI agents with Mastra and integrate them into applications.
  • Backend and full-stack engineers who want to connect language models to APIs, custom tools, memory, and business workflows.
  • AI application developers who want to build RAG systems with document retrieval, vector search, and grounded answers.
  • Developers interested in MCP who want to build and connect custom servers with appropriate security controls.
  • Software architects and technical leads exploring multi-agent collaboration, durable workflows, human approvals, and production architecture.
  • Engineers moving agent prototypes toward production who need testing, evaluation, observability, deployment, resilience, and cost control.
  • Developers new to Mastra who already understand basic JavaScript or TypeScript and want a progressive path from their first agent to advanced capstone projects.