busy-spoon-35253
09/18/2025, 9:43 PMtall-airline-16756
09/18/2025, 9:43 PMtall-airline-16756
09/18/2025, 9:45 PM.env.local file with your API keys and LiveKit server details—this will keep everything connected smoothly.
4. Write Your Agent Code: Now, you can implement your voice agent using the LiveKit Agents framework, choosing the STT, LLM, and TTS models that best fit your needs.
5. Deploy to LiveKit Cloud: When you’re ready, authenticate with LiveKit Cloud, head to your project directory, and deploy using the LiveKit CLI. This step will take care of configuration, registration, and deployment of your agent.
6. Monitor and Scale: Finally, keep an eye on your sessions through the LiveKit Cloud dashboard, where you can manage scaling and easily handle updates or rollbacks as needed.
If you want more detailed instructions, the LiveKit documentation on deploying voice agents is a great resource. And please, feel free to reach out if you’d like me to guide you through any specific step—I’m here to help!
Sources: Deploy and scale agents on LiveKit Cloud | LiveKit | Voice AI quickstart | LiveKit Docs | Deploying to production | LiveKit Docsbusy-spoon-35253
09/18/2025, 9:46 PMtall-airline-16756
09/18/2025, 9:46 PMbusy-spoon-35253
09/19/2025, 1:10 AMtall-airline-16756
09/19/2025, 1:10 AMbusy-spoon-35253
09/19/2025, 10:44 AMtall-airline-16756
09/19/2025, 10:45 AMdev mode so it’s ready and accessible for testing.
2. Access the Playground: Head over to https://agents-playground.livekit.io, enter your LiveKit server URL and access token, then connect to your agent.
3. Test Interactions: From there, you can try out voice, video, and text interactions with your agent in real-time and see how it responds.
If you’d like, you can also self-host the playground to customize it or use programmatic testing frameworks for text-only tests. Please don’t hesitate to reach out if you’d like a hand setting up the playground or generating access tokens—I’m here to help!
Sources: Agents Playground | LiveKit Docs | Agents playground | LiveKit Docs | Vision Agent Quickstart | LiveKit Docs | Vision Agent Quickstart | LiveKit Docs | Agents Playground | LiveKit Docsbusy-spoon-35253
09/19/2025, 11:43 AMtall-airline-16756
09/19/2025, 11:44 AMbusy-spoon-35253
09/20/2025, 7:02 AMtall-airline-16756
09/20/2025, 7:03 AMcall-, your agent should be configured to join rooms with that same prefix.
2. Check SIP Trunk and Dispatch Rule: Make sure the SIP trunk and dispatch rule in LiveKit are properly configured and linked to your Twilio phone number.
3. Validate Environment Variables: It’s important to confirm that all necessary credentials (like LIVEKIT_API_KEY, LIVEKIT_API_SECRET, and TWILIO_SIP_USERNAME) are correctly set up in your environment.
4. Enable Debug Logging: Adding debug logging to your agent can be really helpful to track the connection attempts and pinpoint exactly where it might be having trouble joining the room.
To make things easier, here are some demo GitHub repositories you might find useful:
• livekit-sip-agent-example: This shows a LiveKit agent answering SIP calls from Twilio.
• node-agents-examples: Includes a SIP integration demo with automated setup scripts to simplify the process.
• agent-demos: Offers various telephony demos, like IVR and SIP assistants, which might give you some extra insights.
These examples come with working code and setup scripts that should help guide you through fixing the issue. If you have any questions or need more support, please don’t hesitate to reach out—I’m here to help!
Sources: packages/sip--um-actually/README.md | Inbound calls with Twilio Voice | LiveKit Docs | CHANGELOG.md | README.md | Agents telephony integration | LiveKit Docsbusy-spoon-35253
09/20/2025, 9:31 AMtall-airline-16756
09/20/2025, 9:32 AMlk agent logs --log-type=deploy
Or, if you prefer a quicker way, you can use this shorthand:
lk agent tail
Got multiple agents? No worries! Just specify the agent ID like this:
lk agent logs --id CA_MyAgentId --log-type deploy
These commands will show you the logs from the latest running instance of your agent. If you have any questions or need a hand with anything else, feel free to reach out—I’m here to help!
Sources: Log collection | LiveKit Docs | Agent deployment CLI reference | LiveKit Docsbusy-spoon-35253
09/20/2025, 9:36 AMtall-airline-16756
09/20/2025, 9:36 AMbusy-spoon-35253
09/20/2025, 9:37 AMtall-airline-16756
09/20/2025, 9:38 AMbusy-spoon-35253
09/20/2025, 9:39 AMtall-airline-16756
09/20/2025, 9:40 AMuv run agent.py dev
2. Verify Environment Variables: It’s important to double-check that your .env.local file contains the following:
◦ LIVEKIT_API_KEY
◦ LIVEKIT_API_SECRET
◦ NEXT_PUBLIC_LIVEKIT_URL=wss://<your-cloud-url>
1. Use the Hosted Playground: Head over to https://agents-playground.livekit.io and try manually entering your LiveKit server URL along with a valid access token.
2. Check WebSocket URL: Please ensure your LiveKit URL starts with wss:// and that it’s correctly pointing to your LiveKit Cloud instance.
3. Monitor Connection Status: The playground will give you real-time feedback on the connection. Keep an eye out for messages like "Waiting for agent video track…" or "No agent video track."—these clues can help us understand what’s happening.
If you’re still having trouble after these steps, don’t hesitate to reach out! Let me know if you’re seeing any specific error messages or if you’d like a hand with generating access tokens. I’m here to support you every step of the way.
Sources: README.md | README.md | Agents Playground | LiveKit Docs | src/cloud/CloudConnect.tsx | Getting Help | livekit/livekit_composite | DeepWikibusy-spoon-35253
09/20/2025, 9:41 AMtall-airline-16756
09/20/2025, 9:42 AMlk token create \
--api-key <project_key> \
--api-secret <project_secret> \
--join \
--room <room_name> \
--identity <user_identity> \
--valid-for 24h
2. Using a Server SDK: It’s best to create a backend endpoint to generate tokens securely. Here’s an example in Python:
from livekit import api
token = (
api.AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET)
.with_identity("user123")
.with_grants(api.VideoGrants(room_join=True, room="my-room"))
.to_jwt()
)
3. Using LiveKit Cloud Sandbox: You can send a POST request to <https://cloud-api.livekit.io/api/sandbox/connection-details> with your sandbox ID and room information.
Remember, it’s really important to generate tokens on a secure backend server to keep your API secret safe. If you’d like, I’m here to help you with the implementation—just let me know!
Sources: TEMPLATE.md | mcp/server.py | Generating tokens | LiveKit Docs | Android quickstart | LiveKit Docs | Android quickstart (Jetpack Compose) | LiveKit Docsbusy-spoon-35253
09/20/2025, 9:44 AMtall-airline-16756
09/20/2025, 9:44 AMlk agent logs --log-type=deploy
If you run into any trouble waking up the agent or have any other questions, please don’t hesitate to reach out. I’m here to help!
Sources: Agent deployment CLI reference | LiveKit Docs | Log collection | LiveKit Docs | Log collection | LiveKit Docsbusy-spoon-35253
09/20/2025, 9:45 AMtall-airline-16756
09/20/2025, 9:45 AMstart mode is a great way to optimize it for production! However, it’s important to know that this doesn’t guarantee the agent will always be running. The availability of your agent actually depends on your LiveKit Cloud plan:
• Free Plan: During periods of inactivity, agents might scale down to zero replicas, which can lead to cold starts when new sessions begin.
• Paid Plans (Ship, Scale, Enterprise): These plans come with cold start prevention, so your agents stay warm and ready to respond instantly.
If having your agent always running is important to you, a paid plan with cold start prevention would be the way to go. I’m here to help if you want to check your current plan or need assistance adjusting your setup—just let me know!
Sources: Voice AI quickstart | LiveKit Docs | Voice AI quickstart | LiveKit Docs | livekit-plugins/livekit-plugins-bithuman/livekit/plugins/bithuman/avatar.py | LiveKit Pricing | Deploying to production | LiveKit Docsbusy-spoon-35253
09/20/2025, 9:47 AMtall-airline-16756
09/20/2025, 9:48 AMdev mode. If you're using Python, you can do this by running:
uv run agent.py dev
2. Open the Playground: Head over to the hosted playground at https://agents-playground.livekit.io. This is where the magic happens!
3. Create a Room Access Token: You have a few options to generate this token:
◦ Using LiveKit CLI:
lk token create --api-key <your_api_key> --api-secret <your_api_secret> --room-name <room_name> --identity <user_identity> --ttl 1h
◦ With Server SDK (Python):
from livekit.rtc import AccessToken
token = (
AccessToken("your-api-key", "your-api-secret")
.with_identity("user123")
.with_name("Test Room")
.with_grants(video=True, audio=True, room_join=True)
.to_jwt()
)
print(token)
◦ Online Token Generator: You can also use the LiveKit Connection Tester to easily create a token.
1. Connect to the Playground: Once you have your token, enter your LiveKit server URL (for example, <wss://your-project.livekit.cloud>) into the playground and paste the token. Then, just click "Connect."
2. Try Out Your Agent: Now you can interact with your agent through audio, video, or text. The playground supports live transcription, chat input, and webcam/microphone integration to make testing smooth and fun.
If you run into any issues generating tokens or connecting, please don’t hesitate to reach out—I’m here to help you every step of the way!
Sources: Voice AI quickstart | LiveKit Docs | Agents Playground | LiveKit Docs | src/components/PlaygroundConnect.tsx | Agents playground | LiveKit Docs | Vision Agent Quickstart | LiveKit Docsbusy-spoon-35253
09/20/2025, 9:52 AMtall-airline-16756
09/20/2025, 9:53 AMlk token create \
--api-key <your_api_key> \
--api-secret <your_api_secret> \
--room-name <room_name> \
--identity <user_identity> \
--join
The --join flag lets the user join a room. You can also include other permissions like --roomCreate or --roomAdmin depending on what you need.
If you have any questions or need a hand with this, just let me know—I’m here to help!
Sources: Authentication | LiveKit Docs | LiveKit CLI | livekit/livekit_composite | DeepWiki | cmd/lk/token.gobusy-spoon-35253
09/21/2025, 9:26 AMtall-airline-16756
09/21/2025, 9:26 AMbusy-spoon-35253
09/21/2025, 9:29 AMtall-airline-16756
09/21/2025, 9:30 AMfrom livekit import api
req = api.RoomCompositeEgressRequest(
room_name="your-room",
layout="speaker",
audio_only=True,
segment_outputs=[
api.SegmentedFileOutput(
filename_prefix="session",
gcp=api.GCPUpload(
credentials="/path/to/credentials.json",
bucket="your-bucket"
)
)
]
)
lkapi = api.LiveKitAPI()
res = await lkapi.egress.start_room_composite_egress(req)
2. Use Ingress: Bring in external media, like RTMP streams, so your agent can process them. You can easily set this up using the CreateIngress API or CLI.
Both Ingress and Egress are seamlessly supported in LiveKit Cloud. If you’d like, I’m here to help you set up either one for your agent—just let me know!
Sources: Rooms, participants, and tracks | LiveKit Docs | README.md | Recording agent sessions | LiveKit Docs | README.md | README.mdbusy-spoon-35253
09/26/2025, 3:08 PMtall-airline-16756
09/26/2025, 3:10 PMbusy-spoon-35253
09/26/2025, 3:16 PMtall-airline-16756
09/26/2025, 3:17 PMfrom dataclasses import dataclass
@dataclass
class UserData:
name: Optional[str] = None
email: Optional[str] = None
2. Create the First Agent: This agent’s role is to collect the basic info and then hand off once everything needed is gathered.
class CollectInfoAgent(Agent):
def __init__(self):
super().__init__(instructions="Ask for the user's name and email.")
@function_tool()
async def record_name(self, name: str, context: RunContext[UserData]):
context.userdata.name = name
return self._handoff_if_complete(context)
@function_tool()
async def record_email(self, email: str, context: RunContext[UserData]):
context.userdata.email = email
return self._handoff_if_complete(context)
def _handoff_if_complete(self, context: RunContext[UserData]):
if context.userdata.name and context.userdata.email:
return SpecialistAgent(context.userdata.name, context.userdata.email)
return None
3. Create the Second Agent: This agent takes over smoothly, using the info collected to assist further.
class SpecialistAgent(Agent):
def __init__(self, name: str, email: str):
super().__init__(instructions=f"Welcome {name}. How can I assist {name} today?")
4. Initialize the Session: Begin your session with the first agent and share the data structure.
async def entrypoint(ctx: JobContext):
session = AgentSession(userdata=UserData())
await session.start(agent=CollectInfoAgent(), room=ctx.room)
This setup helps create a natural, seamless handoff between agents without making it obvious to the user that multiple agents are involved. If you have any questions or want to dive deeper, just let me know—I’m here to help!
Sources: README.md | flows/simple_flow.py | Building Multi-Agent Architectures with LiveKit Agents | Workflows | LiveKit Docsbusy-spoon-35253
09/26/2025, 3:24 PMtall-airline-16756
09/26/2025, 3:26 PMUserData) to keep everything consistent across agent switches.
from dataclasses import dataclass
@dataclass
class UserData:
collected_info: dict = field(default_factory=dict)
2. Create Agents with Reciprocal Tools: You’ll want to define agents using @function_tool methods that enable switching between them.
class AgentA(Agent):
@function_tool()
async def switch_to_b(self, context: RunContext[UserData]):
return AgentB()
class AgentB(Agent):
@function_tool()
async def switch_to_a(self, context: RunContext[UserData]):
return AgentA()
3. Preserve Context: Using the on_enter() method in each agent helps manage state updates or share messages when switching.
class AgentA(Agent):
async def on_enter(self, context: RunContext[UserData]):
self.session.say("Switching back to Agent A.")
4. Initialize the Session: Start your session with one agent and pass along the shared state so everything stays connected.
async def entrypoint(ctx: JobContext):
session = AgentSession(userdata=UserData())
await session.start(agent=AgentA(), room=ctx.room)
This approach ensures a smooth experience where agents can switch seamlessly while keeping your shared state and user context intact. If you have any questions or want to dive deeper, I’m here to help!
Sources: complex-agents/personal_shopper/personal_shopper.py | agents/src/voice/room_io/room_io.ts | Workflows | LiveKit Docsbusy-spoon-35253
09/26/2025, 4:08 PMtall-airline-16756
09/26/2025, 4:09 PMRunContext object doesn’t have a chat_ctx attribute. No worries though! You can fix this by accessing the chat context from the agent or session instead. For example:
return EquipmentManagerAgent(chat_ctx=self.session.chat_ctx)
This way, the conversation history stays intact during the handoff. If you have any questions or need a hand with this, just let me know—I’m here to help!
Sources: Workflows | LiveKit Docs | livekit-agents/livekit/agents/voice/agent.py | Workflows | LiveKit Docsbusy-spoon-35253
09/26/2025, 4:13 PMtall-airline-16756
09/26/2025, 4:14 PMreturn EquipmentManagerAgent(chat_ctx=self.session.chat_ctx)
Also, you might find it helpful to use the on_enter() method in the new agent to update or enhance the chat context if needed. If you'd like, I’m here to walk you through it or provide more examples—just let me know!
Sources: Docs::Telephony | livekit-agents/livekit/agents/voice/agent.py | Workflows | LiveKit Docs | Docs::Agents | complex-agents/medical_office_triage/triage.pybusy-spoon-35253
09/26/2025, 4:14 PMtall-airline-16756
09/26/2025, 4:14 PMcontext.session.current_agent.chat_ctx is a great approach as it properly accesses the chat context from the current agent. This way, you can be confident that the full conversation history is kept intact during the handoff.
If you run into any other challenges, please don’t hesitate to reach out—I’m here to help you debug or fine-tune the implementation!busy-spoon-35253
09/27/2025, 8:28 PMtall-airline-16756
09/27/2025, 8:29 PMagent_name in the agent’s WorkerOptions and confirm it aligns perfectly with the RoomAgentDispatch in your dispatch rule.
3. Dispatch Rule Setup: It’s important to verify that there’s a dispatch rule in place that routes incoming SIP calls to the correct rooms and prompts the agent to join.
4. Agent Dispatch Configuration: Check that your agent worker is set up to be dispatched to new rooms, whether that’s automatically or through explicit dispatch using RoomConfiguration and AgentDispatchClient.
If you’d like, I’m here to help you double-check these settings or assist with any other troubleshooting steps. Just let me know!
Sources: Agents telephony integration | LiveKit Docs | SIP troubleshooting guide | LiveKit Docs | Inbound calls with Twilio Voice | LiveKit Docs | LiveKit Agents | LiveKit Docs | examples/agent-dispatch/index.tsbusy-spoon-35253
09/27/2025, 8:31 PMtall-airline-16756
09/27/2025, 8:31 PMagent_name but the agent is still not joining the room, let's work through these steps together:
1. Verify Agent Name Consistency: Please double-check that the agent_name in the dispatch rule exactly matches the agent_name set in the agent’s WorkerOptions. Sometimes even small differences can cause hiccups.
2. Check Explicit Dispatch Setup: Make sure the agent worker is set up for explicit dispatch by having the agent_name field correctly configured in WorkerOptions.
3. Validate Agent Availability: Confirm that the agent worker is running and properly registered with the LiveKit server. If there’s no worker available for the specified agent_name, the dispatch won’t go through.
4. Review Logs: Take a look at the server or worker logs for any errors like "not dispatching agent job since no worker is available." This often points to the agent not being registered or running as expected.
5. Debug Dispatch Requests: You can use the listDispatch API to check if the dispatch request was created successfully and is currently pending.
If you’d like, I’m here to help you verify these settings or go over the logs together—just let me know!
Sources: Docs::Agents | Docs::Telephony | Agent dispatch | LiveKit Docs | examples/agent_dispatch.py | pkg/agent/client.gobusy-spoon-35253
09/27/2025, 8:32 PMtall-airline-16756
09/27/2025, 8:33 PMname parameter from req.accept() is indeed a great way to let LiveKit handle the default naming and ensure the agent joins the room smoothly. Here’s why this works well:
• The agent_name in WorkerOptions is already set correctly for dispatch matching.
• The name parameter in accept() is optional and mainly used if you want a custom display name.
• By leaving it out, LiveKit automatically uses default naming, which helps the agent join the room properly.
Here’s how you can deploy these changes:
1. Update your run.py file to remove both name and identity from req.accept().
2. Rebuild your Docker image by running ./deployment/livekit/build.sh.
3. Redeploy to LiveKit Cloud with printf "y\n1\n" | lk agent deploy ..
4. Finally, test the call to confirm the agent joins the room with 2 participants.
If you run into any bumps along the way or have questions, please don’t hesitate to reach out—I’m here to help!busy-spoon-35253
09/27/2025, 8:39 PMbusy-spoon-35253
09/28/2025, 8:13 AM