Skip to main content

Avatar

Avatars add a visual, human-like presence to your AI agents, creating more engaging and natural interactions. The VideoSDK Agents framework supports virtual avatars through the Simli integration, providing lifelike video representations that sync with your agent's speech.

Avatar

Overview

Avatar functionality enables your AI agents to:

  • Visual Presence: Display a human-like avatar that represents your agent
  • Lip Sync: Automatically synchronize avatar mouth movements with speech
  • Real-time Rendering: Generate avatar video in real-time during conversations
  • Customizable Appearance: Choose from different avatar faces and styles
  • Seamless Integration: Works with both CascadingPipeline and RealTimePipeline

What Avatars Enable

With avatar capabilities, your agents can:

  • Provide a more human and approachable interface
  • Increase user engagement through visual interaction
  • Create branded agent personalities with custom appearances
  • Enhance accessibility through visual communication cues
  • Build trust through consistent visual representation

Simli Avatar Integration

Basic Setup

The Simli avatar integration provides high-quality virtual avatars with real-time lip synchronization.

main.py
from videosdk.plugins.simli import SimliAvatar, SimliConfig  

# Configure your avatar
avatar_config = SimliConfig(
apiKey="your-simli-api-key",
faceId="0c2b8b04-5274-41f1-a21c-d5c98322efa9", # Default face
syncAudio=True,
handleSilence=True
)

avatar = SimliAvatar(config=avatar_config)

Avatar Configuration Options

Customize your avatar's behavior and appearance:

main.py
from videosdk.plugins.simli import SimliConfig  

config = SimliConfig(
apiKey="your-simli-api-key",
faceId="your-custom-face-id", # Choose avatar appearance
syncAudio=True, # Enable lip sync
handleSilence=True, # Manage silent periods
maxSessionLength=1800, # 30 minutes max session
maxIdleTime=300 # 5 minutes idle timeout
)

Pipeline Integration

Add avatar to your cascading pipeline setup:

main.py
from videosdk.agents import CascadingPipeline, AgentSession  
from videosdk.plugins.simli import SimliAvatar, SimliConfig

# Configure avatar
avatar_config = SimliConfig(apiKey="your-simli-api-key")
avatar = SimliAvatar(config=avatar_config)

# Create pipeline with avatar
pipeline = CascadingPipeline(
stt=your_stt_provider,
llm=your_llm_provider,
tts=your_tts_provider,
avatar=avatar # Add avatar to pipeline
)
info

You can also specify the avatar in your room configuration:

main.py
from videosdk.agents import JobContext, RoomOptions  

def make_context():
avatar = SimliAvatar(config=SimliConfig(apiKey="your-api-key"))

return JobContext(
room_options=RoomOptions(
room_id="your-room-id",
auth_token="your-auth-token",
name="Avatar Agent",
avatar=avatar # Specify avatar in room options
)
)

Example - Try Out Yourself

Got a Question? Ask us on discord