acoustic-pharmacist-34178
03/12/2026, 3:47 AMtall-airline-16756
03/12/2026, 3:47 AMtall-airline-16756
03/12/2026, 3:47 AMAgentTask can access the previous chat_ctx (prior conversation context). Short answer: yes, but only if you pass it in.
What you can do
• By default, an AgentTask starts with a fresh conversation history.
• If you want the task to be aware of prior messages, pass the current chat_ctx when you create the task:
# Pass the current chat context to the task
result = await CollectConsent(chat_ctx=self.chat_ctx)
• When you use a TaskGroup, the shared chat_ctx is passed through to keep continuity across tasks.
• Even if you don't pass chat_ctx directly, the full session history is available via session.history, which contains all messages before and during the task.
If you'd like, tell me which pattern you're using (single task, TaskGroup, or session-based flow) and I can show a short example tailored to your setup.
Sources: Tasks and task groups | LiveKit Documentation | Collect recording consent with tasks | LiveKit Documentation | Agents and handoffs | LiveKit Documentation