Skip to main content
LiveKit Agents Integration is a Platform Integration. Use it when your voice agent runs in LiveKit Agents and you want livekit-plugins-spatius to connect that agent worker to Motion Server. The package attaches to your agent and pipes agent audio to Motion Server; Motion Server publishes lip-synced audio and motion data back into the same LiveKit room. LiveKit Agents is the platform integration; the RTC Adapter (@spatius/avatarkit-rtc) is the Web client adapter that renders the avatar stream from the LiveKit room. The LiveKit room itself is the transport.
Web Only: The current AvatarKit RTC client demo path targets Web. LiveKit ships iOS and Android client SDKs, but Spatius does not yet provide iOS or Android demos for this path.

At a glance

Architecture

  • LiveKit room handles transport.
  • Agent worker runs your voice agent with livekit-plugins-spatius attached.
  • Motion Server generates motion data from the agent audio and publishes the synchronized audio + motion stream back into the room.
  • AvatarKit RTC client joins the room and renders the avatar.
Spatius is not a video streaming service. Even when you use LiveKit as the transport layer and LiveKit Agents as the voice agent framework, LiveKit transports avatar audio and motion data, not finished avatar video. @spatius/avatarkit renders the avatar locally in the browser.

Frontend installation

Frontend setup

1

Toolchain setup

Configure your build tool to load the AvatarKit WebAssembly assets. See Toolchain Setup.
2

Pick a UI path

  • For drop-in React components, use AvatarKit UI.
  • To own the UI and connection flow yourself, use the JavaScript API below.
3

JavaScript API (custom UI)

1

Initialize SDK

2

Load Avatar & Create View

3

Create Player with LiveKit Provider

4

Connect to LiveKit Server

5

Start voice interaction

Full RTC client API reference: LiveKit Agents Client.

LiveKit Agents plugin installation

Server setup

If you already use LiveKit Agents, add livekit-plugins-spatius to your agent worker. The package attaches to your AgentSession and pipes TTS audio to Spatius; Motion Server publishes the resulting audio and motion data to the same LiveKit room. Required environment variables:
  • Spatius: SPATIUS_API_KEY, SPATIUS_APP_ID, SPATIUS_AVATAR_ID
  • Optional region: SPATIUS_REGION defaults to us-west
  • LiveKit: LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET
Create an AvatarSession and start it with your agent session and room:
See the LiveKit Agents Integration Server guide for the full livekit-plugins-spatius flow, interruption behavior, and API links.

Next steps

Quickstart

Run the end-to-end LiveKit Agents voice avatar demo.

Server

Add livekit-plugins-spatius to your LiveKit Agents worker.

Client

Render the avatar in your Web app with @spatius/avatarkit-rtc.