ADK Web Documentation

repository·main·Indexed 21 days ago

https://github.com/google/adk-web

A built-in developer UI for the Google Agent Development Kit (ADK) providing visual tools for debugging, tracing, and evaluating AI agents. It includes features for monitoring events, inspecting artifacts, and running agent performance evaluations with configurable run modes (standard and live) and metrics. The tool integrates with the adk api_server and supports audio user simulation using LLM-based TTS models.

Tokens
1.7K
Snippets
5
Records
12
Agent score
77%

What's inside ADK Web

  1. Overview of ADK Web features

    main

    ADK Web is a built-in developer UI integrated with the Google Agent Development Kit (ADK) to facilitate agent development and debugging. Key features visible in the UI include:

    • Events: Monitoring agent events.
    • Tracing: Debugging execution flows.
    • Artifacts: Inspecting generated outputs or files.
    • Evaluations: Running and viewing agent performance evaluations.
    • Agent Builder & Assistant: Tools for constructing and interacting with agents.
  2. Install prerequisites for ADK Web

    main

    Before running ADK Web, ensure you have the following installed on your system:

    • npm
    • NodeJs
    • Angular CLI
    • google-adk (Python)
    • google-adk (Java)

    You must also clone the adk-web repository to your local machine.

  3. Run ADK Web locally

    main

    To run the ADK Web developer UI, follow these steps from the root of your local adk-web folder:

    1. Install dependencies: Run npm install (use sudo if required by your environment).
    2. Start the Web UI: Run the serve script, specifying the backend URL using the --backend flag.
    3. Start the API Server: In a separate terminal, run the adk api_server command. You must configure --allow_origins to match the Web UI's address (typically http://localhost:4200) and set the --host to 0.0.0.0 to allow connections.

    Once both are running, access the UI at http://localhost:4200.

    # 1. Install dependencies
    sudo npm install
    
    # 2. Run adk web
    npm run serve --backend=http://localhost:8000
    
    # 3. Run adk api server (in a separate terminal)
    adk api_server --allow_origins=http://localhost:4200 --host=0.0.0.0
  4. Configure the Audio User Simulator

    main

    To synthesize simulated user turns using audio, provide a UserSimulatorConfig of type llm_audio. This configuration allows you to specify an audio_model (such as a Gemini TTS model or cloud_tts) and detailed speech_config for voice and language selection.

    Default Audio Model: gemini-3.1-flash-tts-preview

    Available Prebuilt Voices:

    • Kore
    • Puck
    • Charon
    • Aoede
    • Fenrir
    import { UserSimulatorConfig } from './path/to/Eval';
    
    const config: UserSimulatorConfig = {
      type: 'llm_audio',
      audio_model: 'gemini-3.1-flash-tts-preview',
      audio_model_configuration: {
        response_modalities: ['AUDIO'],
        speech_config: {
          voice_config: {
            prebuilt_voice_config: {
              voice_name: 'Kore'
            }
          },
          language_code: 'en-US'
        }
      }
    };
  5. Configure evaluation run modes and metrics

    main

    When triggering an evaluation run, you can configure the run mode and the specific metrics to be used.

    Run Modes

    • standard: The default non-live run.
    • live: Uses bidirectional streaming inference.

    Metrics Configuration

    Evaluations use a set of metrics, each with a configurable threshold. Common metrics include:

    • tool_trajectory_avg_score (Default threshold: 1.0)
    • response_match_score (Default threshold: 0.7)

    Live Audio Simulation

    If live mode is enabled and the input modality is set to audio, you can provide a UserSimulatorConfig. This configures an LLM-based audio user simulator (using the llm_audio type) with specific voice and language settings.

  6. Use adk api_server command flags

    main

    The adk api_server command is used to launch the backend required by the ADK Web UI. It accepts the following flags:

    • --allow_origins: Specifies the allowed origins for CORS (e.g., http://localhost:4200).
    • --host: Specifies the host address to bind to (e.g., 0.0.0.0).

    If you encounter adk command not found, ensure google-adk is installed or that your Python virtual environment is activated.

    adk api_server --allow_origins=http://localhost:4200 --host=0.0.0.0
  7. Reference: Evaluation Data Models

    main

    The following interfaces define the structure of evaluation data used within the ADK Web UI:

    • EvalCase: A single unit of evaluation containing a sessionInput, an optional conversation (array of Invocation), and events.
    • EvalSet: A collection of EvalCase objects grouped under an evalSetId.
    • Invocation: A single turn in a conversation, containing userContent, an optional finalResponse, intermediateData, and a creationTimestamp.
    • EvaluationResult: The output of an evaluation run, linking a setId and evalId to a finalEvalStatus and specific evalMetricResults.
  8. Interface: RunEvalDialogResult

    main

    The RunEvalDialogResult interface represents the configuration object emitted when an evaluation configuration dialog is confirmed. This object is consumed by the runEval function to execute the evaluation.

    Fields:

    • metrics: An array of EvalMetric objects selected by the user, including their respective threshold values.
    • useLive: A boolean indicating if the run should use live (bidirectional streaming) mode.
    • userSimulatorConfig (optional): Present only when the audio user simulator is enabled for a live run. It contains the UserSimulatorConfig for the audio model, voice, and language.
  9. Define evaluation metrics with EvalMetric

    main

    An EvalMetric defines a specific metric used to score an agent's performance, paired with a passing threshold. You can use the DEFAULT_EVAL_METRICS as a starting point for common evaluations.

    import { EvalMetric } from './path/to/Eval';
    
    const myMetric: EvalMetric = {
      metricName: 'response_match_score',
      threshold: 0.7
    };