Prepare and test your skills
Prepare and test your skills
Pre-built Retrieval-Augmented Generation (RAG) is a design where search supplies fresh context before a large language model (LLM) writes its answer. In this design, Vertex AI Search (opens in a new tab) first retrieves relevant passages from authoritative enterprise data, and then the LLM uses both the user question and those passages to generate a response. Data flows from connected data stores to Vertex AI Search in response to the query, and then selected extracts flow from the search response to the LLM as added context. Grounding is the practice of tying an answer to specific, retrievable source content so it can be checked. Generative models learn patterns from training data and then create new text, images, and code, but a hallucination is a confident response that cannot be grounded and may sound plausible while being false. Pre-built RAG reduces this risk by placing verified enterprise passages alongside the question before generation. Systems that use a graph representation can further improve retrieval by traversing nodes and edges to retrieve relevant subgraphs, which gives the generator richer, relationship-aware context.
Snippets, extractive answers, and extractive segments are three kinds of verbatim extracts that Vertex AI Search can return with each result. Snippets are short previews with hit highlighting in bold HTML tags, while extractive answers and extractive segments are longer verbatim sections taken directly from the source document. Extractive segments are usually more verbose than extractive answers and are designed to be displayed as answers, used for post-processing, and used as input for LLMs to generate new text.
The request controls which output is returned. A search request sets returnSnippet to true for snippets, and sets maxExtractiveAnswerCount for extractive answers, where the default is 0 and the maximum is 5. The options compare as follows:
| Search output | What it provides | Typical use and availability |
|---|---|---|
| Snippet | Brief verbatim extract with bold hit highlighting, returned in derivedStructData.snippets with a snippet_status of SUCCESS or NO_SNIPPET_AVAILABLE | Preview text under each result to help judge relevance; available for unstructured and website search |
| Extractive answer | Short verbatim paragraph, table, or list from the document, returned in extractive_answers | Precise answer near the top of a page when exact wording matters; requires Enterprise edition features, plus advanced website indexing for website data |
| Extractive segment | Longer verbatim passage than an extractive answer | Input context for an LLM and for post-processing; requires Enterprise edition features, plus advanced website indexing for website data |
Extractive answers can serve as an alternative to summarized responses when exact wording matters, while extractive segments give the LLM broader context for synthesis. Snippets remain useful for previews, but they are briefer and more uniform in length since July 2023 and no longer provide page numbers, while extractive answers provide page numbers where available.
Exam tip: Use extractive answers, which provide page numbers where available, or extractive segments for LLM input instead of snippets when verifiable answers are needed.
A managed search engine for RAG is a service where Google Cloud operates the optimized search and vector infrastructure so teams do not build it themselves. Vertex AI Search indexes enterprise data and serves relevant results to the model, so teams do not need to design a tailor-made search engine, tune a specialized vector database, or manage embedding storage separately. The trust boundary sits at the search-engine layer because applications query the search engine rather than reading raw vector data, since the service prevents direct access to the underlying embeddings. Vertex AI Search supports most data sources, including unstructured data and website data, which fits both internal and external knowledge discovery. Internal uses include employee assistants that answer from company documents and policies, while external uses include customer-facing assistants that answer from product and support content. In both cases data flows from indexed sources to Vertex AI Search and then into the model prompt. Other grounding paths depend on where trusted information lives:
Continue with this study guide: Pre-built RAG with Vertex AI Search
The ordered retrieval flow for RAG APIs is the fixed sequence that turns a user query into a grounded answer. An embedding is a numerical representation of text, images, or video stored as an array of floating point numbers called a vector. Embeddings place similar meanings close together in vector space, so similarity search finds relevant documents even when wording differs. Many engines store these vectors in a vector database, which is optimized for similarity search by meaning rather than exact keywords. Vertex AI Search (opens in a new tab) is the optimized, managed option for building a RAG search engine when teams want broad source support without managing embeddings. Enterprise data flows from data stores into the search index, user queries flow from the application to Vertex AI Search for retrieval, and retrieved passages plus the original query flow to the LLM for generation. Retrieval follows a fixed order:
A grounding data store is the system that supplies the verifiable facts that are added to the prompt before generation. The choice determines where facts come from, how much management is required, and whether answers stay tied to data the organization controls. Vertex AI Search supports retrieval across most enterprise sources, including structured tables and records and unstructured documents, web pages, and media. Grounding can also use non-vector databases by querying an existing database such as Cloud SQL or Firestore and placing the query result directly into the prompt. The main Google Cloud options differ by management level and data pattern:
| Option | Management level | Choose when |
|---|---|---|
| Vertex AI Search | Fully managed search engine | You want RAG over many sources without managing embeddings |
| Vertex AI Vector Search | Managed vector database | You need low-latency vector search and large-scale serving with custom tuning |
| Vertex AI RAG Engine | Managed orchestrator | You are building a search engine for RAG with orchestrator-level control |
| AlloyDB or Cloud SQL | SQL database | Data is accessed programmatically as OLTP, already lives in SQL, or needs low latency with Google AI models directly from the database |
| BigQuery | Analytical warehouse | Data is a large OLAP dataset with batch processing and frequent SQL access |
A reference architecture can be used to build a tailor-made search engine and vector database when managed options do not fit.
Exam tip: Choose Vertex AI Search when you want a fully managed RAG search engine without direct access to embeddings, and choose Vertex AI Vector Search when you need to build and tune a low-latency vector database yourself.
Public-web context and external system connections are two RAG API paths that ground answers outside the enterprise index. Grounding with Google Search provides real-time public-web context to Gemini models, which evaluate whether their own knowledge is sufficient or whether grounding is required. When grounding is required, data flows from Google Search results into the prompt before generation, which helps when answers depend on current events or facts that changed after training. API-based grounding connects LLMs to external system APIs instead of, or in addition to, indexed data. Vertex AI Extensions lets teams create, deploy, and manage extensions that connect LLMs to outside systems, and LangChain Components are also available for building these connections. In this flow a request flows from the model to the external system API, and the API result flows back into the prompt before generation. This keeps answers tied to live systems and supports provenance for business applications.
Continue with this study guide: RAG APIs
Grounding with Google Search (opens in a new tab) is a technique that connects an LLM to real-time internet data so responses reflect current facts. A hallucination is a confident response that cannot be grounded in training data, often appearing as a plausible-sounding falsehood inside otherwise normal content. Training data alone leads to hallucinations because it is a fixed snapshot taken when the model was built, so the model may invent an answer when asked about a recent event missing from that snapshot. Ground truth is the absolute truth of a decision or measurement problem, as opposed to a system estimate. Training data is the ground truth during learning, but that ground truth does not update when the real world changes. Grounding with Google Search reduces hallucinations by retrieving relevant search results and passing them to the model as context, so the model generates from retrieved information rather than only from training patterns. This gives access to facts about current events and provides verifiable citations that let users check the source behind the answer.
Transparency through source citations is the ability of a grounded response to show which web sources support which claims. Grounding metadata is the supporting information that Vertex AI returns with a grounded response to explain its sources. The metadata links specific claims or passages in the answer to web pages found through Google Search, typically identifying the source title, a link to the original content, and the text span that supports the claim. Because the metadata travels with the answer from the model to the application to the user, the evidence stays attached instead of being hidden. Data flows from Google Search results into the model response, then from the model response into grounding metadata, and then from the citation link to the source page. A typical verification flow follows an ordered sequence:
When the claim matches the source, trust increases, and when it does not match or the source looks weak, the user can discount that part or keep searching.
Live search grounding is superior when the correct answer depends on current or broad public information that static training data cannot reliably contain. Static training data is frozen at a point in time, while Grounding with Google Search (GWGS) pulls from the live search index at response time. GWGS is the better choice for current news and recent events after training, global public facts on the open web, and dynamic subjects where details change often. Grounded responses on the Gemini Enterprise Agent Platform are built from three inputs working together. Data flows from the end-user prompt and customer-provided context to the Google Search engine, and then back into the model response. The output includes both the grounded suggestion shaped by retrieved web information and recommended search suggestions that support verification. Basic implementation means enabling the companion agent Google Search tool, after which prompts sent through the agent automatically gain access to live web data alongside customer context. Use is subject to Section 20(k) (GWGS) of the Google Cloud Platform Service Specific Terms. Enabling GWGS also changes security controls:
When the tool is enabled, these controls will not apply to search requests.
Exam tip: Choose Grounding with Google Search for current news and changing public facts; when GWGS is enabled, CMEK, DRZ, VPC-SC, and AXT do not apply to search requests.
Continue with this study guide: Grounding with Google Search
Snippets are brief verbatim extracts with bold hit highlighting for preview text under each result, while extractive answers are short verbatim paragraphs, tables, or lists and extractive segments are longer verbatim passages designed as input context for large language models (LLMs) and for post-processing. A search request sets returnSnippet to true for snippets and sets maxExtractiveAnswerCount for extractive answers, where the default is 0 and the maximum is 5. Extractive answers and extractive segments require Enterprise edition features, plus advanced website indexing for website data.
Choose Vertex AI Search when you want a fully managed search engine for Retrieval-Augmented Generation (RAG) over many sources without managing embeddings or accessing underlying embeddings directly. Choose Vertex AI Vector Search when you need a managed vector database for low-latency vector search and large-scale serving with custom tuning. Vertex AI Search indexes enterprise data and serves relevant results to the model so teams do not need to design a tailor-made search engine, tune a specialized vector database, or manage embedding storage separately.
Grounding with Google Search (GWGS) reduces hallucinations by retrieving relevant live search results and passing them to the model as context so it generates from current facts rather than only from its fixed training snapshot. A hallucination is a confident response that cannot be grounded and may sound plausible while being false, and training data alone can cause it when asked about recent events missing from that snapshot. Grounded responses return grounding metadata that links specific claims to source titles, links, and supporting text spans so users can verify the answer.
Last updated