Define a tool-using agent using ADK

Check my progress

/ 15

Implement structured output validation

Check my progress

/ 15

Define the Content Builder agent

Check my progress

/ 15

Configure remote connections and workflow

Check my progress

/ 15

Test the system locally

Check my progress

/ 20

Deploy the microservices to Cloud Run

Check my progress

/ 20

This lab may incorporate AI tools to support your learning.
This content is not yet optimized for mobile devices.
For the best experience, please visit us on a desktop computer using a link sent by email.

GSP541

Google Cloud self-paced labs

Overview

In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.

When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.

To score 100% you must successfully complete all tasks within the time period!

In this challenge lab, you use agent skills to build and deploy a distributed multi-agent system used for course creation. You use the Google Agent Development Kit (ADK) and the Agent-to-Agent (A2A) protocol. Instead of following step-by-step instructions, you are given a business scenario and a set of tasks. You must determine how to complete these tasks on your own. Use your skills to implement a solution that demonstrates your understanding of key concepts.

Explore other content in the Gemini Enterprise Agent Ready (GEAR) program.

Setup and requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

How to start your lab and sign in to the Google Cloud console

  1. Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the right is the Lab setup and access panel with the following:

    • The Open Google Cloud console button
    • The temporary credentials (username and password) that you must use for this lab
    • Other information, if needed, to step through this lab

    Note that the lab timer is located near the top of the page, showing the remaining time.

  2. Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).

    The lab spins up resources, and then opens another tab that shows the Sign in page.

    Tip: Arrange the tabs in separate windows, side-by-side.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username below and paste it into the Sign in dialog.

    {{{user_0.username | "Username"}}}

    You can also find the Username in the Lab setup and access panel.

  4. Click Next.

  5. Copy the Password below and paste it into the Welcome dialog.

    {{{user_0.password | "Password"}}}

    You can also find the Password in the Lab setup and access panel.

  6. Click Next.

    Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  7. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Google Cloud console opens in this tab.

Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field. Navigation menu icon and Search field

Open Cloud Shell

  1. From the Google Cloud console header, click Activate Cloud Shell (the terminal icon).
  2. If prompted, click Continue.

Related learning materials

If you are looking for resources that will help you develop the skills required to complete this lab successfully, consider reviewing relevant sections from the following:

Note: The documentation links below may contain examples using Gemini API keys. For this lab, you must ignore those instructions and use Agent Platform as detailed in the tasks below.
Category Resources
Online Documentation - Agent Development Kit (ADK)
- Google Search Tool for ADK
- Structuring Data with ADK
- Sequential Agents
- Loop Agents
- Vertex AI Multimodal Overview
- Pydantic Models
- Deploying to Cloud Run
Courses, Labs and Tutorials - Build Agent Skills with Google

Challenge scenario

You are an AI Engineer building an automated Course Creation System at Cymbal Group. You will build a distributed multi-agent system where specialized microservices collaborate. This design avoids a single monolithic prompt that is difficult to maintain:

  1. Researcher Agent: Gathers up-to-date information on a given topic via Google Search.
  2. Judge Agent: Critiques the research findings for completeness and accuracy against strict quality standards using Pydantic structured schemas.
  3. Content Builder Agent: Transforms approved research findings into well-structured course modules.
  4. Orchestrator Agent: Coordinates the workflow using LoopAgent (to repeatedly research and judge until quality standards are met) and SequentialAgent (to pass approved findings to the content builder) via the Agent-to-Agent (A2A) protocol over HTTP.

Course Creation System Architecture Diagram

Deploy each specialist agent as an independent serverless microservice on Google Cloud Run. Then, verify the end-to-end course generation pipeline.

Your challenge

In this lab, your mission is the following:

  • Define custom agent skills using the Antigravity directory structure (SKILL.md and validation scripts).
  • Load local skill definitions dynamically into ADK agents using the ADK framework.
  • Implement structured output validation for an agent using Pydantic schemas.
  • Construct an orchestration workflow using loop and sequential agent patterns.
  • Configure remote agent connections using the Agent-to-Agent (A2A) protocol.
  • Deploy distributed agent microservices to Google Cloud Run.

Task 1. Define a tool-using agent using ADK

The Course Creation System needs a specialist researcher agent. This agent retrieves current web facts using Google Search instead of relying on static training data. In this task, you set up your development environment and implement an ADK agent equipped with Google Search capabilities.

Clone the starter repository and install dependencies

  1. In Cloud Shell, click Open Editor.

  2. In the Cloud Shell Editor menu, click Terminal.

  3. Select New Terminal.

  4. Run the following command to download the starter codebase from the lab assets bucket and navigate to the project directory:

