alert-wire-7024
12/22/2025, 3:49 PMtall-airline-16756
12/22/2025, 3:49 PMtall-airline-16756
12/22/2025, 3:49 PMpreConnectBuffer / withPreconnectAudio) so buffered audio is sent as soon as the agent connects.
3) Enable preemptive speech generation
• Start generating TTS from partial/early transcripts so speech begins before the user finishes speaking (enable preemptive_generation or equivalent).
4) Dispatch the agent in parallel with the user
• Generate the room token and dispatch the agent at the same time the user connects instead of waiting for the user to finish connecting. Use explicit agent dispatch so the agent process starts earlier.
5) Optimize network placement and routing
• Run agent servers near your LLM/STT/TTS providers (same region) to reduce round-trip time.
• Monitor metrics like Time To First Token / Time To First Byte and choose regions or providers with lower RTT.
6) Reduce local processing latency
• Minimize unnecessary audio processing on the critical path (e.g., avoid synchronous logging/IO before sending audio).
• Use async pipelines for STT → LLM → TTS and stream intermediate results when possible.
7) Measure and iterate
• Track these metrics: agent startup time, STT latency, TTS time-to-first-audio, and overall time-to-speech.
• Apply one change at a time and measure impact.
If you want, tell me which parts of your current setup you control (self-hosted models vs. cloud APIs, where agents run, whether you can enable preconnect audio), and I’ll suggest the highest-impact changes for your environment.
Sources: Uninterruptable Agent | LiveKit docs | Agent speech and audio | LiveKit docs | Agent dispatch | LiveKit docs | Agents Framework | livekit/livekit_composite | DeepWiki | examples/frontdesk | livekit/livekit_composite | DeepWiki