0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/integrations/livekit
History 2026-10-30 23:02:25 +00:00
..
docs docs(voice): rename LiveKit page to Realtime Voice (#20274) 2026-07-28 11:15:06 +02:00
src chore(deps): lock file maintenance (#28672) 2026-10-29 10:02:15 +00:00
CHANGELOG.md chore: version - exit prerelease mode 2026-10-30 23:02:25 +00:00
lint-staged.config.js refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
package.json chore: version - exit prerelease mode 2026-10-30 23:02:25 +00:00
README.md chore(*): Update/unify/add READMEs (#22858) 2026-09-02 14:36:59 +02:00
tsconfig.build.json feat(livekit): add @mastra/livekit voice integration with Studio voice mode (#17896) 2026-07-06 07:56:07 -07:00
tsconfig.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
tsdown.config.ts feat(livekit)!: prepare 0.5.0 with recording and speech metrics (#24674) 2026-10-06 14:38:25 -07:00
turbo.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
vitest.config.ts feat(livekit): add @mastra/livekit voice integration with Studio voice mode (#17896) 2026-07-06 07:56:07 -07:00

@mastra/livekit

Realtime voice for Mastra agents and workflows, powered by LiveKit Agents.

LiveKit's agents framework owns the audio loop — WebRTC transport, voice activity detection (VAD), streaming speech-to-text (STT), semantic turn detection, barge-in, and text-to-speech (TTS). This package bridges reply generation to Mastra, so each detected user turn is answered by a Mastra agent (agent.stream()) or workflow — with your tools, memory, processors, and model routing all running inside Mastra.

Installation

npm install @mastra/livekit

Usage

Set LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET. Add a connection route to your Mastra server so clients can receive a room token and dispatch the configured agent.

import { Agent } from '@mastra/core/agent';
import { Mastra } from '@mastra/core/mastra';
import { liveKitConnectionRoute } from '@mastra/livekit';

const supportAgent = new Agent({
  id: 'support',
  name: 'Support agent',
  instructions: 'Keep voice responses short and conversational.',
  model: 'openai/gpt-5-mini',
});

export const mastra = new Mastra({
  agents: { supportAgent },
  server: {
    apiRoutes: [liveKitConnectionRoute({ agentName: 'mastra-voice' })],
  },
});

Run a separate LiveKit worker to own the audio pipeline and call the agent for each detected turn. See the quickstart for the worker setup and required LiveKit plugins.

Documentation

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.