cuddly-kite-65599
09/03/2025, 9:41 AMtall-airline-16756
09/03/2025, 9:41 AMtall-airline-16756
09/03/2025, 9:42 AMcuddly-kite-65599
09/03/2025, 9:43 AMtall-airline-16756
09/03/2025, 9:43 AMremoveParticipant method from the LiveKit server SDKs. This will gently disconnect that participant from the room without disturbing anyone else.
Here’s a quick example in TypeScript:
const roomService = new RoomServiceClient(LIVEKIT_URL, API_KEY, API_SECRET);
await roomService.removeParticipant(roomName, identity);
Just swap out roomName for your room’s name and identity for the participant’s identity.
One thing to keep in mind: removing a participant doesn’t invalidate their access token. So, if you want to make sure they can’t jump back in, consider issuing tokens with a short Time-To-Live (TTL) or avoid giving out a new token for that same participant.
Sources: agent-console/app/api/room/remove-participant/route.ts | Managing participants | LiveKit Docs | Inside a session | LiveKit Docscuddly-kite-65599
09/03/2025, 9:43 AMtall-airline-16756
09/03/2025, 9:44 AMlivekit-cli tool has a handy remove command under the participants subcommand that lets you disconnect someone right away.
Here’s how the command looks:
lk room participants remove --room ROOM_NAME --identity PARTICIPANT_IDENTITY
Or if you prefer shorter flags, you can use:
lk room participants remove -r ROOM_NAME -i PARTICIPANT_IDENTITY
Just swap out ROOM_NAME for your room’s name and PARTICIPANT_IDENTITY for the participant’s identity. One thing to keep in mind: this won’t invalidate their token, so they might be able to rejoin unless you have other steps set up to prevent that.
Sources: cmd/lk/room.go | Managing participants | LiveKit Docscuddly-kite-65599
09/03/2025, 9:55 AMtall-airline-16756
09/03/2025, 9:55 AMlk agent delete. Just a heads-up, this command will delete the whole agent deployment linked to that agent ID.
Here’s how you use it:
lk agent delete --id <agent-id>
Just swap out <agent-id> with the ID of the agent you want to terminate. Don’t worry—you’ll get a prompt asking you to confirm before anything gets deleted.
One thing to keep in mind: this will remove the entire agent deployment, not just a single job instance. Also, if agent hosting isn’t enabled for your project yet, you might need to join the beta program to get it up and running.
Sources: cmd/lk/agent.go | Agent deployment CLI reference | LiveKit Docscuddly-kite-65599
09/03/2025, 10:26 AMtall-airline-16756
09/03/2025, 10:27 AMcuddly-kite-65599
09/03/2025, 10:27 AMtall-airline-16756
09/03/2025, 10:28 AMLIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET. For production, it’s a good idea to enable Redis and a TURN server, especially if some clients might be behind firewalls. You can deploy using Docker, Kubernetes, or binaries. If you want a handy example, check out the LiveKit self-hosting guide.
• Configure the Roleplay Agent: Start by cloning the python-agents-examples repository and head over to the role-playing directory. Install all the dependencies with pip install -r requirements.txt. Then, set up your environment variables in a .env file — this includes keys for LiveKit, OpenAI, Deepgram, and any other services you’re using. When you’re ready, run the agent in development mode with python agent.py dev or switch to production with python agent.py start.
• Frontend Setup (Optional): If you want a web-based UI, the role_playing_frontend is ready to go. Just navigate to that directory, install dependencies with pnpm install && pnpm dev, and start the server. Don’t forget to make sure the frontend uses the same LIVEKIT_URL and generates tokens so participants can join smoothly.
• Agent Architecture: The roleplay agent is made up of parts like NarratorAgent, which moves the story along, and CombatAgent for handling battles. They all share state through GameUserData to keep everything consistent when switching between agents.
• Testing and Development Tools: Want to try out your agent without building a whole UI? Head over to agents-playground.livekit.io. Or, if you prefer working in the terminal, just run python myagent.py console to test with audio input and output right there.
If you get stuck or want help tweaking anything, just let me know—I’m here to help!
Sources: README.md | README.md | Kubernetes & Helm Charts | livekit/livekit_composite | DeepWiki | Deploying LiveKit | LiveKit Docs | Accepting incoming calls | LiveKit Docscuddly-kite-65599
09/03/2025, 10:30 AMtall-airline-16756
09/03/2025, 10:31 AMagent_name set in its WorkerOptions. Just a heads up, if agent_name is set, automatic dispatch won’t happen, so the agent needs to be dispatched to the room explicitly.
2. Dispatch the Agent: You can use the AgentDispatchService to send a dispatch request with the room name and agent name. This can be done through the API or by adding dispatch info in the participant's access token using RoomConfiguration with RoomAgentDispatch.
3. Watch Out for Name Mismatches: Make sure the agent_name in your dispatch request exactly matches what’s in the agent’s configuration. Even a small difference can stop the agent from joining.
4. Check Credentials: Confirm that both the agent and dispatch client are using valid API credentials (LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET) to connect with the LiveKit server.
5. Keep an Eye on Agent Join Status: Tools like AgentLoadTester are great for monitoring if the agent has joined. Look at the timestamps for agentDispatchedAt and agentJoinedAt to see if the dispatch signal was received and acted on.
6. Review Your Logs: Check for any error messages like “Failed to dispatch agent” or “Track subscription failed.” These clues can help identify issues like network hiccups, wrong room names, or authorization troubles.
7. Token-Based Dispatch Tips: If you’re using token-based dispatch, make sure the participant’s access token includes RoomConfiguration with RoomAgentDispatch that specifies the correct agentName and any optional metadata.
Just a quick note: without dispatching explicitly through the API or token setup, simply connecting via agents-playground in "manual" mode won’t make the agent join the room. If you hit any snags or want a hand with any of these steps, just let me know—I’m here to help!
Sources: examples/agent-dispatch/index.ts | SIP troubleshooting guide | LiveKit Docs | livekit-agents/livekit/agents/jupyter.py | pkg/loadtester/agentloadtester.go | Dispatching agents | LiveKit Docscuddly-kite-65599
09/03/2025, 10:33 AMtall-airline-16756
09/03/2025, 10:34 AMagent_name in WorkerOptions. For example:
`cli.run_app(WorkerOptions(agent_name="agent-test-final"))`If you set the agent_name, the agent will only join rooms through explicit dispatch.
2. Check Token Configuration: Make sure the participant’s access token includes RoomConfiguration.agents with the correct agent_name. Here’s an example:
token = api.AccessToken(settings.livekit_api_key, settings.livekit_api_secret)\
.with_identity(request.user_id)\
.with_grants(api.VideoGrants(room_join=True, room=room_name))\
.with_room_config(api.RoomConfiguration(agents=[api.RoomAgentDispatch(agent_name="agent-test-final", metadata=meta)]))
3. Validate Room Name: Confirm the room name in the token matches the room the participant is joining. If they don’t match, the agent won’t be dispatched.
4. Use Dispatch Client to Verify: Try using the AgentDispatchClient to list active dispatches and see if the agent is being dispatched:
lkapi = api.LiveKitAPI()\
dispatches = await lkapi.agent_dispatch.list_dispatch(room_name=room_name)\
print(f"Active dispatches: {dispatches}")
5. Monitor Agent Logs: Add some logging in the agent’s entrypoint to check if the dispatch is coming through:
async def entrypoint(ctx: JobContext):\
logger.info(f"Job received: {ctx.job.agent_name}")\
logger.info(f"Job metadata: {ctx.job.metadata}")
6. Review Logs and Dashboard: Take a look at the LiveKit server logs and the dashboard to make sure the agent is registered, the room is created, and participants are connecting as expected.
Also, it’s worth double-checking for any typos, case mismatches, or extra spaces in the agent_name. If you hit any bumps or want me to walk through this together, just let me know—I’m here to help!
Sources: SIP troubleshooting guide | LiveKit Docs | Agent dispatch | LiveKit Docs | Dispatching agents | LiveKit Docs | packages/livekit-server-sdk/src/AgentDispatchClient.ts | examples/agent_dispatch.pycuddly-kite-65599
09/04/2025, 7:22 AMtall-airline-16756
09/04/2025, 7:23 AMapi.RoomCompositeEgressRequest recordings aren't saving to your GCP bucket. Here’s a friendly step-by-step guide to help you debug the issue:
Sources: README.md | Community & Support | livekit/livekit_composite | DeepWiki | Egress & Recording | livekit/livekit_composite | DeepWiki | Universal Egress | livekit/livekit_egress.pb.gocuddly-kite-65599
09/04/2025, 7:25 AMtall-airline-16756
09/04/2025, 7:26 AMapi.RoomCompositeEgressRequest flow and get those GCP bucket recordings working smoothly:cuddly-kite-65599
09/04/2025, 7:30 AMtall-airline-16756
09/04/2025, 7:31 AM