cd ~ gcloud storage cp -r gs://{{{project_0.project_id}}}-assets/multi-agent-system-skills-starter . cd multi-agent-system-skills-starter
  1. Install the project dependencies:
uv sync
  1. Configure environment variables for your project:
export REGION="{{{project_0.default_region}}}" export MODEL="{{{project_0.startup_script.gemini_flash_model_id}}}" cat << EOF > .env export GOOGLE_CLOUD_PROJECT="{{{project_0.project_id | "PROJECT_ID"}}}" export GOOGLE_CLOUD_LOCATION="global" export GOOGLE_GENAI_USE_VERTEXAI=true export REGION=$REGION export MODEL=$MODEL EOF source .env

Define the researcher agent using a Custom Skill

  1. On the Cloud Shell toolbar, click Open Editor.
  2. Open the file agents/researcher/skills/SKILL.md.
  3. Under the pre-populated instructions, locate the TODO comment and add the following rules to instruct the agent: Do not try to invoke any skills or tools directly. Do not output raw function calls or JSON payloads. Do not call any function named 'skills_search'. Provide your research findings directly as a plain text summary.
  4. Save the file.
  5. Open the file agents/researcher/agent.py.
  6. Locate the TODO comment. Complete the researcher Agent definition by replacing the None placeholder in the tools list with researcher_toolset.
  7. Save the file.

Upload your code for validation

  1. Return to your Terminal session within the Cloud Shell Editor.
  2. Upload your modified files to the -agent-bucket bucket by running the following commands in Cloud Shell:
gcloud storage cp agents/researcher/skills/SKILL.md gs://{{{project_0.project_id}}}-agent-bucket/agents/researcher/skills/SKILL.md gcloud storage cp agents/researcher/agent.py gs://{{{project_0.project_id}}}-agent-bucket/agents/researcher/agent.py

Click Check my progress to verify the objective. Define a tool-using agent using ADK

Note: When using Gemini in the ADK, the Google Search tool is automatically made available to the agent framework.

Task 2. Implement structured output validation

To automate workflows reliably, evaluator agents must produce deterministic, machine-readable responses. In this task, you implement a Pydantic schema to enforce structured boolean pass/fail evaluations from the Judge agent.

Define the Pydantic schema and judge agent

  1. In Cloud Shell Editor, open agents/judge/agent.py.
  2. Locate TODO 1 and verify the pre-defined Pydantic schema class named JudgeFeedback(BaseModel) is declared with status and feedback fields.
  3. Locate TODO 2.
  4. Complete the judge agent definition: replace None with JudgeFeedback inside the output_schema parameter, and change both disallow_transfer_to_parent and disallow_transfer_to_peers parameters to True.
  5. Save the file.

Upload your code for validation

  1. Return to your Terminal session within the Cloud Shell Editor.
  2. Upload your modified file to the -agent-bucket bucket by running the following command in Cloud Shell:
gcloud storage cp agents/judge/agent.py gs://{{{project_0.project_id}}}-agent-bucket/agents/judge/agent.py

Click Check my progress to verify the objective. Implement structured output validation

Task 3. Define the Content Builder agent

The Content Builder agent is the final specialist in the pipeline. Its responsibility is to take the validated research findings and transform them into a well-formatted, professional course module. In this task, you deploy the agent with a custom validation script tool packaged inside a skill to guarantee output compliance.

Create the content builder skill with script validation

  1. Open the file agents/content_builder/skills/scripts/check_format.py.
  2. Modify the file to return a dictionary with the keys success (a boolean indicating whether both headings exist) and message (a string explaining the result).
  3. Save the file.
4. Open the file agents/content_builder/skills/SKILL.md. 5. Locate the TODO comment. Instruct the agent to run the validation script tool check_format to verify the formatting of the generated course module before finalizing its output. 6. Save the file. 7. Open the file agents/content_builder/agent.py. 8. Locate the TODO comment. Complete the content_builder agent definition by replacing the None placeholder inside the tools list with content_builder_toolset. 9. Save the file.

Upload your code for validation

  1. Return to your Terminal session within the Cloud Shell Editor.
  2. Upload your modified files to the -agent-bucket bucket by running the following commands in Cloud Shell:
gcloud storage cp agents/content_builder/skills/scripts/check_format.py gs://{{{project_0.project_id}}}-agent-bucket/agents/content_builder/skills/scripts/check_format.py gcloud storage cp agents/content_builder/skills/SKILL.md gs://{{{project_0.project_id}}}-agent-bucket/agents/content_builder/skills/SKILL.md gcloud storage cp agents/content_builder/agent.py gs://{{{project_0.project_id}}}-agent-bucket/agents/content_builder/agent.py

