
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Install packages and import libraries
/ 20
Grounding with Google Search results
/ 20
Create a Vertex AI Datastore
/ 10
Create a Vertex AI Search Application
/ 10
Grounding with custom documents and data
/ 20
Grounded chat responses
/ 20
In this lab, you'll dive into the world of grounding with Vertex AI, exploring how to connect Large Language Models (LLMs) to real-world information beyond their initial training data. By tapping into sources like Google Search and Vertex AI Search data stores, you can empower LLMs to generate responses that are more accurate, relevant, and up-to-date. This not only boosts the trustworthiness of the generated content but also makes it far more applicable to real-world scenarios. Grounding enhances the accuracy of LLM responses by connecting them to factual data sources.
In the context of grounding in Vertex AI, you can configure two different sources of grounding:
Gemini is a family of powerful generative AI models developed by Google DeepMind, capable of understanding and generating various forms of content, including text, code, images, audio, and video.
The Gemini API in Vertex AI provides a unified interface for interacting with Gemini models. This allows developers to easily integrate these powerful AI capabilities into their applications. For the most up-to-date details and specific features of the latest versions, please refer to the official Gemini documentation.
Before starting this lab, you should be familiar with:
In this lab, you learn how to:
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:
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 left is the Lab Details pane with the following:
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.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
In the Google Cloud console, on the Navigation menu (), click Vertex AI > Workbench.
Find the
The JupyterLab interface for your Workbench instance opens in a new browser tab.
Open the
In the Select Kernel dialog, choose Python 3 from the list of available kernels.
Run through the Getting Started and the Import libraries sections of the notebook.
Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
In this section, you will create a Vertex AI Datastore in Cloud Console.
In the top search box, enter Agent Builder and select Agent Builder from the results.
On the Vertex AI Agent Builder landing page select CONTINUE AND ACTIVATE API.
Go to the Data Stores > Create data store page.
In the Select a data source pane, select Website content.
In the Specify the websites for your data store pane, make sure that Advanced website indexing is turned off.
In the Sites to include field, enter:
Click Continue.
In the Configure your data store pane, select global (Global) as the location for your data store.
Enter a name for your data store. Note the ID that is generated. You'll need this later.
Click Create.
Click Check my progress to verify the objective.
In this section, you will create a Vertex AI Search Application in Cloud Console.
Go to the Apps > Create App page.
On the Create App page, under Search for your website, click Create.
Make sure that Enterprise edition features is turned on.
In the Your app name field, enter a name for your app. Your app ID appears under the app name.
In the External name of your company or organization field, enter the company or organization name. For this tutorial, you can use Google Cloud, because the app will search a Google Cloud website.
Select global (Global) as the location for your app, and then click Continue.
In the list of data stores, select the data store that you created earlier, and then click Create.
Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
In this lab, you learned how to ground Large Language Models (LLMs) in both Google Search and custom data sources. By comparing grounded and ungrounded LLM responses, you witnessed the significant impact grounding has on response quality and accuracy. Furthermore, you gained practical experience creating and utilizing a data store in Vertex AI Search, enabling you to ground LLM text and chat models in your own documents and data.
Check out the following resources to learn more about Gemini:
...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 December 10, 2024
Lab Last Tested November 26, 2024
Copyright 2025 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.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one