[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],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)."]]