mastra
Oct 24 Mastra.ai is at Next.js Conf

AI workflows
for Next.js

Connect Apis and Data, Create Workflows , Create Agents .

Connect Apis & Data

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

mastra.config.ts


"actions": [
    {
        "id": "rdxca8d7mvhmO21qc1cjah17",
    }
]

"actions": [
    {
        "id": "rdxca8d7mvhmO21qc1cjah17",
    }
]
SaaS
Scrapers

sync

vectorize

Mastra

cache

Your DB

Your AI

knowledge

base

VectorDB
lines

Create Workflows

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

mastra.config.ts


categorizeProblem.connect(createSupportTicket, {
	condition: (data) => !data.requriesTechnicalSupport
});

categorizeProblem.connect(createSupportTicket, {
	condition: (data) => !data.requriesTechnicalSupport
});
Conversational AgentWorkflow

Parse Data

Convert Data into plain text following a specified template

Template

{text}
Data
Text
Input
Output

Prompt

Create a prompt template with dynamic variables.

Template

{context} --- given the context above, answer...

Context

Question

Prompt Message
Input
Output

You will write the most engaging summary posts, but you'll write as a technical writer, without using any big words. You must output 1000 characters. These posts should summarize the most important topic from the article, while also following the guidelines, feedback, chat history and examples that are provided to you. A good summary post covers the most important topic from the article, and is educational/ informational but also teases a part of the article. You must have a great hook at the beginning of the post: a question or an interesting thought provoking statement. You can only use emojis in a bullet list and not at the beginning of the post.

OpenAI

Generates text using OpenAI LLMs.

Input

Model

gpt-4o

OpenAI API Key

api key...

Temperature

0.6
Text
Language Model
Input
Output

Chat Output

Display a chat message in the Playground.

Text

Text...
Message
Input
Output
lines

Assemble Agents

Use OpenAI Assistants or Vercel’s AI SDK to create agents that can chat, email, or complete tasks

mastra.config.ts


  export const config:Config = {
    ...mastraConfig,
    agents: {
      agentDirPath: '/mastra-agents',
      vectorProvider: [
        {
          name: 'PINECONE',
          apiKey: process.env.PINECONE_API_KEY!,
        },
      ],
    },
  }

Knowledge

We'll auto-generate your API routes and make connections and redirects easy

Knowledge

We'll auto-generate your API routes and make connections and redirects easy

Knowledge

We'll auto-generate your API routes and make connections and redirects easy

Knowledge

We'll auto-generate your API routes and make connections and redirects easy

Knowledge

We'll auto-generate your API routes and make connections and redirects easy

lines

The easiest way to OAuth

We'll auto-generate your API routes and make connections and redirects easy

Type-safe client for 100+ APIs

Mastra autocompletes in your text editor

Drop into your Next.js or Express app

Just install the CLI and get started

Runs on your favorite serverless cloud

Handling your env variables to make deployment easy

Totally, completely open-source

Run on your own infra with your favorite job queue

Sync with every SaaS provider you need

We wrote syncs for dozens of apps so you don’t have to