If I am using the livekit for saas products, do I ...
# ask-ai
a
If I am using the livekit for saas products, do I need to create agents for my each customers? I have 1000 customers and do I need 1000 agents?
t
Thanks for reaching out, Namindu. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Great question! You actually don’t need to create separate agents for each customer when using LiveKit for your SaaS products. LiveKit is thoughtfully designed to scale smoothly by allowing a single set of agents to be shared across multiple customer sessions. Each customer interaction happens within its own unique
AgentSession
, which keeps all the user-specific data and context nicely separated. So, you can confidently manage all 1000 customers with shared agents, as each session is created dynamically and tailored to the individual user. If you'd like, I’m here to help with any more details on how to set this up—just let me know! Sources: complex-agents/personal_shopper/README.md | README.md | Agents Overview | LiveKit Docs | Workflows | LiveKit Docs | LiveKit
a
So, how can I keep users agent configurations? Each customer have different agents configurations
t
I'd love to help you manage different agent configurations for each customer in LiveKit! Here's a friendly approach you can try: 1. Use a shared
UserData
object:
Think of this as a handy place to store all the customer-specific details like agent preferences, tools, and configurations. This object travels with the
AgentSession
and stays accessible to all agents during the session. 2. Create specialized agents: You can design agents with unique setups—like particular instructions, tools, voices (TTS), or models (STT, LLM)—tailored just for what each customer needs. 3. Transfer control between agents: By using tool functions, you can smoothly switch between agents depending on what the customer requires. This way, the right agent is always handling the task, and the session flows without a hitch. 4. Preserve context during transfers: The
on_enter()
method is your friend here! It helps copy the conversation history and update the chat context so customers experience a seamless transition between agents. 5. Optional - Use participant metadata: If you’re working with web or mobile frontends, you can pass customer-specific configurations through participant metadata. Agents can then read and apply these settings dynamically during the session. This method helps you create personalized and smooth interactions for each customer, all while keeping things scalable. If you'd like, I’m here to provide more details or examples—just let me know! Sources: Accepting incoming calls | LiveKit Docs | examples/voice_agents/multi_agent.py | complex-agents/personal_shopper/README.md | examples/src/restaurant_agent.ts | agent/main.py
a
Can you give me a full example
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!