How can I connect my local deployed agent to agent...
# ask-ai
a
How can I connect my local deployed agent to agents playground
t
Thanks for reaching out, Aditya. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’ll help you connect a locally deployed agent to the Agents Playground. What this covers: how to run your agent in dev mode, verify it registers with LiveKit, and join the Playground room so you can test audio/video/text interactions. Steps 1. Run your agent in dev mode so it registers with LiveKit and becomes reachable: ◦ Python example:
Copy code
uv run agent.py dev
• Node example (ensure
dev
script exists in
package.json
):
Copy code
pnpm dev
1. Verify the agent connected: ◦ Check the agent logs for a successful registration/connection message. ◦ The agent should automatically accept new sessions (rooms) when in dev mode. 1. Open the Agents Playground: ◦ Go to https://agents-playground.livekit.io/ 1. Join a room from the Playground: ◦ Enter any room name (e.g.,
test-room
) and click Connect. ◦ When the room is created, your locally running agent in dev mode will automatically join the room. 1. Interact and confirm: ◦ Use microphone, camera, or text input in the Playground to send multimodal input. ◦ Confirm the agent’s responses (audio/video/text) are streamed back to the Playground. 1. If the agent doesn’t join or respond: ◦ Ensure the Playground and your agent use the same LiveKit server URL. ◦ Confirm your agent is actually running in
dev
mode and is accepting incoming jobs/sessions. ◦ Check agent logs for errors or rejected session messages. If you’d like, tell me: • Which agent runtime you’re using (Python or Node), and • Any log messages you see when starting the agent. I can give targeted troubleshooting steps based on that. Sources: Agents playground | LiveKit docs | Voice AI quickstart | LiveKit docs
a
I am not using cloud livekit. I am locally runnign the livekit
t
Thanks — good to know you're using a self‑hosted LiveKit. I’ll walk you through the minimal steps to connect your local LiveKit + agent to the hosted Agents Playground, and then ask two quick questions to tailor troubleshooting. What to do (summary) 1. Expose your local LiveKit server publicly ◦ Start LiveKit so it binds to 0.0.0.0 (not 127.0.0.1): livekit-server --dev --bind 0.0.0.0 • Use a tunnel (eg. ngrok) to get a public URL that the Playground can reach: ngrok http 7880 • Note the public wss:// host from ngrok (e.g., wss://abc123.ngrok.io) 1. Configure your agent to use the public LiveKit endpoint ◦ Start your agent in dev mode but point its LiveKit URL to the ngrok/public URL (not localhost). ◦ Ensure it uses the same dev `api_key`/`secret` for your local server. 1. Connect the hosted Agents Playground ◦ Open https://agents-playground.livekit.io/ ◦ Enter the public LiveKit URL from the tunnel, a room name, and a valid token (or dev credentials). ◦ Create/connect the room — your agent (running in dev mode and pointed at that server) should join automatically. Quick troubleshooting checklist • Confirm LiveKit is reachable from the internet (paste the ngrok URL in a browser or use wscat). • Confirm agent logs show successful registration/connection and no auth errors. • Ensure firewall/NAT allows incoming traffic for the tunnel. • Use the same LiveKit URL, API key/secret, and room name in both agent and Playground. Two quick questions to help further • Which agent runtime are you using: Python or Node? • Do you already have a public tunnel URL (ngrok or similar) you can share? Tell me those and any agent/server log lines showing errors and I’ll give targeted next steps. Sources: Running LiveKit locally | LiveKit docs | Agents playground | LiveKit docs
a
Can't I run the playground also locally?
t
Yes — you can run the Agents Playground locally so it talks directly to your self‑hosted LiveKit and agent. Quick steps 1. Clone the repo: ◦ https://github.com/livekit/agents-playground 1. Install and start: ◦ Follow the repo README to install dependencies (npm/pnpm/yarn) and run the dev server (usually
pnpm dev
or
npm run dev
). 1. Configure the Playground to point to your LiveKit server: ◦ Update the playground's configuration or environment (per the repo README) to use your local LiveKit URL (eg.
<ws://your-host:7880>
or the public tunnel URL if needed) and a valid token or dev credentials. 1. Run your agent and LiveKit server locally: ◦ Start LiveKit binding to 0.0.0.0 if you need external access. ◦ Start your agent in
dev
mode and ensure it connects to the same LiveKit URL. Troubleshooting tips • If browser media (mic/camera) is blocked, allow permissions for the local dev origin (http://localhost:PORT). • If the playground can’t reach your LiveKit server, either run the playground and server on the same machine/network or expose LiveKit with a tunnel (ngrok) and use that public URL in the playground. • Check console and agent logs for registration/auth errors; confirm API key/secret match. Would you like step‑by‑step commands for cloning + running the playground on your OS (macOS/Linux/Windows), or help updating the playground config to your LiveKit URL? Which runtime are you using for your agent (Node or Python)? Sources: Agents playground | LiveKit docs | An open source stack for real-time multimodal AI | Voice AI quickstart | LiveKit docs
a
how can I make my two agents talk to each other?
t
You're asking how to make two agents talk to each other — I can help. Short answer: allow agents to accept audio from other agents and ensure both are in the same LiveKit room with TTS enabled. What to change • In each agent's AgentSession, set RoomInputOptions / roomInputOptions to include ParticipantKind.AGENT in allowed kinds. This lets an agent detect/transcribe speech coming from another agent. Code examples • Python
Copy code
from livekit import agents, rtc

session = agents.voice.AgentSession(
  # other settings...
  room_input_options=agents.RoomInputOptions(
    allowed_kinds=[rtc.ParticipantKind.PARTICIPANT_KIND_AGENT]
  )
)
• Node.js
Copy code
import { voice } from '@livekit/agents';
import { rtc } from 'livekit-client';

const session = new voice.AgentSession({
  // other settings...
  roomInputOptions: {
    allowedKinds: [rtc.ParticipantKind.AGENT]
  }
});
Must-haves for agent-to-agent voice • Both agents connected to the same LiveKit room. • Both agents include
ParticipantKind.AGENT
in their allowed kinds. • TTS configured on agents so synthesized audio is produced and published. • Agents publish their audio tracks to the room (so the other agent can hear them). Useful scenarios • Automated testing (one agent simulates a user, the other responds). • Multi-agent pipelines where one agent hands off to another. Do you want a full example for Node or Python that wires STT → LLM → TTS between two local agents, or do you need help enabling TTS/audio publishing in your current agent? Which runtime are you using? Sources: How to Enable Agent-to-Agent Speech Detection in LiveKit | How to test your agent using another agent | Agents and handoffs | LiveKit docs | Agents Framework | livekit/livekit_composite | DeepWiki | Turns overview | LiveKit docs