glamorous-oil-12326
09/18/2025, 11:53 PMtall-airline-16756
09/18/2025, 11:53 PMtall-airline-16756
09/18/2025, 11:53 PMuser_data! Its main purpose is to hold dynamic, session-specific information that helps the agent respond thoughtfully and keep track of the conversation over time. While prompts give the agent a starting point or general instructions, user_data lets the agent remember and update details during your session—like who you are, where you left off, or special info like flash cards or quizzes.
Let me give you an example: imagine you’re chatting with a personal shopper. The user_data would store your name, ID, and current order details, so the agent can tailor its responses just for you. It also helps keep things running smoothly behind the scenes, especially when switching between different agents, by preserving important context. This makes the whole experience more reliable and seamless.
So, to sum it up, prompts guide how the agent acts, while user_data holds what the agent remembers about you and your session—helping create a more personalized and meaningful interaction.
Sources: avatars/tavus/tavus.py | Building an Automated IVR Menu Caller | LiveKit Docs | Building Multi-Agent Architectures with LiveKit Agentsglamorous-oil-12326
09/18/2025, 11:54 PMtall-airline-16756
09/18/2025, 11:55 PMuser_data.
user_data is a user-defined, serializable object that stays with the session throughout its lifecycle. It’s a great tool for agents to store and update important details—like user information or the conversational state—that aren’t automatically part of the runtime environment. This helps make sure that essential session data is clearly managed and easily accessible, even when moving between functions or agent transitions.
If you had a particular aspect of "session context" in mind, please feel free to share more details. I’d be happy to provide more focused help!
Sources: agents/src/voice/agent_session.ts | Building Multi-Agent Architectures with LiveKit Agents | Workflows | LiveKit Docs | examples/drive-thru/drivethru_agent.py | flows/declarative_flow.py