salmon-stone-48522
04/30/2026, 3:40 PMtall-airline-16756
04/30/2026, 3:40 PMtall-airline-16756
04/30/2026, 3:40 PMagent_name to `@server.rtc_session()`:
@server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: JobContext):
...
This makes the agent use explicit dispatch (it will only join rooms when requested).
• For Node.js, set agentName in ServerOptions when creating the agent (use your code's server options object).
• If you used the Agent Builder UI, the name is set in the UI when creating/editing the agent. Changing it after deployment can affect dispatch rules.
Tip: In dev environments, append a developer-specific suffix (via env var) so names stay unique across runs.
If you tell me whether you’re using Python, Node, or the Agent Builder UI, I’ll give the exact code or UI steps for your case.
Sources: Agent dispatch | LiveKit Documentation | Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | Avoiding crosstalk when multiple developers share a LiveKit project | LiveK... | Agent Builder | LiveKit Documentation, with interactive elementssalmon-stone-48522
04/30/2026, 3:44 PMtall-airline-16756
04/30/2026, 3:44 PMagents.cli.run_app(...), so set the agent name on your entrypoint using the @server.rtc_session() decorator.
Example:
from livekit import agents
server = agents.AgentServer()
@server.rtc_session(agent_name="my-agent")
async def entrypoint(ctx: agents.JobContext):
# your agent logic
...
if __name__ == "__main__":
logger.info("Starting LiveKit agent application")
agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint))
Notes:
• agent_name must be set on the rtc_session decorator — WorkerOptions does not set the agent dispatch name.
• Setting agent_name enables explicit dispatch (the agent only joins rooms when requested by that name).
If you want, tell me the agent name you want and I’ll show how to add a dev suffix via an env var for unique names in development.
Sources: Tavus virtual avatar integration guide | LiveKit Documentation | Agent dispatch | LiveKit Documentation | Server options | LiveKit Documentation | OpenAI and LiveKit partner to turn Advanced Voice into an API | LiveKit, with interactive elementssalmon-stone-48522
04/30/2026, 3:49 PMtall-airline-16756
04/30/2026, 3:50 PMlivekit.toml / lk agent deploy flow.
You cannot pass or template the agent name via livekit.toml or lk agent deploy. Agent dispatch names are set in code (Python: @server.rtc_session(agent_name=...)) and are not configurable from the TOML deploy file.
Two practical options:
• Set the name in code from an env var so the same code deploys with different names:
import os
AGENT_NAME = f"my-agent-{os.getenv('ENV', 'dev')}"
server = agents.AgentServer()
@server.rtc_session(agent_name=AGENT_NAME)
async def entrypoint(ctx: agents.JobContext):
...
• Use separate LiveKit projects for prod vs staging to fully isolate agents/rooms/config.
Which approach do you prefer (env var naming or separate projects)? I can give exact deploy steps for that option.
Sources: Build Your First AI Voice Agent in Python: Complete Tutorial | LiveKit | Agent dispatch | LiveKit Documentation | Avoiding crosstalk when multiple developers share a LiveKit project | LiveK..., with interactive elementssalmon-stone-48522
04/30/2026, 3:50 PMtall-airline-16756
04/30/2026, 3:51 PMimport os
from livekit import agents
ENV = os.getenv("ENV", "dev") # e.g. "prod" or "staging"
BASE_AGENT_NAME = "my-agent"
AGENT_NAME = f"{BASE_AGENT_NAME}-{ENV}" # my-agent-prod or my-agent-staging
server = agents.AgentServer()
@server.rtc_session(agent_name=AGENT_NAME)
async def entrypoint(ctx: agents.JobContext):
# agent logic
...
How to set the env var when deploying:
• Docker: docker run -e ENV=staging your-image
• Kubernetes: add env var to the Pod spec (env: - name: ENV value: "prod")
• lk agent deploy (container image): ensure the container image reads ENV from the environment you provide in your deployment pipeline or container runtime
• Local/.env: export ENV=staging or use a .env loader in dev
Notes:
• The agent name must still be set in code via `agent_name`; TOML cannot parameterize it.
• Choose unique names per environment to avoid dispatch crosstalk (e.g., my-agent-prod, my-agent-staging).
Would you like an example Dockerfile, Kubernetes manifest snippet, or exact lk deploy snippet for your CI pipeline?
, with interactive elements