fancy-planet-81885
10/28/2025, 11:58 PMtall-airline-16756
10/28/2025, 11:58 PMtall-airline-16756
10/28/2025, 11:59 PMSANDBOX_ID property is a handy way to authenticate and connect your frontend applications to LiveKit's sandbox environment, especially when you're working on development and testing. It makes getting tokens much easier since you don’t need to set up a custom backend token server.
Now, while the SANDBOX_ID itself doesn’t directly link your frontend to a specific agent, you can definitely use it alongside the agentName parameter in your room configuration to connect to a particular agent. Here’s a little example to illustrate:
const res = await fetch(url.toString(), {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Sandbox-Id': appConfig.sandboxId ?? '',
},
body: JSON.stringify({
room_config: appConfig.agentName ? {
agents: [{ agent_name: appConfig.agentName }]
} : undefined,
}),
});
With this setup, the LiveKit server can create a room that includes the agent you specified, so both your frontend and that agent can join the same room seamlessly.
If you have any questions or need a bit more help, please don’t hesitate to reach out—I’m here to support you!
Sources: README.md | Sources/LiveKit/Token/SandboxTokenSource.swift | README.md | Template System & Example Applications | livekit/livekit_composite | DeepWi...fancy-planet-81885
10/29/2025, 12:01 AMtall-airline-16756
10/29/2025, 12:02 AM.env files tailored to each environment. For example, you can create .env.devA and .env.devB files with these variables:
LIVEKIT_URL=your_devA_url
LIVEKIT_API_KEY=your_devA_api_key
LIVEKIT_API_SECRET=your_devA_api_secret
3. Agent Deployment: When deploying agents, use commands specific to the environment. For instance:
◦ For Python agents: run python myagent.py dev for development or python myagent.py start for production.
◦ For Node.js agents: run pnpm run build && node agent.ts dev for development or pnpm run build && node agent.ts start for production.
1. Agent Dispatch: You can specify which agent to connect to using the room_config parameter. For example:
room_config: {
agents: [{ agent_name: "DevA_Agent" }]
}
2. Namespace Isolation: To keep things even more organized, use namespaces in agent registration to separate agent pools. For example, in Python: ac.Run(JobType, "namespace").
If any of these steps feel unclear or if you'd like me to walk you through any part in more detail, please don’t hesitate to ask. I’m here to help!
Sources: Voice Assistant Applications | livekit/livekit_composite | DeepWiki | test/agent_test.go | Workflows | LiveKit Docs | Deploying to custom environments | LiveKit Docs | README.mdfancy-planet-81885
10/29/2025, 12:02 AMtall-airline-16756
10/29/2025, 12:03 AMLIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET environment variables.
2. Distinguish Agents via Agent Name: Use the room_config parameter to specify which agent you want to dispatch. For example:
room_config: {
agents: [{ agent_name: "DevA_Agent" }]
}
3. Assign Unique Agent Names: Make sure each agent script (like dev_a.py and dev_b.py) registers with its own unique name or namespace. This way, Dev A and Dev B are recognized as separate agents.
4. Run Agents Independently: You can run each agent on its own by using commands such as python agent_a.py dev and python agent_b.py dev to start them in development mode.
5. Optional Metadata: If you want, you can pass structured metadata (like {"developer": "Dev A"}) during dispatch to help differentiate agents in your logs and behavior.
This setup helps keep things simple by avoiding multiple projects, while still giving each developer their own isolated agent environment. If anything feels unclear or if you’d like a hand with any step, just let me know—I’m here to help!
Sources: Deploying to custom environments | LiveKit Docs | Voice Assistant Applications | livekit/livekit_composite | DeepWiki | README.md | Server-Side SDKs & Authentication | livekit/livekit_composite | DeepWiki | Agent dispatch | LiveKit Docsfancy-planet-81885
10/29/2025, 12:05 AMtall-airline-16756
10/29/2025, 12:06 AMagent_name="Agent Dev 1" in the room configuration to make sure this specific agent is dispatched.
• Frontend from Dev Machine 2 connects to Agent Dev 2: Similarly, use agent_name="Agent Dev 2" to dispatch this agent smoothly.
• Frontend from QA connects to Agent QA: Configure the room with agent_name="Agent QA" to route it correctly.
• Frontend from Prod connects to Agent Prod: Use agent_name="Agent Prod" to handle production-specific logic confidently.
Each agent can run its own code since they’re identified by their agent_name or namespace. This setup helps you keep your logic and behavior nicely separated for each environment, while still using the same LiveKit project credentials.
If you’d like, I’m here to help with any more details or guide you through setting this up step-by-step!
Sources: Deploying to custom environments | LiveKit Docs | examples/agent_dispatch.py | Agent dispatch | LiveKit Docs | test/agent_test.gofancy-planet-81885
10/29/2025, 12:10 AMtall-airline-16756
10/29/2025, 12:11 AMagent_name in the room_config. This step helps the LiveKit server know exactly which agent to connect you with.
• Agent-Side: On the agent’s end (like in agent.py), it’s important that the agent is running and registered using the same agent_name. This way, it can listen for dispatch events and join the room when it’s called.
Both sides really need to be on the same page with key details like the room name, agent name, and environment variables (such as LIVEKIT_API_KEY and LIVEKIT_API_SECRET). If these don’t match up, the agent might not be dispatched properly.
Please feel free to reach out if you’d like a hand setting up either the frontend or the agent configuration—I’m here to help!
Sources: OpenAI and LiveKit partner to turn Advanced Voice into an API | README.md | Voice Assistant Applications | livekit/livekit_composite | DeepWiki | complex-agents/ivr-agent/README.md | README.mdfancy-planet-81885
10/29/2025, 2:13 PMtall-airline-16756
10/29/2025, 2:14 PMRoomConfiguration, the LiveKit server takes care of dispatching the agent automatically.
After the token is generated, the frontend doesn’t need to worry about the agent name anymore. It simply uses the token to connect to the room, and the LiveKit server makes sure the right agent is assigned based on what’s in the token.
If you have any questions or want me to walk you through the token generation process, just let me know—I’m here to help!
Sources: src/pages/api/token.ts | app/api/connection-details/route.ts | Voice Assistant Applications | livekit/livekit_composite | DeepWiki | Sources/LiveKit/Token/EndpointTokenSource.swift