Mastra AI Agents
Build AI agents and workflows in TypeScript with Mastra. Generates agent definitions, RAG pipelines, tool integrations, workflow graphs, and Next.js-native AI features with built-in memory and eval.
This skill helps you build production AI agents with Mastra, the TypeScript-first AI framework. It generates agent definitions with system prompts and tools, RAG pipelines with chunking and retrieval, multi-step workflow graphs with branching and error handling, built-in memory for conversation persistence, evaluation harnesses, and Next.js integration for AI-powered web apps. Covers MCP server connections and model-agnostic provider configuration.
When to use
Use when building AI agents in TypeScript, creating RAG pipelines, implementing multi-step AI workflows, or adding agent capabilities to Next.js applications.
Examples
Customer support agent
Build a support agent with RAG and tools
Create a Mastra agent that answers customer questions using RAG over help docs, with tools to look up order status and create support tickets — integrated into a Next.js chat UI
Multi-step workflow
Orchestrate an AI content pipeline
Build a Mastra workflow that takes a topic, researches it with web search tools, drafts an article, runs it through an editor agent, and publishes to CMS — with human approval step