> ## Documentation Index
> Fetch the complete documentation index at: https://daily-docs-pr-4892.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Anam

> Real-time video avatar service that synchronizes audio and video using Anam

export const CommunityMaintained = ({maintainer, maintainerUrl, repo}) => <Note>
    <strong>Community-maintained integration.</strong> This service is built and
    maintained by{" "}
    <a href={maintainerUrl} target="_blank" rel="noreferrer">
      {maintainer}
    </a>
    . Pipecat does not test or officially support it. Please report issues and
    request changes on the{" "}
    <a href={repo} target="_blank" rel="noreferrer">
      source repository
    </a>
    . Learn more about{" "}
    <a href="/api-reference/server/services/community-integrations">
      community integrations
    </a>
    .
  </Note>;

<CommunityMaintained maintainer="anam-org" maintainerUrl="https://github.com/anam-org" repo="https://github.com/anam-org/pipecat-anam" />

## Overview

`AnamVideoService` generates real-time interactive video avatars for your
Pipecat agents using [Anam](https://anam.ai). It consumes TTS audio from your
pipeline and produces synchronized audio and video frames (`OutputImageRawFrame`
video and `SpeechOutputAudioRawFrame` audio) by wrapping Anam's Python SDK.

The package also ships an experimental `AnamTransport` — a drop-in replacement
for Pipecat's `DailyTransport` that publishes the avatar's audio and video
directly into a Daily room. See the
[source repository](https://github.com/anam-org/pipecat-anam) for details.

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/anam-org/pipecat-anam">
    Source code, examples, and issues for the Anam integration
  </Card>

  <Card title="PyPI Package" icon="cube" href="https://pypi.org/project/pipecat-anam/">
    The `pipecat-anam` package on PyPI
  </Card>

  <Card title="Anam Lab" icon="book" href="https://lab.anam.ai">
    Build and test your persona and get your `avatar_id`
  </Card>

  <Card title="API Keys" icon="key" href="https://lab.anam.ai">
    Create and manage your Anam API key
  </Card>
</CardGroup>

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
uv add pipecat-anam
```

You'll also need Pipecat with the services you use (STT, TTS, LLM, transport).

## Prerequisites

### Anam Account Setup

Before using the Anam video service, you need:

1. **Anam API Key**: Get one from [Anam Lab](https://lab.anam.ai)
2. **Avatar ID**: Build and test your persona in [Anam Lab](https://lab.anam.ai)
   to obtain your `avatar_id`

You'll also need API keys for the STT, TTS, and LLM services used in your
pipeline (e.g., Deepgram, Cartesia, Google).

### Required Environment Variables

* `ANAM_API_KEY`: Your Anam API key for authentication

## Configuration

Constructor parameters for `AnamVideoService`:

<ParamField path="api_key" type="str" required>
  Anam API key for authentication.
</ParamField>

<ParamField path="persona_config" type="anam.PersonaConfig" required>
  Full persona configuration (e.g., `avatar_id`, `enable_audio_passthrough`).
  Set `enable_audio_passthrough=True` to render the avatar directly from your
  TTS audio.
</ParamField>

<ParamField path="ice_servers" type="list[dict]" default="None">
  Custom ICE servers for WebRTC (optional).
</ParamField>

<ParamField path="api_base_url" type="str" default="https://api.anam.ai">
  Base URL for the Anam API. Falls back to `https://api.anam.ai` when not set.
</ParamField>

<ParamField path="api_version" type="str" default="None">
  Anam API version to use.
</ParamField>

<ParamField path="enable_session_replay" type="bool" default="True">
  Whether to enable session recording on Anam's backend.
</ParamField>

<Note>
  See the [source repository](https://github.com/anam-org/pipecat-anam) for the
  authoritative, up-to-date list of parameters and the experimental
  `AnamTransport` options.
</Note>

## Usage

```python theme={null}
import os

from anam import PersonaConfig
from pipecat_anam import AnamVideoService
from pipecat.frames.frames import LLMRunFrame
from pipecat.pipeline.pipeline import Pipeline

persona_config = PersonaConfig(
    avatar_id="your-avatar-id",
    enable_audio_passthrough=True,
)

anam = AnamVideoService(
    api_key=os.environ["ANAM_API_KEY"],
    persona_config=persona_config,
    api_base_url="https://api.anam.ai",
    api_version="v1",
    enable_session_replay=False,
)

pipeline = Pipeline([
    transport.input(),
    stt,
    context_aggregator.user(),
    llm,
    tts,
    anam,  # Video avatar (returns synchronized audio/video)
    transport.output(),
    context_aggregator.assistant(),
])
```

See the
[example](https://github.com/anam-org/pipecat-anam/blob/main/examples/video-avatar-anam-video-service.py)
in the source repository for a complete working pipeline.

## Compatibility

Tested with Pipecat v0.0.100+ (Python 3.10+). Check the [source
repository](https://github.com/anam-org/pipecat-anam) for the latest tested
version and changelog.
