In generative AI, grounding is the ability to connect model output to verifiable sources of information. If you provide models with access to specific data sources, then grounding tethers their output to these data and reduces the chances of inventing content.
With Vertex AI, you can ground model outputs in the following ways:
- Ground with Google Search - ground a model with publicly-available web data.
- Ground with Google Maps - ground a model with geospatial data from Google Maps.
- Ground to your data - ground a model with your data from Vertex AI Search as a data store.
For more information about grounding, see Grounding overview .
Supported models
- Gemini 3 Flash Preview model
- Gemini 3 Pro Preview model
- Gemini 3 Pro Image Preview model
- Gemini 2.5 Pro
- Gemini 2.5 Flash Preview model
- Gemini 2.5 Flash-Lite Preview model
- Gemini 2.5 Flash
- Gemini 2.5 Flash-Lite
- Gemini 2.5 Flash with Gemini Live API native audio
- Gemini 2.5 Flash with Live API native audio (Preview) Preview model
- Gemini 2.0 Flash with Live API Preview model
- Gemini 2.0 Flash
Parameter list
See examples for implementation details.
googleSearch
Ground the response with publicly-available web data from Google Search.
googleMaps
Ground the response with publicly-available geospatial data from Google Maps.
The API input includes the following parameter:
enable_widget
Required: boolean
Flag that can be set to true
or false
. A value of true
returns a token using the
API response that you can use with the Google Maps context widget user
interface.
The API response structure includes the following parameter:
grounding_metadata
Required: Object
The primary field that contains grounding information.
-
grounding_support: A sub-field indicating the level of grounding support. -
grounding_chunks.maps: A sub-field containing the places sources used to generate the grounded response. -
place_answer_sources.review_snippets: A sub-field withingrounding_chunks.mapsthat appears when a place answer is used to answer a query. Place answers provide deeper contextual information about a specific place using data, such as user reviews. The place answer is backed by a list of sources like user reviews.
Attributes
A place or user review source has the following attributes:
title
Required: Object
The title of the source.
uri
Required: string
A URI linking to the source.
place_id
Required: string
A unique identifier for the place.
review_id
Required: string
A unique identifier for review.
retrieval
Ground the response with private data from Vertex AI Search as a data store. Defines a retrieval tool that the model can call to access external knowledge.
vertexAiSearch
Required: VertexAISearch
Ground with Vertex AI Search data sources.
VertexAISearch
datastore
Required: string
Fully-qualified data store resource ID from Vertex AI Search, in the
following format: projects/{project}/locations/{location}/collections/default_collection/dataStores/{datastore}
Examples
This section provides examples for grounding a response on public web data using Google Search and grounding a response on private data using Vertex AI Search.
Ground response on public web data using Google Search
Ground the response with Google Search public data. Include the google_search_retrieval
tool in the request. No additional parameters are required.
Python
Install
pip install --upgrade google-genai
To learn more, see the SDK reference documentation .
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Go
Learn how to install or update the Go .
To learn more, see the SDK reference documentation .
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Java
Learn how to install or update the Java .
To learn more, see the SDK reference documentation .
Set environment variables to use the Gen AI SDK with Vertex AI:
# Replace the `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION` values # with appropriate values for your project. export GOOGLE_CLOUD_PROJECT = GOOGLE_CLOUD_PROJECT export GOOGLE_CLOUD_LOCATION = global export GOOGLE_GENAI_USE_VERTEXAI = True
Ground response on private data using Vertex AI Search
Ground the response with data from a Vertex AI Search data store. For more information, see Vertex AI Search .
Before you ground a response with private data, create a data store and a search app .
WARNING: For the time being, this "grounding" interface does not support Vertex AI Search "chunk mode".
Gen AI SDK for Python
What's next
For detailed documentation, see the following:

