broad-painter-9222
11/03/2025, 4:41 PMtall-airline-16756
11/03/2025, 4:42 PMtall-airline-16756
11/03/2025, 4:42 PMRoomInputOptions just right. By default, agents don't listen to each other unless we explicitly configure it. No worries though—here are two friendly ways you can make this happen:
• Option 1: Use listen_to_agents=True
Simply set the listen_to_agents flag to True when you're defining RoomInputOptions. Here's a quick example:
room_io = RoomIO(
session,
room=ctx.room,
input_options=RoomInputOptions(
listen_to_agents=True
)
)
• Option 2: Use participant_kinds with PARTICIPANT_KIND_AGENT
Another way is to explicitly include PARTICIPANT_KIND_AGENT in the participant_kinds list. Check out this example:
room_io = RoomIO(
session,
room=ctx.room,
input_options=RoomInputOptions(
participant_kinds=[rtc.ParticipantKind.PARTICIPANT_KIND_AGENT]
)
)
Both of these methods work beautifully to let agents detect and chat with each other. Just make sure both agents are connected to the same room and that Text-to-Speech (TTS) is set up if you want vocal responses. If you need any more help, feel free to ask—we’re here for you!
Sources: Server-Side SDKs & Authentication | livekit/livekit_composite | DeepWiki | agents/src/voice/room_io/room_io.ts | Agent Testing & CI/CD | livekit/livekit_composite | DeepWiki | How to Enable Agent-to-Agent Speech Detection in LiveKit | livekit-agents/livekit/agents/voice/room_io/room_io.pybroad-painter-9222
11/03/2025, 4:43 PMtall-airline-16756
11/03/2025, 4:44 PMlisten_to_agents argument isn’t available in the current version of RoomInputOptions. But don’t worry—you can still enable agent-to-agent communication by using the participant_kinds argument. This lets you specify which types of participants the agent should listen to.
Here’s a friendly example of how you can set it up:
room_io = RoomIO(
session,
room=ctx.room,
input_options=RoomInputOptions(
participant_kinds=[rtc.ParticipantKind.PARTICIPANT_KIND_AGENT]
)
)
This way, agents are clearly included as participants that can be detected and interacted with. If you have any questions or want me to walk you through it further, just let me know—I’m here to help!
Sources: examples/voice_agents/realtime_joke_teller.pybroad-painter-9222
11/03/2025, 4:47 PMtall-airline-16756
11/03/2025, 4:48 PMuseTracks() or listen for TrackSubscribed events to confirm subscriptions are working properly.
4. Dispatch Timing: If multiple agents are dispatched at the same time, there might be a slight delay before tracks appear. Adding retry logic or polling can help wait for the tracks to become available.
5. Reconnection Handling: In case agents reconnect, please ensure they republish their tracks and that subscriptions are re-established accordingly.
Please don’t hesitate to reach out if you’d like me to walk you through any of these steps in more detail or provide specific code examples. I’m here to help!
Sources: Sources/LiveKit/Core/Room+EngineDelegate.swift | src/components/playground/Playground.tsx | complex-agents/ivr-agent/ivr-agent-frontend/src/App.tsx | Web and mobile frontends | LiveKit Docs | Building voice agents | LiveKit Docs