numerous-lighter-25835
05/04/2026, 6:51 PMtall-airline-16756
05/04/2026, 6:51 PMtall-airline-16756
05/04/2026, 6:51 PMchat_ctx, SIP participant creation) or give a short example of what the AI’s briefing message looks like. Which would help you more?
Sources: The Human-in-the-Loop (HITL) Pattern for Voice Agents | LiveKit | The Handoff Pattern for Voice Agents That Replaces IVR Menus | LiveKit | Prebuilt tasks | LiveKit Documentation, with interactive elementsnumerous-lighter-25835
05/04/2026, 6:53 PMtall-airline-16756
05/04/2026, 6:53 PMchat_ctx.
• Show the minimal call sequence (API calls) needed to run WarmTransferTask.
Which would you like next?
, with interactive elementsnumerous-lighter-25835
05/04/2026, 6:56 PMtall-airline-16756
05/04/2026, 6:56 PMnumerous-lighter-25835
05/04/2026, 6:56 PMtall-airline-16756
05/04/2026, 6:57 PMchat_ctx (the conversation history/context) passed into the WarmTransfer flow; the system can render it as a spoken prompt or a text summary for the supervisor.
How the system connects and moves participants (high level)
1. AI places caller on hold in caller’s room (hold music).
2. AI creates a private briefing room and uses CreateSIPParticipant to dial/connect the supervisor into that room.
3. AI sends the briefing (from chat_ctx) into the private room—supervisor reads or hears the briefing and reviews sentiment.
4. When ready, the system uses MoveParticipant to move the supervisor into the caller’s room.
5. AI can then disconnect from the call.
If you want, I can now:
• Draft a concrete briefing template you can put into chat_ctx, or
• Show the minimal API call sequence (which endpoints and parameters to call in order).
Which would you like?
, with interactive elementsnumerous-lighter-25835
05/04/2026, 7:00 PMtall-airline-16756
05/04/2026, 7:00 PMlk.transcription topic or use LiveKit Inference/custom STT).
• Ensure the AI disconnects but the room stays open (don’t auto-close the room when the AI leaves) so recording and transcription continue for the human conversation.
• After the call ends, retrieve the recording via the egress webhook (egress_ended) or from cloud storage/dashboard and download the transcript output.
Quick implementation pointers
1. Configure Egress to start when supervisor joins or call the EgressClient programmatically to start composite recording for the room.
2. Turn on STT for the room so transcripts are produced with timestamps and speaker attribution.
3. Use egress_ended webhook or the dashboard/API to get the recording file and transcription artifacts.
4. If you need to keep recordings reliably, enable backup egress storage.
If you want, I can:
• Draft the minimal EgressClient call sequence to start composite recording, or
• Draft a transcript/recording flow that ensures the room stays open after the AI disconnects.
Which one would help you next?
Sources: Text and transcriptions | LiveKit Documentation | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents | Backup Egress Recordings | Universal Egress | LiveKit, with interactive elementsnumerous-lighter-25835
05/04/2026, 7:11 PMtall-airline-16756
05/04/2026, 7:12 PMon_user_turn_completed and how you can use it.
What it is
• A lifecycle hook triggered when the user’s speaking turn ends, just before the agent replies.
• Available for STT→LLM→TTS pipeline models (and for realtime if turn detection is configured).
What you receive
• `turn_ctx`: the ChatContext up to the current turn.
• `new_message`: the user’s completed message (their last turn).
What you can do with it
• Run RAG lookups or fetch external data based on the user’s last message.
• Modify or filter the user message before it’s added to history.
• Abort the agent reply (e.g., in push-to-talk flows).
• Inject additional messages into turn_ctx and persist them with update_chat_ctx.
Example (conceptual Python)
async def on_user_turn_completed(self, turn_ctx: ChatContext, new_message: ChatMessage) -> None:
# fetch related docs based on user text
docs = await my_rag_lookup(new_message.text_content)
turn_ctx.add_message(role="assistant", content=f"Context: {docs}")
await self.update_chat_ctx(turn_ctx)
Why it’s useful
• Lets you enrich context or perform lookups right after the user stops speaking, so the agent’s next response can use updated info (and the supervisor briefing can include that enriched context).
If you want, I can:
• Draft a ready-to-use on_user_turn_completed snippet that injects a briefing for supervisors, or
• Show how to persist and later read that enriched chat_ctx during a warm transfer. Which would help you next? Sources: Pipeline nodes and hooks | LiveKit Documentation | Turns overview | LiveKit Documentation | External data and RAG | LiveKit Documentation, with interactive elements