Building Multi-Agent Architectures with LiveKit Agents
Last updated: August 20, 2025
Overview
When designing a multi-agent architecture with LiveKit, developers often ask:
Is
function_toolthe best way to transfer control or tasks between agents?Is using a
UserDataclass the best way to make agents stateless?
Based on internal development and customer implementations, the answer to both is yes.
Transferring Between Agents with function_tool
function_toolis the recommended way for agents to invoke each other’s capabilities or pass control.It provides a structured, reliable mechanism for chaining agents without requiring complex manual orchestration.
This ensures clear responsibility boundaries and makes agents more composable.
📌 Example use case:
An intake agent can forward structured data to a specialist agent (e.g., medical triage, billing, or scheduling) via function_tool, rather than embedding all logic into a single monolithic agent.
Stateless Agents with UserData
By default, agents should remain stateless to maximize scalability and reusability.
The
UserDataclass provides a consistent way to attach contextual information across interactions without binding state to the agent itself.This makes it easier to:
Run agents across distributed systems.
Maintain clean separation between logic and session-specific data.
Support fault tolerance and recovery.
Reference Example
A working example of these concepts is available in the LiveKit Python agents examples repo.
This example demonstrates:
Multiple agents collaborating to handle a medical office triage flow.
Use of
function_toolfor inter-agent communication.Application of
UserDatafor maintaining context without binding state to an agent.
4. Key Takeaways
✅ Use
function_toolto delegate tasks between agents.✅ Use
UserDatafor context management, keeping agents stateless.✅ Stateless, modular agents are easier to scale, maintain, and extend.
✅ Example implementations are available in the LiveKit Python agents repo.