If I want just a simple button that connects to a ...
# ask-ai
t
If I want just a simple button that connects to a livekit agent without a room can I do this? just for demo purposes
t
Thanks for reaching out, Ellis. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
LiveKit agents need a room to work, but there are demo modes like console or jupyter that simulate simple room connections. Are you hoping to show off agent logic without media streams, or do you want to have some interaction with a simulated session? Let me know so I can help you better! Sources: Agents Overview | LiveKit Docs | livekit-agents/livekit/agents/jupyter.py | Vision Agent Quickstart | LiveKit Docs
t
yeah i basically want just a voice agent, dont want the user to see a room on the screen
t
Hey there! If you want to set up a voice-only LiveKit agent without showing any room interface to your users, here’s a simple way to do it: 1. Agent Configuration: First, make sure your agent runs in audio-only mode by setting
auto_subscribe=AutoSubscribe.AUDIO_ONLY
. You can use
VoicePipelineAgent
or
MultimodalAgent
with voice-focused instructions to keep responses clear and perfectly tuned for voice. 2. Client-Side Implementation: On the client side, turn off video and UI elements. For example, if you’re using a React app with
@livekit/components-react
, just set
video={false}
and
audio={true}
in your
LiveKitRoom
component. Also, skip rendering UI components like
VideoConference
or
AudioConference
. 3. Optional Playground Customization: If you’re working in the Agents Playground, you can tweak the settings to disable video and chat UI by setting
outputs.video
and
inputs.camera
to
false
. And that’s it! This way, your users get a smooth voice-only experience without any visible room interface getting in the way. Sources: examples/nextjs/pages/minimal.tsx | Agents Playground | LiveKit Docs | Text and transcriptions | LiveKit Docs | How to Set Up Speech-to-Text Input with Text-Only Output in LiveKit Agents | agent-examples/agent_examples/pipeline_agent.py
t
the code isnt picking up my mic / input
t
Hey there! If your microphone or input isn’t coming through, no worries—here are some friendly tips to help you troubleshoot: 1. Check Browser Permissions: Make sure your browser has given microphone access to the LiveKit app. 2. Select the Correct Microphone: Double-check that the right microphone is selected in your device settings. 3. Silence Warning: If you see a "silence detected" message, it might just be noise suppression kicking in or a brief pause in speaking. It doesn’t always mean there’s a problem with your hardware. 4. Adjust Voice Activity Detection (VAD): Try lowering the
min_silence_duration
in the
VADStream
settings to help the system respond more quickly to your voice. 5. Prevent Queue Overflow: If you run into frame capture errors, bump up the
queue_size_ms
to keep things running smoothly without buffer issues. 6. Enable Noise Cancellation: Turning on background noise and echo cancellation in your agent’s setup can really improve audio quality. 7. Monitor Audio: Using tools like
BarVisualizer
can help you see if audio is being picked up properly. If any of this feels tricky or you want a hand with any step, just let me know—I’m here to help! Sources: components/livekit/agent-control-bar/agent-control-bar.tsx | Agent Testing & Evaluation | livekit/livekit_composite | DeepWiki | Understanding "silence detected on local audio track" warning | Speech & Audio Processing | livekit/livekit_composite | DeepWiki | SIP troubleshooting guide | LiveKit Docs
t
cool this makes sense. but if i have two agent use cases, one just audio and minimal, and another that joins a room , whats the best approach for managing / choosing whcih one to use at any given time
t
Here’s a friendly guide to managing both an audio-only minimal agent and an agent that joins a room, with some best practices to keep things running smoothly: 1. Audio-Only Minimal Agent: ◦ Set up the agent with
auto_subscribe=AutoSubscribe.AUDIO_ONLY
so it focuses just on audio tracks. ◦ Go for a lightweight pipeline like
VoicePipelineAgent
that includes STT, LLM, and TTS plugins. ◦ Turn off video and data subscriptions to keep resource use nice and low. 1. Room-Joining Agent: ◦ Use
worker_type = WorkerType.ROOM
to have the agent activate when a room is created. ◦ Interact with participants and manage tracks easily using
ctx.room
. ◦ If you want, you can wait for participants with
ctx.wait_for_participant()
before kicking off interactions. 1. Managing Multiple Use Cases: ◦ It’s a good idea to deploy separate workers for different tasks—like one for room agents and another for audio-only agents. ◦ Namespaces or
JobType
filters can help you route the right logic to the right agent. ◦ Prewarming shared resources, such as VAD models, can speed things up when agents start. 1. Scalability: Take advantage of LiveKit’s built-in load balancing to effortlessly scale agents across your deployments. This setup is designed to keep things efficient and scalable for both scenarios. Feel free to reach out if you want to dive deeper into any part of the implementation—I’m here to help! Sources: test/agent_test.go | OpenAI and LiveKit partner to turn Advanced Voice into an API | README.md | agent-examples/agent_examples/pipeline_agent.py | web/src/components/code-viewer.tsx
t
how do i autosubscribe to audio only in node js
t
Hey there! If you want to set
auto_subscribe
to
AUDIO_ONLY
in LiveKit using Node.js, here’s a simple example to get you started:
Copy code
async function entrypoint(ctx) {
  // Connect to the room with auto-subscribe set to audio only
  await ctx.connect({ autoSubscribe: AutoSubscribe.AUDIO_ONLY });

  // Rest of your agent logic...
}
The
AutoSubscribe
enum, which includes the handy
AUDIO_ONLY
option, comes from the
@livekit/rtc-node
package. This way, your agent will subscribe just to audio tracks and skip video—perfect if you’re focusing on voice-only apps. Feel free to reach out if you want me to walk you through anything else! Sources: agent/main.py | agents/src/job.ts | livekit-agents/livekit/agents/job.py | Working with the MultimodalAgent class | LiveKit Docs