Skip to main content

Anam virtual avatar integration guide

How to use the Anam virtual avatar plugin for LiveKit Agents.

Available in
Python

Overview

Anam provides lifelike avatars for realtime conversational AI. You can use the open source Anam integration for LiveKit Agents to enable seamless integration of Anam avatars into 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:

pip install "livekit-agents[anam]~=1.2"

Authentication

The Anam plugin requires an Anam API key.

Set ANAM_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 AgentSession, RoomOutputOptions
from livekit.plugins import anam
async def entrypoint(ctx: agents.JobContext):
session = AgentSession(
# ... stt, llm, tts, etc.
)
avatar = anam.AvatarSession(
persona_config=anam.PersonaConfig(
name="...", # Name of the avatar to use.
avatarId="...", # ID of the avatar to use. See "Avatar setup" for details.
),
)
# 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_input_options, etc....
)

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

Avatar setup

You can use stock avatars provided by Anam or create your own custom avatars using Anam Lab.

  • Stock Avatars: Browse a collection of ready-to-use avatars in the Avatar Gallery.
  • Custom Avatars: Create your own personalized avatar using Anam Lab.

To use a stock avatar, copy the avatar ID from the gallery and use it in your PersonaConfig. For custom avatars, create them in the lab and use the generated avatar ID.

Parameters

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

persona_configanam.PersonaConfigOptional

Configuration for the avatar to use.

  • namestringRequired
    Name of the avatar to use. See Avatar setup for details.
  • avatarIdstringRequired
    ID of the avatar to use. See Avatar setup for details.
avatar_participant_namestringOptionalDefault: anam-avatar-agent

The participant name to use for the avatar.

Additional resources

The following resources provide more information about using Anam with LiveKit Agents.