refined-diamond-1007
05/16/2025, 4:08 AMtall-airline-16756
05/16/2025, 4:08 AMtall-airline-16756
05/16/2025, 4:08 AMmyagent.py start
), it connects to the LiveKit server and registers itself as a "worker" via a persistent WebSocket connection.
2. Once registered, the worker remains on standby, waiting for rooms (sessions with end-users) to be created.
3. During this standby period, the worker exchanges availability and capacity information with the LiveKit server automatically, enabling proper load balancing of incoming requests.
4. When an end-user connects to a room, the LiveKit server selects an available worker and sends it information about that session.
5. The first worker to accept that request will instantiate your program and join the room as an agent.
6. A single worker can host multiple instances of your agent simultaneously, running each in its own process for isolation.
This process ensures that your agent is properly managed and dispatched to rooms where it is needed.
Sources: Anatomy of an Agent | LiveKit Docs | Anatomy of an Agent | LiveKit Docs | LiveKit Docsrefined-diamond-1007
05/16/2025, 4:10 AMtall-airline-16756
05/16/2025, 4:10 AMrefined-diamond-1007
05/16/2025, 4:11 AMpowerful-quill-21987
05/21/2025, 10:43 AM