Hi! Could I have in single application multiple ag...
# ask-ai
g
Hi! Could I have in single application multiple agents that answer on different numbers . how do i write dispatch rule and application to do this?
t
Thanks for reaching out, Andrii. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you set up multiple agents to answer different numbers within a single application! Here’s a simple way to get started: 1. Set up Inbound SIP Trunks: Begin by creating a separate inbound SIP trunk for each phone number. This helps LiveKit recognize which number is being called and route the call correctly. 2. Write Dispatch Rules: Next, use SIP dispatch rules to guide calls based on the number dialed. For example,
dispatchRuleCallee
lets you map specific numbers to different rooms and assign the right agents. If you want even more precise control, you might try
dispatchRuleIndividual
with number filtering. 3. Assign Agent Names: Make sure each agent has a unique name in their setup. This way, you can directly dispatch calls to the correct agent using your rules. If you’d like, I can provide detailed examples or walk you through any part of this process. Just let me know—I’m here to help! Sources: Agent dispatch | LiveKit Docs | Dispatching agents | LiveKit Docs | livekit/livekit_sip.pb.go | Accepting incoming calls | LiveKit Docs | SIP overview | LiveKit Docs
g
and could single application host multiple agents?
t
Absolutely, a single LiveKit application can host multiple agents, and I’d be happy to guide you through how to make that happen: • Dispatching Multiple Agents: You can set up your application to dispatch multiple agents within the same project or room by adding several
RoomAgentDispatch
entries in your room configuration. • Running Multiple Agent Instances: It’s also possible for a single worker to run multiple agent instances, each in its own isolated process, so they can work simultaneously without any issues. • Multi-Agent Workflows: For more complex interactions, you can create workflows where agents pass control to each other during a session, making the experience seamless. If you’d like, I’m here to help you set this up or answer any questions you might have! Sources: Deployment and scaling | LiveKit Docs | An open source stack for real-time multimodal AI | Agent dispatch | LiveKit Docs | Anatomy of an Agent | LiveKit Docs | examples/voice_agents/multi_agent.py
g
show me code and docs for this Running Multiple Agent Instances
hey, who to run different agents ( diffrent prompts ) on single application