brainy-pharmacist-74567
11/29/2025, 3:54 AMtall-airline-16756
11/29/2025, 3:54 AMtall-airline-16756
11/29/2025, 3:55 AMlk.transcription text stream topic so the room and clients can receive it.
1. Ensure agent session text output is enabled
• When starting the agent session, enable text output in RoomOptions. Example:
await session.start(
agent=MyAgent(),
room=ctx.room,
room_options=RoomOptions(
text_output=TextOutputOptions(sync_transcription=False)
),
)
1. Receive transcriptions on the frontend
• Use the room text-stream handler to receive the transcription events (the meet app uses registerTextStreamHandler under the hood).
• Alternatively, in React use the useTranscriptions hook from @livekit/components-react to display live transcription lines in your UI.
1. Reference examples and templates
• Look at the transcription frontend example (transcription_frontend_groq) for a working implementation of real-time STT and UI handling.
• Extend the meet app by adding the agent integration and the UI components shown in that example.
If you want, tell me:
• Which STT model or provider you plan to use (or if you want example agent code), and
• Whether you want inline captions in the meeting UI or a separate transcript panel —
and I’ll give the exact code snippets and file locations to modify in the meet template.
Sources: livekit/livekit_composite | DeepWiki | Text and transcriptions | LiveKit docs | examples/other | livekit/livekit_composite | DeepWikibrainy-pharmacist-74567
11/29/2025, 3:58 AMtall-airline-16756
11/29/2025, 3:58 AMdeepgram/nova-3:multi (or Nova-2) for automatic multilingual detection and broad language coverage.
◦ Example in an agent session: set stt="deepgram/nova-3:multi".
• Cartesia Ink Whisper
◦ Model ID: cartesia/ink-whisper — supports ~98 languages; set language per session if needed.
• Gladia STT plugin
◦ Supports automatic language detection and realtime translation configuration.
How to wire it into meet:
1. Add a LiveKit Agent that uses one of the above STT models.
2. Ensure the agent publishes transcription to lk.transcription (text stream).
3. Enable text output in the agent session RoomOptions (example shown earlier).
4. On the frontend use registerTextStreamHandler or the useTranscriptions hook from @livekit/components-react to display captions.
Which model do you want to try (Deepgram, Cartesia, or Gladia)? I’ll provide the exact agent config and the specific file edits for the meet template.
Sources: Deepgram STT | LiveKit docs | Speech-to-text (STT) models | LiveKit Docs | Cartesia STT | LiveKit Docs | Gladia STT plugin guide | LiveKit Docs | LiveKit turn detector plugin | LiveKit docsbrainy-pharmacist-74567
11/29/2025, 3:59 AMtall-airline-16756
11/29/2025, 3:59 AMstt to cartesia/ink-whisper. Example (Python-style pseudocode):
session = AgentSession(
stt="cartesia/ink-whisper",
# other components like tts, llm, etc. as needed
)
await session.start(agent=MyAgent(), room=ctx.room, room_options=RoomOptions(
text_output=TextOutputOptions(sync_transcription=False)
))
• If you need a specific language, pass the language code when starting the STT component; otherwise the model supports many languages and you can detect/set language dynamically in the agent logic.
1. Publish transcriptions to the lk.transcription text stream
• In your agent code, when you receive STT results, publish them to the room text stream topic lk.transcription so clients can consume them.
Environment variables / credentials
• Provide Cartesia API credentials or plugin config to the agent runtime via environment variables expected by your Cartesia plugin integration. (Place credentials in your agent host environment so the Cartesia STT calls succeed.)
Frontend — receive and display transcriptions
1. Use the meet template’s existing text-stream handlers or register one:
• The meet app uses registerTextStreamHandler to receive room text streams; ensure it listens for lk.transcription messages.
1. Or, use the React helper:
• Use useTranscriptions from @livekit/components-react to surface live lines in the UI.
1. Display options:
• Inline captions (below video) — render latest transcription line.
• Transcript panel — append incoming lines to a scrollable transcript list.
Files to update in the meet template
• Backend agent service file(s): add/import Cartesia STT in your agent composition and configure AgentSession stt parameter.
• Agent startup/config: add environment variables for Cartesia credentials.
• Frontend (Next.js pages / components): ensure registerTextStreamHandler or useTranscriptions is wired to show lk.transcription messages.
Quick checklist
• [ ] Cartesia credentials available to agent runtime
• [ ] AgentSession stt="cartesia/ink-whisper" configured
• [ ] Agent publishes STT results to lk.transcription
• [ ] Frontend listens to lk.transcription and renders captions/transcript
Would you like the exact code edits for the meet template files (backend agent file and the specific frontend component) for a Next.js project? If so, tell me whether your agent is implemented in Python or TypeScript/Node and I’ll provide precise snippets.brainy-pharmacist-74567
11/29/2025, 4:01 AMtall-airline-16756
11/29/2025, 4:01 AMcartesia/ink-whisper (≈98 languages)
• Deepgram: deepgram/nova-3:multi or deepgram/nova-2 (multilingual modes)
• AssemblyAI: assemblyai/universal-streaming (English-focused)
How to use:
1. In your agent session set stt to the model ID (e.g., cartesia/ink-whisper) when starting the session.
2. Ensure the agent publishes results to the lk.transcription text stream.
3. Frontend: consume lk.transcription via registerTextStreamHandler or useTranscriptions to show captions/transcripts.
Would you like the exact agent config and meet-template file edits to enable Cartesia transcription (Node or Python)?
Sources: AssemblyAI STT | LiveKit Docs | Deepgram STT | LiveKit docs | Speech-to-text (STT) models | LiveKit Docs | Agents v0.x migration guide - Node.js | LiveKit Docs | Text and transcriptions | LiveKit docsbrainy-pharmacist-74567
11/29/2025, 4:02 AMtall-airline-16756
11/29/2025, 4:02 AMbrainy-pharmacist-74567
11/29/2025, 4:03 AMtall-airline-16756
11/29/2025, 4:04 AMpnpm add @livekit/agents
1. Create or update your agent entry (e.g., src/agents/cartesiaAgent.ts):
import { Agent, AgentSession, inference } from '@livekit/agents';
import { Room } from 'livekit-server-sdk'; // if you use server SDK
export class CartesiaAgent extends Agent {
// implement handlers as needed
}
export async function startCartesiaAgent(room: Room) {
const session = new AgentSession({
stt: inference.STT({
model: 'cartesia/ink-whisper',
language: 'multi', // automatic multilingual detection
}),
// add other components if needed (llm, tts)
});
await session.start({
room, // pass your LiveKit Room instance
room_options: {
text_output: { sync_transcription: false },
},
});
// Example: publish manual text stream messages when you get STT results
session.on('transcription', async (segment) => {
// segment.text, segment.participantIdentity, segment.final
await room.createDataPayload('lk.transcription', JSON.stringify({
identity: segment.participantIdentity,
text: segment.text,
final: segment.final,
segmentId: segment.segmentId,
}));
});
return session;
}
Notes:
• Ensure Cartesia credentials/config are available to the agent runtime via environment variables required by your deployment (Cartesia plugin config).
• Replace the session.on('transcription', ...) with the actual event hook your agent SDK exposes for STT results if different.
Frontend — receive transcription (meet template) A. Using room.registerTextStreamHandler (server-side/SDK consumer file) Update the file that connects to the LiveKit Room (e.g., src/utils/roomListeners.ts):
room.registerTextStreamHandler('lk.transcription', async (reader, participantIdentity) => {
const messages = await reader.readAll(); // get the text payload
const payload = JSON.parse(messages);
const isFinal = reader.info.attributes?.['lk.transcription_final'] === 'true';
// Emit to app state / UI
appState.addTranscription({
participant: participantIdentity,
text: payload.text,
final: isFinal,
segmentId: payload.segmentId,
});
});
B. Using React helper (useTranscriptions) in a component (e.g., components/Transcriptions.tsx)
import React from 'react';
import { useTranscriptions } from '@livekit/components-react';
export function TranscriptionsPanel() {
const { transcriptions } = useTranscriptions();
return (
<div className="transcription-panel">
{transcriptions.map(t => (
<div key={t.segmentId} className={t.final ? 'final' : 'interim'}>
<strong>{t.participant.identity}:</strong> {t.text}
</div>
))}
</div>
);
}
File locations to edit in the meet template
• Backend agent file: create/update src/agents/cartesiaAgent.ts (or src/server/agents/* depending on your repo)
• Agent startup: update server bootstrap file where agents are started (e.g., src/server/index.ts or src/server/agentStartup.ts)
• Frontend: add component at components/Transcriptions.tsx and import into pages/_app.tsx or pages/room/[id].tsx
• Room listeners: update src/utils/roomListeners.ts or wherever you handle room events in the meet app
Quick checklist
• Cartesia credentials present in agent runtime environment
• @livekit/agents installed and agent started with stt.model = 'cartesia/ink-whisper' and language='multi'
• Agent publishes STT output to lk.transcription
• Frontend listens via registerTextStreamHandler('lk.transcription', ...) or uses useTranscriptions
Would you like the exact patched diffs for specific meet repo files (I can produce the minimal edits for the typical Next.js meet layout)?
Sources: Groq and LiveKit | LiveKit Docs | Text and transcriptions | LiveKit docs | Cartesia STT | LiveKit Docs | Build voice, video, and physical AI | LiveKit | HIPAA Eligible Products and Services | LiveKitbrainy-pharmacist-74567
11/29/2025, 3:19 PMtall-airline-16756
11/29/2025, 3:20 PMlk.transcription.
You can:
• Use the meet template + a Cartesia agent (we gave Node/TS snippets earlier) — this is the common approach.
• Combine meet UI with the transcription-frontend-groq components to speed UI work, then connect a Cartesia-powered agent.
• Use LiveKit Inference models directly in an agent session (no external infra) to avoid rolling your own STT service.
Which would you prefer: (A) I provide minimal patched diffs for the meet repo to add Cartesia agent + frontend wiring, or (B) I show how to merge transcription-frontend-groq UI into meet and the exact agent start code?
Sources: examples/other | livekit/livekit_composite | DeepWiki | Realtime media | LiveKit Docs | Text and transcriptions | LiveKit docs | livekit/livekit_composite | DeepWiki | examples/voice_agents | livekit/livekit_composite | DeepWikibrainy-pharmacist-74567
11/29/2025, 3:22 PMtall-airline-16756
11/29/2025, 3:22 PMlk.transcription.
• Frontend consumes via registerTextStreamHandler or useTranscriptions.
Backend (Node/TypeScript) — minimal agent/session
1. Install:
pnpm add @livekit/agents
1. Create/start AgentSession (example):
import { AgentSession, inference } from '@livekit/agents';
const session = new AgentSession({
stt: inference.STT({
model: 'cartesia/ink-whisper',
language: 'multi', // use supported value; or specify a language code
}),
// optionally include llm/tts if needed by your pipeline
});
await session.start({
room, // your LiveKit Room instance
room_options: {
text_output: { sync_transcription: false },
},
});
1. Ensure Cartesia credentials are available to LiveKit Inference (set required env vars in your deployment).
Publishing transcriptions
• LiveKit Inference will produce STT output; ensure the session/agent publishes those to lk.transcription. If you need to forward manually, use the agent SDK event for transcription results and publish into the room text stream.
Frontend — receive & show transcriptions Option A — low-level handler:
room.registerTextStreamHandler('lk.transcription', async (reader, participant) => {
const msg = await reader.readAll();
const isFinal = reader.info.attributes?.['lk.transcription_final'] === 'true';
// parse msg and update UI
});
Option B — React helper (recommended for meet UI):
import { useTranscriptions } from '@livekit/components-react';
const { transcriptions } = useTranscriptions();
Render transcriptions in a caption bar or transcript panel.
Templates / shortcuts
• You can use the meet template and add the AgentSession code above — this is the typical path.
• Alternatively, transcription-frontend-groq shows ready transcription UI that you can merge into meet if you want visual examples.
Next step Would you like: A) Exact patched diffs for the typical meet repo (Node/TS) to add the Cartesia AgentSession + frontend wiring, or B) A runnable minimal repo example (zip/snippets) you can drop into your project?
Tell me A or B and I’ll produce the code diffs/snippets.
Sources: Speech-to-text (STT) models | LiveKit Docs | Deepgram STT | LiveKit docs | Text and transcriptions | LiveKit docs | examples/voice_agents | livekit/livekit_composite | DeepWiki | Models | LiveKit Docsbrainy-pharmacist-74567
11/29/2025, 3:25 PMtall-airline-16756
11/29/2025, 3:25 PMpnpm add @livekit/agents
1. Create file src/cartesia-lite-agent.ts (replace names as needed):
import { AgentSession, inference } from '@livekit/agents';
import { Room } from 'livekit-server-sdk';
export async function startSimpleSTTAgent(room: Room) {
const session = new AgentSession({
stt: inference.STT({
model: 'deepgram/nova-3:multi', // simple multilingual test model
}),
});
await session.start({
room,
room_options: { text_output: { sync_transcription: false } },
});
// Optional: log transcription events if SDK emits them
session.on('transcription', (seg) => {
console.log('transcription:', seg);
});
return session;
}
1. Ensure your environment has any needed API keys (LiveKit Inference credentials are managed by your LiveKit deployment). No external STT infra required.
Frontend — quick subscriber (TypeScript) Option A — low-level handler (works in meet template) Add this where you have the LiveKit room object:
room.registerTextStreamHandler('lk.transcription', async (reader, participant) => {
const msg = await reader.readAll();
const isFinal = reader.info.attributes?.['lk.transcription_final'] === 'true';
// msg is the transcription text (or JSON depending on agent)
console.log('transcript', participant.identity, isFinal, msg);
// Update your UI: append to transcript or show as caption
});
Option B — React (in meet UI)
import { useTranscriptions } from '@livekit/components-react';
function Captions() {
const { transcriptions } = useTranscriptions();
return (
<div>
{transcriptions.map(t => (
<div key={t.segmentId}><strong>{t.participant.identity}:</strong> {t.text}</div>
))}
</div>
);
}
How to test
1. Start your LiveKit room and run the server that calls startSimpleSTTAgent(room).
2. Join the room from two clients (one speaking).
3. Watch console logs or the Captions component — you should see interim/final transcription lines appear.
If you want, I can:
• Provide patched diffs for the meet repo (minimal edits), or
• Swap the example to AssemblyAI or Cartesia instead.
Which would you prefer?brainy-pharmacist-74567
11/29/2025, 3:26 PMtall-airline-16756
11/29/2025, 3:27 PMlk.transcription.
Options depending on how much infra you want:
• Minimal server: a small Node/TS Express or Next.js API route that runs the AgentSession (easy for testing).
• Serverless: run the agent in a serverless function (short-lived sessions) if your provider and runtime fit the agent SDK.
• Container: run the agent as a small container (recommended for production stability).
• Full-managed: use LiveKit Cloud + LiveKit Inference so you never host models — only host the agent process.
Quick practical suggestion for testing:
• Start a tiny Node process (one file) that creates an AgentSession with stt: 'deepgram/nova-3:multi' (or cartesia/ink-whisper) and calls session.start({ room }). Run it locally while you join the meet room — you’ll see transcriptions appear in lk.transcription. No model hosting required.
If you want, I can:
• Provide a 1-file Node/TS agent you can run locally to test (ready-to-run). Would you like that?brainy-pharmacist-74567
11/29/2025, 3:29 PMtall-airline-16756
11/29/2025, 3:29 PMbrainy-pharmacist-74567
11/29/2025, 3:31 PMtall-airline-16756
11/29/2025, 3:31 PMlk.transcription. Run the agent service and join the meet UI; transcriptions will appear in the UI or via the transcription stream.
B — Minimal 1-file Node/TypeScript agent (quick local test)
1. Install
mkdir livekit-stt-test
cd livekit-stt-test
pnpm init -y
pnpm add @livekit/agents livekit-server-sdk
1. Create file src/simple-agent.ts
import { AgentSession, inference } from '@livekit/agents';
import { Room, RoomService } from 'livekit-server-sdk';
// Replace with your LiveKit host, API key/secret, and room name
const LIVEKIT_URL = process.env.LIVEKIT_URL!;
const LIVEKIT_API_KEY = process.env.LIVEKIT_API_KEY!;
const LIVEKIT_API_SECRET = process.env.LIVEKIT_API_SECRET!;
const ROOM_NAME = process.env.ROOM_NAME || 'test-room';
async function getRoom() {
// simple way to get a Room object using livekit-server-sdk
// adjust per your server setup; this is illustrative
const svc = new RoomService(LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET);
const room = await svc.getRoom(ROOM_NAME).catch(async () => {
await svc.createRoom({ name: ROOM_NAME });
return svc.getRoom(ROOM_NAME);
});
return room as any; // adapt to actual Room object your app uses
}
async function main() {
const room = await getRoom();
const session = new AgentSession({
stt: inference.STT({
model: 'deepgram/nova-3:multi', // quick multilingual test model
}),
});
await session.start({
room,
room_options: { text_output: { sync_transcription: false } },
});
console.log('AgentSession started for room', ROOM_NAME);
// Optional: log transcription events (SDK may provide different hooks)
session.on('transcription', (seg: any) => {
console.log('TRANSCRIPTION:', seg);
});
// Keep process alive
process.stdin.resume();
}
main().catch((e) => {
console.error(e);
process.exit(1);
});
1. Run
• Set env vars and run:
export LIVEKIT_URL=https://your-livekit-host
export LIVEKIT_API_KEY=key
export LIVEKIT_API_SECRET=secret
export ROOM_NAME=test-room
pnpm ts-node src/simple-agent.ts
Notes and tips
• You do need a running agent process (this file) that creates the AgentSession and connects to your LiveKit room — but you do NOT host the STT model itself; LiveKit Inference hosts models (Deepgram, Cartesia, etc.).
• Starter templates include wiring and README steps (recommended if you want full UI + agent).
• For the minimal agent you may need to adapt the Room object acquisition to your environment (the sample uses RoomService illustratively). Starter templates handle this for you.
If you want, I can:
• Produce the exact patched diffs to add the simple agent to the typical meet repo, or
• Provide a runnable ZIP with the minimal Node agent and a tiny HTML/JS client that joins the room and logs lk.transcription.
Which would you like next?brainy-pharmacist-74567
11/29/2025, 3:34 PMtall-airline-16756
11/29/2025, 3:35 PMrestart: always) or use Docker Compose / Kubernetes for orchestration.
• System service: Run as a systemd service on a VM so it starts on boot and restarts on failure.
• Process manager: Use PM2 or similar to keep a Node agent alive and auto-restart on crashes.
• Serverless (ephemeral): Use serverless functions to start sessions on demand, but you’ll need logic to keep sessions alive while meetings run (more complex).
• Platform-managed: Deploy to a PaaS (Heroku, Fly, Vercel with background workers, AWS ECS/Fargate) and configure a worker service.
Tips
• For development/testing: run the single-file agent locally (node/ts-node) or with PM2 for convenience.
• For production: containerize + orchestrate (Docker Compose for small scale, Kubernetes/ECS for scale).
• Ensure the agent auto-reconnects / restarts on failure and that required env vars (LiveKit credentials, inference credentials) are available to the runtime.
Would you like a short example systemd unit, a Dockerfile+docker-compose, or PM2 config for the minimal agent? Which deployment target are you planning?