基準化技術可協助模型生成更值得信賴、實用且符合事實的回覆。建立生成式 AI 模型回覆的基準時,您可以將回覆內容連結至可驗證的資訊來源。如要實作基礎,通常必須擷取相關來源資料。建議的最佳做法是使用檢索增強生成 (RAG) 技術。檢索工作通常由搜尋引擎負責處理,這個工具會使用索引,其中嵌入了來源文字的語意。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間: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)."]]