LiveKit Agents: structured voice data collection tutorial

Learn to collect typed fields with LiveKit Agent Builder and Python tasks, configure a JSON endpoint, and handle optional answers in a voice call.

Player not loading? Watch on YouTube

This tutorial builds a voice AI agent for structured data collection with LiveKit Agents. The speaker starts in Agent Builder within LiveKit Cloud, selects the lead qualification template, and explains how its fields map to generated Python code. The walkthrough covers the browser workflow and the task-based SDK approach; it does not demonstrate a local or self-hosted deployment.

Each collection field has instructions and one or more response values with string, number, or boolean types. The example gathers contact and company details, with role title marked optional. Fields can involve a short answer or a longer conversation, and the speaker describes collecting repeated records such as attendees.

In the generated code, AgentTask handles a focused conversation objective and returns a typed result. TaskGroup orders the tasks and shares their context. The speaker explains that a caller can correct an earlier answer through backtracking while the group retains the other context.

The call-ending configuration specifies an endpoint for a JSON payload containing job and room IDs, timestamps, an optional summary, and a results object. The speaker says successful submission ends the session automatically. In the simplified test call, the caller declines to provide a role title. The collected data appears in the interface, but the speaker confirms that nothing was sent because no endpoint had been configured.