Skip to main content

Step 1 — Install and configure

Until the plugin is published on the LiveKit repository, install it from our fork — see Installation.
Set your environment variables:

Step 2 — Add AvatarSession to your agent

Import AvatarSession, instantiate it with your avatar, and call start() before starting the agent session:
That’s it. AvatarSession creates the Agent Human session, generates the LiveKit token, and routes your agent’s audio output through the avatar video stream automatically.
Keep the turn_handling setting above. With LiveKit’s adaptive interruption detection (the default in dev mode), speech over the avatar can be taken for a backchannel (“mm-hm”) and ignored, so the avatar keeps talking when the user interrupts. See Interruptions.

Step 3 — Run your agent

avatar.start() reads LIVEKIT_URL, LIVEKIT_API_KEY, and LIVEKIT_API_SECRET from environment variables. You can also pass them directly — see Configuration.