fierce-television-48756
08/22/2025, 5:06 AMtall-airline-16756
08/22/2025, 5:06 AMtall-airline-16756
08/22/2025, 5:06 AMAgent and choose a speech-to-text (STT) provider you like—OpenAI, Deepgram, or AWS Transcribe all work great. Here’s a quick example:
agent = Agent(
stt=openai.STT() # or another supported STT provider
)
1. Start an AgentSession: Next, create and start an AgentSession with your agent and the room context. Transcription is turned on by default, but here’s how you can be explicit about it:
session = AgentSession()
await session.start(
agent=agent,
room=ctx.room,
room_output_options=RoomOutputOptions(
transcription_enabled=True # This is actually the default, but good to be clear!
)
)
1. Real-time transcription forwarding: If you want the transcriptions to stay perfectly in sync with the audio playback, just set sync_transcription=True in RoomOutputOptions. Like this:
room_output_options=RoomOutputOptions(
transcription_enabled=True,
sync_transcription=True
)
1. Handle transcription events: To grab the transcription data as it comes in, listen for events like user_input_transcribed. Here’s a quick example:
@session.on("user_input_transcribed")
def on_transcript(transcript):
if transcript.is_final:
print(f"Final transcript: {transcript.transcript}")
1. Frontend integration: On the client side, just subscribe to the lk.transcription text stream topic to get those transcriptions and show them live.
Also, if you want to see some ready-made examples using different STT providers, check out the LiveKit examples repository. And hey, if you hit any bumps or have questions, just let me know—I’m here to help!
Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/stt.py | Text and transcriptions | LiveKit Docs | complex-agents/teleprompter/cartesia-ink.py | Text and transcriptions | LiveKit Docs | main.pyfierce-television-48756
08/22/2025, 5:09 AMtall-airline-16756
08/22/2025, 5:09 AMpip install "livekit-agents[google]~=1.2"
1. Provide Google Cloud credentials: You have a few options here:
◦ credentials_info dictionary
◦ credentials_file JSON file
◦ Application Default Credentials
1. Set up the Agent: Here’s a quick example of how to use the Google STT plugin in your agent setup:
from livekit_agents.google import GoogleSTT
agent = Agent(
stt=GoogleSTT(credentials_file="path/to/your/credentials.json")
)
1. Start an AgentSession: Create and start an AgentSession with transcription enabled, just like we talked about earlier.
Google STT supports over 125 languages, streaming recognition, interim results, and final transcripts with confidence scores. If you have any questions or need a hand with anything else, just let me know—I’m here to help!
Sources: Google AI and LiveKit | LiveKit Docs | Live Conversations with AI using ChatGPT and WebRTC | livekit-plugins/livekit-plugins-google/livekit/plugins/google/__init__.py | Google integration guide | LiveKit Docs | Google Cloud STT integration guide | LiveKit Docsfierce-television-48756
08/22/2025, 5:57 AMtall-airline-16756
08/22/2025, 5:58 AMpnpm install @livekit/agents
You can add more plugins whenever you need them. If you have any questions or want a hand with anything, just let me know—I’m here to help!
Sources: agents/package.json | LiveKit Agents | Agents Overview | LiveKit Docsfierce-television-48756
08/22/2025, 6:03 AMRoomCompositeEgress RTMP streaming method. It works, but I want to migrate to the more efficient and modern LiveKit Agents architecture as recommended in your docs.
My goal is to replace my entire Node.js-based audio processing pipeline (node-media-server and ffmpeg) with a dedicated Nodejs Agent.
I need a complete, step-by-step guide and best practices for this migration.tall-airline-16756
08/22/2025, 6:03 AM@livekit/agents SDK in your Node.js backend like this:
pnpm install @livekit/agents
1. Create your Node.js Agent: Build an agent that joins a LiveKit room as a hidden participant. This agent will subscribe to audio tracks and handle them in real time. Here’s a quick example:
const { Agent, AudioStream } = require('@livekit/agents');
const agent = new Agent({
stt: new YourSTTPlugin(), // Swap this out with your preferred STT plugin (like Google, Deepgram, etc.)
});
agent.on('trackSubscribed', (track) => {
const audioStream = new AudioStream(track);
audioStream.pipe(agent.stt.stream());
});
1. Handle the transcriptions: Use your STT plugin to process the audio frames and send the transcription results back as data messages in the room.
2. Update your frontend: Make sure your frontend listens for those transcription data messages from the LiveKit room and shows them live.
This way, you get real-time, low-latency transcription by working directly with the individual audio tracks. If you want me to walk you through any part or share more examples, just give me a shout!
Sources: Transcription Applications | livekit/livekit_composite | DeepWiki | agents/src/pipeline/pipeline_agent.ts | Universal Egress | Transcription Applications | livekit/livekit_composite | DeepWikifierce-television-48756
08/26/2025, 5:52 PMtall-airline-16756
08/26/2025, 5:52 PM