If i dont set RoomInputOption will agent listen to...
# ask-ai
s
If i dont set RoomInputOption will agent listen to itself leading to reacting to its own voice?
t
Thanks for reaching out, Rishabh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I understand you’re looking to have LiveKit agents hear and respond to each other. By default, LiveKit agents don’t listen to or detect speech from other agents in the same room—they only pick up on SIP and STANDARD participants. But don’t worry! If you want your agents to interact with each other, you just need to configure the
RoomInputOptions
to include
PARTICIPANT_KIND_AGENT
in the
participant_kinds
setting. I hope this helps clarify things for you! Sources: How to Enable Agent-to-Agent Speech Detection in LiveKit
s
my question is if i dont set RoomInputOption will agent hear to itself as it might create conflict and agent might listens to itself and reply to itself leading to poor experience
t
Just to help clarify, by default, if
RoomInputOptions
isn’t set, a LiveKit agent won’t hear itself or respond to its own voice. This happens because the default setup excludes
PARTICIPANT_KIND_AGENT
from the
participant_kinds
setting, so agents don’t subscribe to audio from other agents, including themselves. That said, if you choose to explicitly configure
RoomInputOptions
to include agent participants (for example, by setting
participant_kinds = [rtc.ParticipantKind.PARTICIPANT_KIND_AGENT]
), the agent might hear and respond to its own voice. The current sources don’t mention any built-in echo cancellation or self-voice filtering to prevent this, so if you decide to enable agent-to-agent audio, it’s a good idea to consider adding extra safeguards to avoid any self-audio feedback. I hope this helps clarify things! Please feel free to ask if you want to explore this further. Sources: examples/src/cartersia_tts.ts | How to Enable Agent-to-Agent Speech Detection in LiveKit | livekit-agents/livekit/agents/voice/agent_activity.py | Agent Testing & CI/CD | livekit/livekit_composite | DeepWiki
s
https://github.com/livekit-examples/agent-starter-react - this is a livekit repo, please tell how is it able to show transcription on frontend?
t
I'm glad to walk you through how the LiveKit agent-starter-react example handles transcription on the frontend. It listens for
RoomEvent.TranscriptionReceived
events using the LiveKit client SDK, which provide transcription segments that the app processes and stores in its state. To make things easier to read, the frontend smartly merges short, sequential segments from the same participant and displays them in a friendly chat-style interface. You'll notice the transcription UI clearly differentiates between agent and user messages by applying distinct styles, helping you follow the conversation smoothly. Plus, there are handy scroll controls to help you manage new messages as they come in. This setup takes full advantage of LiveKit's real-time transcription features, using the
useAgent
hook to listen for transcription events and keep the UI updated dynamically. If you have any questions about this or need further clarification, feel free to ask—I'm here to help! Sources: web/src/hooks/use-agent.tsx | TEMPLATE.md | templates.yaml | React Native SDK | livekit/livekit_composite | DeepWiki | complex-agents/note-taking-assistant/note-taker-frontend/README.md