when virtual avatar plugins, especially beyond pre...
# ask-ai
b
when virtual avatar plugins, especially beyond presence, how do i set it to 'agent'
t
Thanks for reaching out, s. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding about how to set a virtual avatar plugin (e.g., Beyond Presence/Bey) to the "agent" role. You do not need to manually set it. The plugin and Agent/Avatar session classes handle participant kind for you: • The AI agent connects as
ParticipantKind.AGENT
via the
AgentSession
when you call
session.start()
. • The avatar worker (the plugin) joins as a separate participant also with
ParticipantKind.AGENT
when you call
avatar.start(session, room=...)
(for Bey:
bey.AvatarSession
). • The frontend can distinguish the original agent vs. the avatar worker using the
lk.publish_on_behalf
attribute: ◦ Agent:
p.attributes['lk.publish_on_behalf'] === null
◦ Avatar worker:
p.attributes['lk.publish_on_behalf'] === <agent_identity>
If you want, tell me: • which plugin you’re using (Bey / Tavus / etc.), and • whether you’re starting sessions from the server SDK or a specific example file — and I’ll give the exact code snippet to use. Sources: livekit/livekit_composite | DeepWiki | Beyond Presence virtual avatar integration guide | LiveKit docs | Virtual avatar plugins | LiveKit Docs | examples/avatar_agents | livekit/livekit_composite | DeepWiki
b
are you sure? because when i checked, its not being treated as agent. i am using beyond presence
t
Thanks — I’m responding to your check that Beyond Presence (Bey) isn’t being treated as an agent. You're correct that Bey should join as an AGENT participant automatically. Let’s troubleshoot why you see it differently. A few quick diagnostic questions and checks will pinpoint the issue: 1. Which SDK/SDK version and language are you using (server Python/Node, or frontend JS)? 2. How are you starting the avatar? Share the exact code snippet you call for
AvatarSession
/
avatar.start(...)
and
session.start(...)
(redact secrets). 3. In the room, what do you observe for the avatar participant’s properties? Please paste the values for: ◦
p.kind
◦
p.identity
◦
p.attributes['lk.publish_on_behalf']
◦
p.name
(if set) 1. Are you seeing separate participants for the agent and the avatar worker, or just one participant? 2. Any custom room options or attribute overrides when creating the avatar session? While you gather that, check these quick items: • Confirm you called
await avatar.start(session, room=ctx.room)
(or equivalent) before/while starting the agent session. • Ensure the avatar library version matches the AgentSession version — mismatched versions can change behavior. • Verify the frontend is reading
p.kind
using the SDK enum (not a string compare mismatch). Reply with the SDK/version, your start code, and the participant property outputs and I’ll point out exactly what’s wrong and the minimal fix.
b
kind is set to 'standard' which is human. attributes lk publish on behalf set to agent identity.
t
Thanks — I’m responding to your note that the avatar’s
kind
is
standard
while
lk.publish_on_behalf
is set to the agent identity. That mismatch explains why it’s being treated as a human. Let’s pinpoint the cause quickly — please provide the following so I can give an exact fix: 1. SDKs & versions: ◦ Server SDK language/version (Python or Node and version). ◦ Frontend SDK language/version (JS/TS and version). 1. The exact code snippets you call to start the avatar and agent (redact keys/secrets). Specifically the lines where you create/start: ◦
AvatarSession(...)
and
await avatar.start(...)
◦
AgentSession(...)
and
await session.start(...)
1. The order you call those start functions (avatar before agent, after, or concurrently). 2. The avatar plugin package/version (Beyond Presence / bey package version). 3. The full participant object for the avatar (paste JSON of
p
or the fields:
identity
,
name
,
kind
, and full
attributes
). Quick checks you can do now: • Confirm you’re using matching versions of the avatar plugin and AgentSession; version mismatch can leave
kind
as
standard
. • Ensure the server-side AvatarSession is the one creating the participant (not a separate flow that creates a standard participant). • If you start the avatar from frontend code instead of via the plugin’s
avatar.start(session, room=...)
, it may join as
standard
. Send the items above and I’ll tell you the minimal code change to make the avatar participant
AGENT
.
b
const assistant = new Assistant({ instructions: metadata.prompt }); await session.start({ agent: assistant, room: ctx.room, }); if (metadata.bey?.avatarId) { console.log("starting avatar"); const avatar = new bey.AvatarSession({ avatarId: metadata.bey.avatarId, apiKey: config.BEY_API_KEY, }); await avatar.start(session, ctx.room); } how to set avatar to agent kind?
t
Thanks — I’m responding to your code and the avatar showing
kind: "standard"
despite
lk.publish_on_behalf
being set. The Bey plugin should create the avatar worker as
AGENT
automatically and you don’t manually set
kind
. Given your snippet, the most likely causes are version mismatch or the avatar joining via a different flow. Please check/provide the following so I can give the exact minimal fix: 1. Versions ◦ Server SDK language/version (Node) and
livekit-server-sdk
version. ◦
livekit-plugins-bey
package version. ◦ Frontend SDK version (livekit-client). 1. Confirm call order ◦ You call
await session.start({...})
first, then
await avatar.start(session, ctx.room)
— please confirm. 1. Full participant object for the avatar (paste JSON):
identity
,
name
,
kind
, and
attributes
. Quick things to try now • Upgrade
livekit-plugins-bey
to a recent version (≥1.3). Older Bey versions may not set
kind
correctly. • Ensure the avatar is started from your server/plugin code (not from frontend) so the plugin creates the worker participant. • If you customized
avatar_participant_identity
or room participant creation elsewhere, revert that to test default behavior. Send the versions and the avatar participant JSON and I’ll tell you the exact code change or upgrade step to make it appear as
AGENT
. Sources: Virtual avatar plugins | LiveKit Docs | Beyond Presence virtual avatar integration guide | LiveKit docs
b
when i check the source, its not setting access token kind to agent
t
Thanks — I’m responding to your finding that the avatar’s access token kind isn’t set to AGENT. You don’t need to set the access token kind for the avatar. Bey (the plugin) creates and authenticates its avatar worker itself and should join the room as
kind: AGENT
. If you’re seeing
kind: STANDARD
, that indicates the avatar worker was created/connected via a different flow or a version mismatch/bug. Please provide the following so I can pinpoint the issue and give the minimal fix: 1. Versions ◦
livekit-plugins-bey
version ◦ Server SDK and version (Node) ◦ Frontend
livekit-client
version 1. Exact call order (confirm you run
await session.start(...)
then
await avatar.start(session, ctx.room)
). 2. Full avatar participant JSON (or at least
identity
,
name
,
kind
, and
attributes
). 3. Any customization you set on
AvatarSession
(e.g.,
avatar_participant_identity
) or code that creates LiveKit tokens for participants. Quick checks you can run now: • Upgrade
livekit-plugins-bey
to the latest stable (older Bey versions may not set
kind
). • Ensure the avatar is started from the plugin/server process (not manually connecting from frontend with your own token). • Search your codebase for any place that creates a LiveKit participant/token for the avatar identity — if you create a token and connect as that identity, it will be
STANDARD
. Send the versions and the participant JSON and I’ll tell you the exact change (or patch) to make the avatar join as
AGENT
. Sources: Virtual avatar plugins | LiveKit Docs