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.
Installation
uv add "livekit-agents[anam]~=1.5"
pnpm add @livekit/agents-plugin-anam
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 agentsfrom livekit.agents import AgentServer, AgentSessionfrom livekit.plugins import anamserver = AgentServer()@server.rtc_session(agent_name="my-agent")async def my_agent(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 joinawait avatar.start(session, room=ctx.room)# Start your agent session with the userawait session.start(# ... room, agent, room_options, etc....)
import { voice } from '@livekit/agents';import * as anam from '@livekit/agents-plugin-anam';const session = new voice.AgentSession({// ... stt, llm, tts, etc.});const avatar = new anam.AvatarSession({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 joinawait avatar.start(session, room);// Start your agent session with the userawait session.start(// ... room, agent, room_options, etc.);
Preview the avatar in the Agent Console 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.
Director notes
Director notes set a baseline expressive style for the avatar and control how strongly it performs that style.
Director notes apply only to avatars using the Cara 4 model.
To use director notes, set avatarModel to cara-4 and pass a DirectorNotes object to your PersonaConfig:
from livekit.plugins import anamavatar = anam.AvatarSession(persona_config=anam.PersonaConfig(name="...",avatarId="...",avatarModel="cara-4",directorNotes=anam.DirectorNotes(presetStyle="warm",expressivity=0.7,),),)
Choose a built-in style with presetStyle or provide your own with customStylePrompt. For the full list of preset styles, see Anam director notes .
Parameters
This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.
persona_configanam.PersonaConfigConfiguration for the avatar to use.
nameRequiredstringName of the avatar to use. See Avatar setup for details.avatarIdRequiredstringID of the avatar to use. See Avatar setup for details.avatarModelstringAvatar model version, for examplecara-4. Required to use director notes. Omit to use the avatar's default model.directorNotesanam.DirectorNotesBaseline expressive style for the avatar. Cara 4 only. See Director notes.presetStylestringA built-in expressive style, such aswarmorhappy. Mutually exclusive withcustomStylePrompt.customStylePromptstringA free-form expressive style prompt. Mutually exclusive withpresetStyle.expressivityfloatHow strongly the avatar performs the style, from0to1. Omit to use Anam's default.
avatar_participant_namestringDefault: anam-avatar-agentThe participant name to use for the avatar.
session_optionsanam.SessionOptionsPer-session output options. Omit to use the avatar model's default output size. See Anam's video options guide for each avatar model's default and supported sizes. In Node.js, use sessionOptions with videoWidth and videoHeight.
video_widthintDefault:NoneOutput video width in pixels. Set together withvideo_height(both or neither). Supported pairs are model-dependent, and Anam rejects an unsupported pair with an HTTP 400.video_heightintDefault:NoneOutput video height in pixels. Set together withvideo_width.
Additional resources
The following resources provide more information about using Anam with LiveKit Agents.