LiveKit Agent
Tavus offers integration with the LiveKit Agents framework, an open-source framework for building conversational agents by LiveKit. You can easily add Tavus Replicas to your LiveKit agents and give them a video layer.
You can keep your LiveKit AgentSession
workflow as-is and just create a new Tavus conversation with certain settings.
Tavus Setup
Authentication
Make sure you’ve grabbed an API key in your platform homepage. You’re going to need this key in your LiveKit Agents script.
Replica and Persona Setup
Although you may use any Phoenix-2/Phoenix-3 replica for this, we recommend you try out one of our Phoenix-3 replicas, or better yet ones that are marked as ‘PRO’ that are optimized for conversational quality. For persona creation, ensure that the pipeline_mode
is set to echo
and define a transport
layer under layers
, making sure to correctly set the transport_type
inside to be livekit
.
LiveKit Setup
Once you’ve got your replica and persona ID ready, you can integrate it directly into LiveKit’s AgentSession
workflow via an AvatarSession
.
To get started, install the plugin from PyPI:
pip install livekit-agents[tavus]~=1.0
You would then instantiate an AvatarSession
in conjunction with an AgentSession
, as follows:
You can find further code snippets and implemention details on LiveKit’s integration guide.