Click Check my progress to verify the objective. Define the Content Builder agent

Task 4. Configure remote connections and workflow

Orchestrator agents manage workflow logic and delegation instead of executing tools directly. In this task, you configure the remote connections to the researcher, judge, and content builder agents. Then, you construct the feedback loop and sequential pipeline in the orchestrator.

Configure remote connections and workflows

  1. In Cloud Shell Editor, open agents/orchestrator/agent.py.
  2. Locate TODO 1 and complete the remote connection for the judge agent by replacing the None placeholder of the after_agent_callback parameter with create_save_output_callback("judge_feedback").
  3. Locate TODO 2 in the EscalationChecker class's _run_async_impl method. Complete the escalation logic: replace the None placeholder of the actions parameter in the first Event constructor with EventActions(escalate=True).
  4. Locate TODO 3 at the bottom of the file. Complete the orchestrator workflow:
    • For research_loop, replace the [None] placeholder with [researcher, judge, escalation_checker].
    • For root_agent, replace the [None] placeholder with [research_loop, content_builder].
  5. Save the file.

Upload your code for validation

  1. Return to your Terminal session within the Cloud Shell Editor.
  2. Upload your modified file to the -agent-bucket bucket by running the following command in Cloud Shell:
gcloud storage cp agents/orchestrator/agent.py gs://{{{project_0.project_id}}}-agent-bucket/agents/orchestrator/agent.py

Click Check my progress to verify the objective. Configure remote connections and workflow

Task 5. Test the system locally

Verify your distributed system locally before deploying to Google Cloud Run. In this task, you run multiple local agents and test A2A communication over localhost using the ADK.

Run the local runner script

To prevent the local agent runner from scanning your custom skill folders as sibling agents, run the local simulation using a clean temporary runtime directory. If you do not, the loader can crash.

  1. In Cloud Shell Editor, open the file run_local.sh in the root directory.
  2. Complete the configuration steps by modifying the script placeholders:
    • GOOGLE_CLOUD_PROJECT: Replace YOUR_GCLOUD_COMMAND_HERE with a command to dynamically fetch the active project ID, such as $(gcloud config get-value project).
    • GOOGLE_CLOUD_LOCATION: Replace YOUR_REGION_VARIABLE_HERE with us-central1.
    • JUDGE_AGENT_CARD_URL: Replace YOUR_LOCAL_JUDGE_URL with the localhost connection endpoint URL for the judge agent card on port 8002: http://localhost:8002/a2a/agent/.well-known/agent-card.json
    • CONTENT_BUILDER_AGENT_CARD_URL: Replace YOUR_LOCAL_CONTENT_BUILDER_URL with the localhost connection endpoint URL for the content builder agent card on port 8003: http://localhost:8003/a2a/agent/.well-known/agent-card.json
  3. Save the file.

Upload your code for validation

  1. Return to your Terminal session within the Cloud Shell Editor.
  2. Upload your modified file to the -agent-bucket bucket by running the following command in Cloud Shell:
gcloud storage cp run_local.sh gs://{{{project_0.project_id}}}-agent-bucket/run_local.sh
  1. Run the script in Cloud Shell to start the local simulation:
cd ~/multi-agent-system-skills-starter chmod +x run_local.sh ./run_local.sh Note: This script starts uvicorn processes for the Researcher (port 8001), Judge (8002), Content Builder (8003), and Orchestrator (port 8004).

Test the application

  1. On the Cloud Shell toolbar, click the Web Preview icon.
  2. Click Preview on port 8080.
  3. In the web interface, enter a topic (for example, Create a course about the history of coffee.) and submit the prompt.
  4. Observe the terminal output in Cloud Shell.
  5. Verify that the orchestrator calls the researcher. The researcher's output must flow to the judge. The loop must iterate until the judge passes the research to the content builder.
  6. Press CTRL+C in the Cloud Shell terminal to stop the local servers.

Click Check my progress to verify the objective. Test the system locally

Task 6. Deploy the microservices to Cloud Run

In this task, you deploy each specialist microservice to Google Cloud Run, and then verify the end-to-end course generation pipeline.

Deploy specialist agents to Cloud Run

  1. Confirm that you are in the ~/multi-agent-system-skills-starter directory.

    cd ~/multi-agent-system-skills-starter
  2. Ensure your environment variables are sourced in Cloud Shell by running source .env.

  3. Run the following commands to deploy the Researcher, Judge, and Content Builder microservices to Cloud Run in region $REGION:

