Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Stay organized with collections
Save and categorize content based on your preferences.
Grounding is a technique that you can use to help produce model responses that
are more trustworthy, helpful, and factual. When you ground generative AI model
responses, you connect them to verifiable sources of information. To implement
grounding, usually, you must retrieve relevant source data. The
recommended best practice is to use the retrieval-augmented generation (RAG)
technique. Retrieval is usually done using a search engine, which uses an index
that's embedded with the semantic meanings of the source text.
There are also services and component APIs that implement the RAG lifecycle,
such as the Vertex AI Search Builder API, which allows for mix-and-match
building. With mix-and-match building, you can implement a RAG solution using
any of the following services or APIs:
Grounding generation API: You can use it to implement grounding, or link
to a retrieval provider for the complete RAG lifecycle.
Document layout parser: This parser represents the best of
Document AI and Gemini for document understanding. For more
information about the layout parser, see
Use the layout parser.
Vertex AI Vector Search: This search service is
highly performant and uses a high-quality vector database.
Check grounding API: This API compares RAG output with the retrieved facts
and helps to ensure that all statements are grounded before returning the
response to the user.
Ground responses using Vertex AI RAG Engine
To ground responses using Vertex AI RAG Engine, you must create a
prompt. Do the following:
In the Google Cloud console, go to the Create prompt page using
Vertex AI Studio.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Ground responses using RAG\n\nGrounding is a technique that you can use to help produce model responses that\nare more trustworthy, helpful, and factual. When you ground generative AI model\nresponses, you connect them to verifiable sources of information. To implement\ngrounding, usually, you must retrieve relevant source data. The\nrecommended best practice is to use the retrieval-augmented generation (RAG)\ntechnique. Retrieval is usually done using a search engine, which uses an index\nthat's embedded with the semantic meanings of the source text.\n\nThere are also services and component APIs that implement the RAG lifecycle,\nsuch as the Vertex AI Search Builder API, which allows for mix-and-match\nbuilding. With mix-and-match building, you can implement a RAG solution using\nany of the following services or APIs:\n\n- **Grounding generation API**: You can use it to implement grounding, or link to a retrieval provider for the complete RAG lifecycle.\n- **Document layout parser** : This parser represents the best of Document AI and Gemini for document understanding. For more information about the layout parser, see [Use the layout parser](/vertex-ai/generative-ai/docs/rag-engine/layout-parser-integration#use-layout-parser).\n- **Vertex AI Vector Search**: This search service is highly performant and uses a high-quality vector database.\n- **Check grounding API**: This API compares RAG output with the retrieved facts and helps to ensure that all statements are grounded before returning the response to the user.\n\nGround responses using Vertex AI RAG Engine\n-------------------------------------------\n\nTo ground responses using Vertex AI RAG Engine, you must create a\nprompt. Do the following:\n\n1. In the Google Cloud console, go to the **Create prompt** page using\n Vertex AI Studio.\n\n [Go to Create prompt](https://console.cloud.google.com/vertex-ai/studio/multimodal)\n2. Select **Grounding: Your data**.\n\n3. Select **RAG Engine** grounding source.\n\n4. From the **Corpus** list, select your corpus name.\n\n5. In the **Top-K Similarity** field, select **20**, which is the default.\n\n6. Click **Save**.\n\nWhat's next\n-----------\n\n- To learn more about responsible AI and safety filters, see [responsible AI best practices and Vertex AI's safety filters](/vertex-ai/generative-ai/docs/learn/responsible-ai).\n- To learn more about how RAG is implemented by RAG Engine, see [RAG Engine](/vertex-ai/generative-ai/docs/rag-overview)."]]