
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
Grounding in Vertex AI lets you use generative text models to generate content grounded in your own documents and data. This capability lets the model access information at runtime that goes beyond its training data. By grounding model responses in Google Search results or data stores within Vertex AI Search, LLMs that are grounded in data can produce more accurate, up-to-date, and relevant responses.
Grounding provides the following benefits:
Reduces model hallucinations (instances where the model generates content that isn't factual) Anchors model responses to specific information, documents, and data sources Enhances the trustworthiness, accuracy, and applicability of the generated content
You can configure two different sources of grounding in Vertex AI:
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 AI Applications and select AI Applications from the results.
On the Welcome to AI Applications landing page click CONTINUE AND ACTIVATE THE API.
Go to the Data Stores > Create data store page.
In the Select a data source pane, select Cloud Storage.
In the Import data from Cloud Storage pane, select Unstructured documents (PDF, HTML, TXT and more).
Make sure Folder is selected
In the gs:// field, enter the following value and 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 May 15, 2025
Lab Last Tested May 15, 2025
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