: "Deploy Researcher agent service" gcloud run deploy researcher \ --source agents/researcher/ \ --region $REGION \ --allow-unauthenticated \ --memory 512Mi \ --set-env-vars GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_VERTEXAI="true",MODEL=$MODEL : "Deploy Judge agent service" gcloud run deploy judge \ --source agents/judge/ \ --region $REGION \ --allow-unauthenticated \ --memory 512Mi \ --set-env-vars GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_VERTEXAI="true",MODEL=$MODEL : "Deploy Content Builder agent service" gcloud run deploy content-builder \ --source agents/content_builder/ \ --region $REGION \ --allow-unauthenticated \ --memory 512Mi \ --set-env-vars GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_VERTEXAI="true",MODEL=$MODEL
  1. If prompted, press y to continue.

Deploy the orchestrator and frontend application

  1. Capture the deployed service URLs and deploy the Orchestrator service by running the following commands:
: "Capture service URLs" RESEARCHER_URL=$(gcloud run services describe researcher --region $REGION --format='value(status.url)') JUDGE_URL=$(gcloud run services describe judge --region $REGION --format='value(status.url)') CONTENT_BUILDER_URL=$(gcloud run services describe content-builder --region $REGION --format='value(status.url)') : "Deploy Orchestrator service linking remote agent cards" gcloud run deploy orchestrator \ --source agents/orchestrator/ \ --region $REGION \ --allow-unauthenticated \ --memory 512Mi \ --set-env-vars RESEARCHER_AGENT_CARD_URL=$RESEARCHER_URL/a2a/agent/.well-known/agent-card.json,JUDGE_AGENT_CARD_URL=$JUDGE_URL/a2a/agent/.well-known/agent-card.json,CONTENT_BUILDER_AGENT_CARD_URL=$CONTENT_BUILDER_URL/a2a/agent/.well-known/agent-card.json,GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_VERTEXAI="true",MODEL=$MODEL
  1. Deploy the frontend web application:
: "Capture Orchestrator URL and deploy frontend application" ORCHESTRATOR_URL=$(gcloud run services describe orchestrator --region $REGION --format='value(status.url)') gcloud run deploy course-creator \ --source app \ --region $REGION \ --allow-unauthenticated \ --memory 512Mi \ --set-env-vars AGENT_SERVER_URL=$ORCHESTRATOR_URL,GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT
  1. Retrieve the frontend service URL:
gcloud run services describe course-creator --region $REGION --format='value(status.url)'

Click Check my progress to verify the objective. Deploy the microservices to Cloud Run

  1. Open the generated frontend URL in a new browser tab.
  2. In the interface, enter a topic (for example, The history of cloud computing) and click Start Building.
  3. Verify that the system coordinates between the researcher, judge, and content builder to generate the completed course module.
  4. View the internal logs to monitor agent coordination in real-time. Choose one of the following options:
    • Option A (Console): In the Google Cloud console, search for Cloud Run in the top search bar. Click orchestrator in the list of services, then click the Logs tab.

    • Option B (Cloud Shell): Run the following command in Cloud Shell to query the live orchestrator logs:

      gcloud logging read "resource.type=cloud_run_revision AND resource.labels.service_name=orchestrator" --project=$GOOGLE_CLOUD_PROJECT --limit 100 --order=asc --format="value(textPayload)"

Congratulations!

In this lab, you successfully architected, implemented, and deployed a distributed multi-agent system using the Google Agent Development Kit (ADK), Pydantic structured output validation, loop and sequential orchestration workflows, and the Agent-to-Agent (A2A) protocol on Google Cloud Run.

Next steps / Learn more

Google Cloud training and certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated November 5, 2026

Lab Last Tested November 9, 2026

Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

You need to sign in or sign up before continuing.

close

Before you begin

  1. Labs create a Google Cloud project and resources for a fixed time
  2. Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
  3. On the top left of your screen, click Start lab to begin

Use private browsing

  1. Copy the provided Username and Password for the lab
  2. Click Open console in private mode

Sign in to the Console

  1. Sign in using your lab credentials. Using other credentials might cause errors or incur charges.
  2. Accept the terms, and skip the recovery resource page
  3. Don't click End lab unless you've finished the lab or want to restart it, as it will clear your work and remove the project

This content is not currently available

We can notify you via email when it becomes available

Great!

We can contact you via email if it becomes available

One lab at a time

Confirm to end all existing labs and start this one

Use private browsing to run the lab

Using an Incognito or private browser window is the best way to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.