The TypeScript AI Framework

From the team that brought you Gatsby: prototype and productionize AI features with a modern JS/TS stack.

$ npx create-mastra@latest

Assemble Agents

Build intelligent agents that execute tasks, access knowledge bases, and maintain memory persistently within threads.

mastra/agent/index.ts


import { Agent } from '@mastra/core';
const chefAgent = new Agent({
  name: 'Chef Agent',
  instructions: 'You are Michel, a practical and experienced home chef who helps people cook great meals with whatever ingredients they have available. Your first priority is understanding what ingredients and equipment the user has access to, then suggesting achievable recipes. You explain cooking steps clearly and offer substitutions when needed, maintaining a friendly and encouraging tone throughout.',
  model: {
    provider: 'OPEN_AI',
    name: 'gpt-4o',
    toolChoice: 'auto',
  },
});
lines

Build a knowledge base

Sync data from SaaS tools. Scrape the web. Pipe it into a vector store and RAG away.

mastra/tools/rag.ts

lines

Create Workflows

Code. Craft. Tune. Visualize. Inspect. Debug.

/mastra/workflows/index.ts

lines

Backed by founders