eager-telephone-70698
02/16/2026, 1:10 PMtall-airline-16756
02/16/2026, 1:10 PMtall-airline-16756
02/16/2026, 1:10 PMchat_ctx, instructions, or an extra_instructions parameter). That ensures each task runs with the same guidance.
• Store a shared instruction set and inject it: Keep a single source of truth (a variable, config file, or function that returns the agent’s personality/rules) and reference it whenever you construct agents or tasks.
• Use TaskGroup or shared conversation context: Run related tasks inside a TaskGroup or a shared context so they can read the same state and user history, reducing divergence between tasks.
• Centralize persistent state: Put personality traits, rules, and user-specific preferences in a central store such as session.userdata or a UserData object so tasks and agent handoffs can read the same values.
• Customize prebuilt tasks: For prebuilt tasks (e.g., GetEmailTask, WarmTransferTask), pass extra_instructions at initialization to align that task’s behavior with the agent’s personality.
Recommended implementation approach (simple, reliable)
1. Create a shared instruction object (string or structured rules).
2. Save it in a central place accessible to your task factory or task constructors.
3. Every time you instantiate a task, include that instruction via the available parameter (e.g., instructions, chat_ctx, or extra_instructions).
4. Use TaskGroup or shared conversation context for multi-step flows so tasks inherit the same conversation-level context and userdata.
Questions to make this advice concrete for your system
• Which SDK or API are you using to create agents and tasks? (Web, Node, Python, or another)
• Are you using prebuilt tasks (like GetEmailTask) or custom task classes?
• Do you already have a place where you store session state (e.g., session.userdata) that tasks can access?
• Do you want personality/rules to be mutable during a session (updated mid-flow) or fixed for the whole session?
If you tell me which language/SDK and whether you use prebuilt tasks or custom tasks, I’ll provide a concise code example showing exactly where to inject the shared instructions and how to structure the shared state so personality and rules remain consistent across agent tasks.
Sources: Tasks and task groups | LiveKit Documentation | Context Variables | LiveKit Documentation | Prompting guide | LiveKit Documentation | Agents and handoffs | LiveKit Documentation | Building Multi-Agent Architectures with LiveKit Agents