plain-hamburger-12701
11/06/2025, 4:57 AMtall-airline-16756
11/06/2025, 4:57 AMtall-airline-16756
11/06/2025, 4:58 AMMoveParticipant API. Just a quick heads-up: this feature is available in LiveKit Cloud or Private Cloud deployments and you'll need roomAdmin privileges to make it happen. Here’s a friendly, step-by-step example in Python to guide you through:
from livekit.api import LiveKitAPI, MoveParticipantRequest
import asyncio
async def move_participant_safely():
async with LiveKitAPI() as lkapi:
source_room = "current-room-name"
destination_room = "new-room-name"
participant_identity = "user-123"
try:
# First, let's check if the source room exists and get its participants
rooms = await lkapi.room.list_rooms()
room_names = [room.name for room in rooms.rooms]
if source_room not in room_names:
print(f"Source room {source_room} does not exist.")
return
# Next, confirm the participant is actually in the source room
participants = await lkapi.room.list_participants(
MoveParticipantRequest(room=source_room)
)
participant_ids = [p.identity for p in participants.participants]
if participant_identity not in participant_ids:
print(f"Participant {participant_identity} not found in {source_room}.")
return
# Now, let's move the participant to the new room
await lkapi.room.move_participant(
MoveParticipantRequest(
room=source_room,
identity=participant_identity,
destination_room=destination_room,
)
)
print(f"Successfully moved participant {participant_identity} from {source_room} to {destination_room}.")
except Exception as e:
print(f"Failed to move participant: {e}")
To make sure everything goes smoothly, please check that:
• Both the source and destination rooms exist.
• The participant is currently connected to the source room.
• Your API key has roomAdmin privileges for both rooms.
If you'd like to explore more examples or details in other programming languages, feel free to visit the LiveKit documentation. We're here to help you every step of the way!
Sources: Agent-assisted warm transfer | LiveKit Docs | examples/warm-transfer/README.md | livekit-api/livekit/api/room_service.py | Managing participants | LiveKit docs | packages/livekit-server-sdk/src/RoomServiceClient.tsplain-hamburger-12701
11/06/2025, 5:06 AMtall-airline-16756
11/06/2025, 5:07 AMMoveParticipant or ForwardParticipant APIs, as these are available exclusively with LiveKit Cloud and Private Cloud deployments. But don’t worry—you can still achieve similar results in self-hosted setups with a bit of custom work:
• Graceful Exit and Rejoin: You can use the RemoveParticipant API to gently disconnect the participant from their current room, then guide the client to join a new room by creating a new access token for that destination.
• Track Replication: Another option is to subscribe to the participant’s tracks in the original room, relay those media streams through an intermediary service, and then publish them into the target room.
• Agent-Assisted Coordination: You might consider deploying self-hosted agents that keep an eye on room states and help automate the process—removing participants from one room and helping them join another smoothly.
These methods do require a bit more setup and infrastructure compared to the built-in MoveParticipant feature. If having seamless participant migration is really important for your use case, it might be worth exploring LiveKit Cloud or Private Cloud options, where this functionality is fully supported.
Sources: Managing participants | LiveKit docs | livekit-api/livekit/api/room_service.py | Agent-assisted warm transfer | LiveKit Docs | LiveKit Pricingplain-hamburger-12701
11/06/2025, 7:43 AMtall-airline-16756
11/06/2025, 7:44 AMForwardParticipant API. This is a great way to let the participant stay connected to their original room while their audio, video, or data tracks are forwarded to one or more other rooms.
Here are some important points to keep in mind:
• The participant remains in their original room, and their tracks are duplicated in the destination room(s).
• The forwarding will keep going until the participant leaves the original room or is removed from the destination room.
• You can forward a participant to multiple rooms at the same time.
• If the destination room doesn’t exist yet, it will be created automatically.
This feature is really handy for cases like broadcasting a speaker to several audience rooms or linking participants across different sessions. Just a quick note: this is different from MoveParticipant, which completely moves the participant to another room.
If you’d like, I’m happy to provide more details or some examples to help you get started with this. Just let me know!
Sources: protobufs/livekit_room.proto | packages/livekit-server-sdk/README.md | cmd/lk/room.go | livekit-ffi/src/server/requests.rsplain-hamburger-12701
11/06/2025, 7:45 AMtall-airline-16756
11/06/2025, 7:45 AMForwardParticipant API can help with your original goal of moving a participant from one room to another, but it works a bit differently than the MoveParticipant API. Instead of fully transferring the participant, it forwards their tracks to the new room while they stay connected to the original one.
If you’re aiming for the participant to be active in both rooms at the same time or want to broadcast their media to another room, this method is a great fit. On the other hand, if you want the participant to leave the first room and join the new one seamlessly, then the MoveParticipant API (available in LiveKit Cloud or Private Cloud) would be the best choice.
Please feel free to reach out if you’d like me to explain anything further or help you get started with either option—I’m here to help!plain-hamburger-12701
11/06/2025, 7:47 AMtall-airline-16756
11/06/2025, 7:48 AMRoomIO.set_participant method to focus the agent’s audio input/output on a specific participant, creating a private 1-1 channel within the shared space.
• When you want to switch back to the group walkie-talkie mode, just unset that participant to return to the group setting.
State Management:
• It’s helpful to keep track of the current mode (like walkie-talkie, 1-1, or on-hold) using a session manager, so transitions feel seamless.
• To make the experience even nicer, you might want to play hold music during those transitions.
Additional Features:
• If you need agent-to-agent communication or want to escalate to a supervisor, you can set up the agent to listen to other agents or integrate SIP for external calls.
• LiveKit’s APIs are super handy for managing participants and rooms dynamically as your needs change.
This setup gives you a flexible and user-friendly communication system that supports both group chats and private conversations. If you’d like, I’m here to provide more details or even some code examples to help you get started!
Sources: Making outbound calls | LiveKit Docs | README.md | Turn detection and interruptions | LiveKit Docs | How to Enable Agent-to-Agent Speech Detection in LiveKit | Operational Guidance & Best Practices | livekit/livekit_composite | DeepWik...plain-hamburger-12701
11/06/2025, 7:49 AMRoomIO.set_participant method to focus the agent’s audio input/output on a specific participant, creating a private 1-1 channel within the shared space.
• When you want to switch back to the group walkie-talkie mode, just unset that participant to return to the group setting.
-- can u expalin with an example. also provide relevant documentaitontall-airline-16756
11/06/2025, 7:50 AMRoomIO.set_participant method to enable 1-1 conversations in LiveKit:
async def entrypoint(ctx: JobContext):
session = AgentSession(llm=openai.realtime.RealtimeModel())
room_io = RoomIO(session, room=ctx.room)
await room_io.start()
await session.start(agent=MyAgent())
# RPC method to set the participant dynamically
@ctx.room.local_participant.register_rpc_method("set_participant")
async def on_set_participant(data: rtc.RpcInvocationData) -> None:
target_identity = data.payload or data.caller_identity
room_io.set_participant(target_identity) # Direct the agent to process this participant's audio
In this example:
• The agent starts without focusing on any particular participant.
• When the client calls the set_participant RPC method, the agent will then process audio only from the participant you specify.
• This approach is especially handy for situations like push-to-talk or role-based interactions, where you want to hear just one user at a time.
If you want to switch back to group mode, you can simply use:
room_io.unset_participant()
For more details, feel free to check out the LiveKit Agents GitHub repository and examples such as toggle_io.py and push_to_talk.py. If you have any questions or need more examples, just let me know—I’m here to help!
Sources: examples/voice_agents/push_to_talk.py | How to set a fixed participant for agent audio processingplain-hamburger-12701
11/06/2025, 7:52 AMtall-airline-16756
11/06/2025, 7:53 AMRoomIO.set_participant method is your friend—it focuses the agent’s input/output on the chosen participant.
• Once the conversation wraps up, just call RoomIO.unset_participant to smoothly return to the common room mode.
4. UI Controls:
• It’s helpful to provide buttons so users can easily toggle between the common room and agent interaction.
• For example, a "Talk to Agent" button can trigger set_participant, and an "End Conversation" button can trigger unset_participant.
Example:
async def entrypoint(ctx: JobContext):
session = AgentSession(llm=openai.realtime.RealtimeModel())
room_io = RoomIO(session, room=ctx.room)
await room_io.start()
@ctx.room.local_participant.register_rpc_method("set_participant")
async def on_set_participant(data: rtc.RpcInvocationData):
target_identity = data.payload or data.caller_identity
room_io.set_participant(target_identity)
@ctx.room.local_participant.register_rpc_method("unset_participant")
async def on_unset_participant(data: rtc.RpcInvocationData):
room_io.unset_participant()
If you’d like, I’m here to help with more details or specific examples for platforms like iOS, Android, Flutter, or React Native—just let me know!
Sources: Mobile SDKs (Flutter, iOS, Android) | livekit/livekit_composite | DeepWiki | VoiceAgent/App/AppViewModel.swift | lib/controllers/app_ctrl.dart | app/assistant/index.tsx | Voice Assistant Applications | livekit/livekit_composite | DeepWikiplain-hamburger-12701
11/06/2025, 7:54 AMtall-airline-16756
11/06/2025, 7:55 AMWorkerType.ROOM, it means one agent instance is shared by everyone in the room. This is great for group conversations where all participants interact with the same agent together.
• Dedicated Agent: On the other hand, if you configure the agent with WorkerType.PUBLISHER, each participant who publishes audio or video gets their own dedicated agent. This way, each user enjoys a more personalized and private interaction.
For smooth performance, each agent session runs in its own process. You can also customize how the agent behaves using tools like RoomIO, which lets you decide who the agent listens to or responds to.
If you'd like, I’m here to help you set this up exactly how you need it. Just let me know!
Sources: Worker options | LiveKit Docs | Job lifecycle | LiveKit Docs | Building voice agents | LiveKit Docs | pipeline-tts/tts_comparison/README.mdplain-hamburger-12701
11/06/2025, 7:57 AMtall-airline-16756
11/06/2025, 7:57 AMChatContext, so even if you switch between talking to the agent and the room, then come back to the agent, it will remember everything from before.
The agent’s state—whether it’s listening, thinking, or speaking—is managed smoothly, so switching between these modes won’t make it lose any context. If you’d like, I’m here to help with more details or guide you through setting this up!
Sources: Web and mobile frontends | LiveKit Docs | main.py | agents/src/voice/agent_session.ts | pipeline-tts/tts_comparison/README.mdplain-hamburger-12701
11/06/2025, 7:58 AMtall-airline-16756
11/06/2025, 7:59 AMplain-hamburger-12701
11/06/2025, 7:59 AMtall-airline-16756
11/06/2025, 8:00 AMlk agent init, lk agent create, and lk agent deploy.
• Tailor your agent deployments by integrating your own AI providers or plugins to fit your needs.
• Allow agents to connect to LiveKit rooms, manage room events, and interact with participants through RPCs and data APIs.
This way, you can enjoy the same great functionality as the cloud version, including dedicated agent instances for each user. If you’d like, I’m here to help guide you through the setup process—just let me know!
Sources: livekit/livekit_composite | DeepWiki | livekit/livekit_composite | DeepWiki | Voice AI quickstart | LiveKit docs | test/agent_test.go | LiveKit Pricingplain-hamburger-12701
11/06/2025, 8:01 AMtall-airline-16756
11/06/2025, 8:01 AMRoomIO.set_participant method to direct the agent’s input/output to a specific participant for those one-on-one chats.
• When the conversation wraps up, simply use RoomIO.unset_participant to switch back to the shared room mode.
3. Context Retention:
• The agent keeps track of the conversation history using ChatContext, so no context is lost when moving between the shared room and private interactions.
4. Performance Considerations:
• Each agent instance needs solid resources (4 CPU cores, 8GB RAM per worker) to run smoothly.
• We recommend using non-burstable cloud instances like AWS m5 or c5 to avoid throttling and keep performance steady.
• Take advantage of LiveKit’s autoscaling and warm-instance features to manage traffic spikes and keep latency low.
5. Self-Hosted Implementation:
• You can implement this approach with the self-hosted open-source version of LiveKit using the Agents framework.
• Deploy agents through the LiveKit CLI and customize them to work with your AI providers or plugins.
Relevant Links:
• LiveKit Agents GitHub Repository
• LiveKit Documentation
• LiveKit Open Source Repository
If you have any questions or need more details, please don’t hesitate to reach out—I’m here to help!