Is it possible to have two agents join the same ro...
# ask-ai
i
Is it possible to have two agents join the same room, where one acts as the main agent and the other joins as a participant? And can these two agents communicate with each other inside the room? If yes, how do I create such an agent participant and make them interact?
t
Thanks for reaching out, Abdul. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Absolutely! Two agents can definitely join the same room in LiveKit and communicate with each other. Typically, agents are set up to detect speech from standard participants or SIP callers, but you can easily adjust this to allow agent-to-agent interaction. Here’s a friendly guide to help you set this up: 1. Enable Agent-to-Agent Speech Detection: Just configure
RoomInputOptions
to include
PARTICIPANT_KIND_AGENT
. This way, agents will be able to hear audio streams from other agents. 2. Target Specific Agents: Use the
participant
field in the
RoomIO
object to specify which agent you want to interact with another. This helps keep things clear and organized. 3. Dispatch Agents to the Room: You can add agents dynamically or automatically by using either the explicit dispatch API or token-based dispatch through
RoomConfiguration
. 4. Configure TTS and LLM: Make sure each agent has Text-to-Speech enabled and a properly set up language model for smooth input processing and response generation. If you’d like, I’m here to provide detailed code examples or walk you through any of these steps. Just let me know how I can assist! Sources: Operational Guidance & Best Practices | livekit/livekit_composite | DeepWik... | livekit-rtc/livekit/rtc/_proto/room_pb2.py | Voice Assistant Applications | livekit/livekit_composite | DeepWiki | AI Agents Framework | livekit/livekit_composite | DeepWiki | How to Enable Agent-to-Agent Speech Detection in LiveKit