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 to your own data - ground a model with your own data from Vertex AI Search as a data store (Preview).
For more information about grounding, see Grounding overview.
Supported models
Parameter list
See examples for implementation details.
GoogleSearchRetrieval
Ground the response with public data.
Parameters | |
---|---|
|
Required: Ground with publicly available web data. |
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.
Parameters | |
---|---|
|
Required: Ground with Vertex AI Search data sources. |
VertexAISearch
Parameters | |
---|---|
|
Required: Fully-qualified data store resource ID from Vertex AI Search, in the
following format: |
Examples
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.
Gen AI SDK for Python
Install
pip install --upgrade google-genai
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=us-central1 export GOOGLE_GENAI_USE_VERTEXAI=True
Gen AI SDK for Go
Learn how to install or update the Gen AI SDK for 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=us-central1 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 AI Applications.
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: