Skip to content
Dashboard

Can you use Mastra with Chat SDK?

Content Engineer

Copy link to headingOverview

Copy link to headingWhat are Chat SDK and Mastra?

Copy link to headingHow Mastra channels work with Chat SDK

import { Agent } from '@mastra/core/agent'
import { createSlackAdapter } from '@chat-adapter/slack'
export const supportAgent = new Agent({
id: 'support-agent',
name: 'Support Agent',
instructions: 'You are a helpful support assistant.',
model: 'openai/gpt-5.5',
channels: {
adapters: {
slack: createSlackAdapter(),
},
},
})

import { Mastra } from '@mastra/core'
import { LibSQLStore } from '@mastra/libsql'
import { supportAgent } from './agents/support-agent'
export const mastra = new Mastra({
agents: { supportAgent },
storage: new LibSQLStore({
url: process.env.DATABASE_URL,
}),
})

/api/agents/{agentId}/channels/{platform}/webhook

Copy link to headingWhat you get out of the box

Copy link to headingWhen to use channels versus Chat SDK directly

Copy link to headingDeploying to Vercel

import { waitUntil } from '@vercel/functions'
export const agent = new Agent({
// ...
channels: {
adapters: {
slack: createSlackAdapter(),
},
waitUntil,
},
})

Copy link to headingLimitations

Ready to deploy?