Skip to main content

TruGen.AI realtime avatar integration guide

How to use the TruGen.AI realtime avatar plugin for LiveKit Agents.

Available in
Python

Overview

TruGen enables developers and enterprises to build realtime AI video applications that support low-latency, bidirectional audio and video interactions between users and AI agents. You can use the open source TruGen integration for LiveKit Agents to add realtime avatars to your voice AI app.

Quick reference

This section includes a basic usage example and some reference material. For links to more detailed documentation, see Additional resources.

Installation

Install the plugin from PyPI:

uv add "livekit-agents[trugen]~=1.4"

Authentication

The TruGen.AI plugin requires a TruGen API key.

Set TRUGEN_API_KEY in your .env file.

Usage

Use the plugin in an AgentSession. For example, you can use this avatar in the Voice AI quickstart.

from livekit import agents
from livekit.agents import AgentServer, AgentSession
from livekit.plugins import trugen
server = AgentServer()
@server.rtc_session()
async def my_agent(ctx: agents.JobContext):
session = AgentSession(
# ... stt, llm, tts, etc.
)
avatar = trugen.AvatarSession(
avatar_id="...", # ID of the TruGen stock avatar to use
)
# Start the avatar and wait for it to join
await avatar.start(session, room=ctx.room)
# Start your agent session with the user
await session.start(
# ... room, agent, room_options, etc....
)

Preview the avatar in the Agents Playground or a frontend starter app that you build.

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

avatar_idstringOptionalDefault: 7d881c1b

ID of the TruGen stock avatar to use. Learn more at Stock Avatars.

avatar_participant_identitystringOptionalDefault: trugen-avatar

The identity of the participant to use for the avatar.

avatar_participant_namestringOptionalDefault: Trugen Avatar

The name of the participant to use for the avatar.

Additional resources

The following resources provide more information about using TruGen.AI realtime avatars with LiveKit Agents.