thankful-rain-68349
11/15/2025, 10:53 AMtall-airline-16756
11/15/2025, 10:53 AMtall-airline-16756
11/15/2025, 10:53 AMAssistant class, you can simply pass the system prompt through the instructions argument inside the super().__init__() call, like this:
class Assistant(Agent):
def __init__(self) -> None:
super().__init__(
instructions="You are a helpful voice AI assistant. You respond clearly and concisely."
)
This way, the system prompt is set directly to guide your agent’s behavior.
Method 2: Pass a Custom Chat Context
Alternatively, you can create a custom ChatContext and provide it when starting your session. This gives you more flexibility over the initial messages, like so:
from livekit.agents import llm
initial_ctx = llm.ChatContext().append(
role="system",
text="You are a helpful voice AI assistant."
)
await session.start(
room=ctx.room,
agent=Assistant(),
chat_ctx=initial_ctx
)
Both approaches work well! The first is straightforward and quick to set up, while the second offers more dynamic control during runtime. If you have any questions or want to explore these options further, just let me know—I’m here to help!
Sources: Voice AI quickstart | LiveKit docs | Workflows | LiveKit docs | External data and RAG | LiveKit Docsthankful-rain-68349
11/15/2025, 11:40 AMtall-airline-16756
11/15/2025, 11:40 AMinstructions parameter in the Agent class is automatically passed along to the LLM. Think of these instructions as helpful guidance that gets included in the chat context sent to the LLM during inference, shaping how the model responds.
These instructions are kept within the agent's context and are dynamically added to the system-level messages for the LLM. This way, the behavior you've set in the instructions stays consistent throughout your entire session, making sure everything runs smoothly.
Sources: livekit-agents/livekit/agents/voice/generation.py | examples/src/basic_tool_call_agent.ts | Agent Session Management & Turn Detection | livekit/livekit_composite | Dee...thankful-rain-68349
11/15/2025, 11:59 AMtall-airline-16756
11/15/2025, 11:59 AMsession.generateReply method works with the instructions parameter! Essentially, it allows the AI agent to create a verbal response based on the guidance you provide. For example, when you use the instruction "Greet the user and offer your assistance," the agent will respond by warmly greeting the user and offering help.
Once the response is generated, it’s added to the chat history and turned into speech so the user can hear it. The generateReply method gives you a SpeechHandle object, which is super handy because it lets you manage the speech playback—like waiting for it to finish or handling any interruptions.
This method is a great tool for steering the agent’s behavior dynamically during your session. If you have any questions or want me to walk you through it further, just let me know—I’m here to help!
Sources: README.md | External data and RAG | LiveKit Docs | livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/realtime/... | Agent speech and audio | LiveKit docsthankful-rain-68349
11/15/2025, 12:08 PMRoomInputOptions.closeOnDisconnect=False)
participant: "identity-iK1V"
reason: "CLIENT_INITIATED"
[173749.378] INFO (16578): playout interrupted
speech_id: "speech_7486834d-24d"
playbackPosition: 0
[173749.378] INFO (16578): playout completed with interrupt
speech_id: "speech_7486834d-24d"
message: "-"
^CForce exit (Ctrl+C pressed twice)
why the errors are comingtall-airline-16756
11/15/2025, 12:09 PMGNotificationCenterDelegate, the LiveKit sources don’t offer specific details on this. It might be worth taking a closer look at your runtime environment or how your dependencies are set up to get to the bottom of it.
Please don’t hesitate to reach out if you’d like me to walk you through any of this or if you have more questions—I’m here to help!
Sources: plugins/deepgram/src/tts.ts | Node.js Agents Architecture | livekit/livekit_composite | DeepWiki