Files
Google Team Member 6f18257117 ADK changes
Co-authored-by: George Weale <gweale@google.com>
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/6544 from allen-stephen:feat/live-workflow-evals 1f4a15fe22cf7a9231fd808ca4835e7d30dce155
PiperOrigin-RevId: 963504694
2026-08-12 09:56:00 -07:00
..
2026-08-12 09:56:00 -07:00
2026-08-12 09:56:00 -07:00
2026-08-12 09:56:00 -07:00
2026-08-12 09:56:00 -07:00
2026-08-12 09:56:00 -07:00

Live Workflow Sample

Overview

This sample composes three short, single-purpose live (voice) agents into a graph-based workflow:

  1. greeter_agent — greets and confirms the caller's name.
  2. dob_verifier_agent — captures and validates the caller's date of birth (using the validate_date_of_birth tool).
  3. goals_agent — once identity is verified, delivers the call goals and wraps up the conversation.

Each stage runs in mode='task' and hands a typed result to the next (GreeterOutput, DobOutput). The stages are wired directly into the workflow's edges, so the framework runs them in order.

Sample Inputs

  • Hi, yes, this is John Doe

    Confirms identity so greeter_agent can complete and hand off.

  • My date of birth is July 12th, 1985

    Triggers validate_date_of_birth in dob_verifier_agent; this DOB matches the mocked record and verifies the caller.

  • No, no other questions. Thanks!

    Lets goals_agent wrap up the call and end with "Goodbye.".

Graph

graph TD
    START --> greeter_agent
    greeter_agent --> dob_verifier_agent
    dob_verifier_agent -->|calls| validate_date_of_birth(validate_date_of_birth)
    dob_verifier_agent --> goals_agent

How To

  1. Sequence live agents with mode='task': Each stage is an Agent set to mode='task', so it runs its own turn-taking loop and completes before the next stage begins. Because the agents use a live model (gemini-live-2.5-flash-native-audio), the whole workflow runs as a voice conversation.

  2. Pass typed handoffs between stages: Give each stage an output_schema (e.g. GreeterOutput, DobOutput) so its result is a validated, typed value that the next stage receives as input.

  3. Sequence the stages directly in edges: Wire the agents into the Workflow edges in order; no routing functions are needed for a linear flow:

    root_agent = Workflow(
        name='live_workflow',
        edges=[
            (START, greeter_agent),
            (greeter_agent, dob_verifier_agent),
            (dob_verifier_agent, goals_agent),
        ],
    )
    
  4. Run the agent with the ADK web interface and start a Live Session:

    uv run adk web contributing/samples/live/live_workflow
    
  5. Evaluate the workflow in live mode: test_config.json and live_workflow.evalset.json score the workflow with an llm_audio user simulator that adapts to each stage instead of following a fixed script.

    1. Install the eval extra: uv pip install -e ".[eval]".
    2. Add a .env in this directory with Vertex AI credentials (see live_bidi_streaming_single_agent/.env). The project needs access to both the Live API and Gemini TTS models.
    3. Run the eval:
      uv run adk eval \
        contributing/samples/live/live_workflow \
        contributing/samples/live/live_workflow/live_workflow.evalset.json \
        --config_file_path contributing/samples/live/live_workflow/test_config.json
      
  • Task-mode Agents - How mode='task' agents run their own loop and complete with a typed result.
  • Workflow - Building graph-based workflows with a Workflow root agent.
  • Graph - Defining nodes and sequencing them with edges.