Prepare and test your skills
Prepare and test your skills
Describing the concept of grounding in LLMs and differentiating data sources is the foundation for choosing accurate and auditable answers. Grounding is the ability to connect model output to verifiable sources of information at generation time. In Gemini Enterprise Agent Platform (opens in a new tab), grounding tethers output to chosen sources, reduces hallucinations where the model generates content that is not factual, and provides auditability through grounding support links to sources.
What grounding means for model output is that every answer is anchored to information the model can point to. A large language model without grounding must rely only on patterns learned during training, which can be incomplete or out of date. Grounding changes what the model is allowed to base its answer on without changing the model itself, so the response reflects retrieved facts rather than guesses. A response that cannot be traced to those sources is not considered grounded, which matters most for customer answers, business decisions, and regulated work.
How grounding connects models to data sources is a fixed retrieval flow across a trust boundary. The data source sits on one side of the boundary and the model sits on the other, with retrieved snippets bridging the two:
Because retrieval happens first and generation happens second, the answer reflects what the source returned for that request.
Exam tip: A claim that is only partially supported by retrieved facts counts as ungrounded, even if part of the sentence is correct.
First-party enterprise data, third-party data, and world data differ by who owns the data and how the model reaches it. First-party enterprise data is information the organization owns or controls, reached through Agent Search, RAG Engine, Elasticsearch, or your search API for retrieval-augmented generation (RAG). Third-party specialized data is external data from a specialized provider, such as Google Maps for geospatial context, Web Grounding for Enterprise for controlled web answers, and Parallel web search for recent web information. General world data is broad public knowledge reached through Google Search grounding.
The three categories differ in value, access, and privacy:
| Data source category | Primary source | Unique value | Accessibility |
|---|---|---|---|
| First-party enterprise data | Organization-owned websites, documents, and indexes | Anchors responses to internal content and supports auditability | Through Agent Search, RAG Engine, Elasticsearch, or your search API |
| Third-party specialized data | External providers such as Google Maps or specialized web indexes | Domain-specific context, compliance controls, or recency | Through the specific grounding integration for each provider |
| General world data | Public web and search knowledge | Broad coverage across many topics | Through Google Search grounding |
A retail assistant can use Google Maps data for location-aware questions, while a bank can use Web Grounding for Enterprise for controlled web answers.
Privacy, residency, and responsible use controls determine whether a grounding source and endpoint fit a workload. Data at rest remains in the customer-selected location regardless of the endpoint used, while ML processing location depends on the endpoint type:
us-central1 or europe-west1.Grounding does not remove all risks, since output quality still depends on data quality, prompt quality, and tuning, and models can still produce edge-case errors and bias. Organizations remain responsible for acceptable use and service-specific terms, so the source and endpoint must be chosen together to balance relevance, auditability, and compliance.
Describing how retrieval-augmented generation (RAG) can affect generated output explains why grounded answers are more factual and useful. Retrieval-augmented generation (RAG) (opens in a new tab) is a grounding technique where relevant external information is retrieved and added to the model prompt before generation. Data flows from the grounding source to the prompt and then to the model, so the model reasons over retrieved documents instead of relying only on internal patterns.
Why foundation models need retrieval is that they predict likely responses from statistical patterns, not from lookup. Foundation models are large models trained on vast amounts of text, images, video, and audio that generate new content based on training patterns. Because generation is probabilistic prediction, a model can invent plausible-sounding details when facts are missing, out of date, or specific to one organization. RAG corrects this weakness by adding real-time or organizational documents to the prompt, so output is derived from verifiable evidence.
The typical RAG flow moves in a fixed order:
A three-step process flow showing retrieval-augmented generation: the user query triggers retrieval from a RAG corpus or vector database, retrieved documents augment the prompt, and the model generates a grounded answer.
Gemini models can evaluate whether internal knowledge is sufficient or whether grounding with Google Search is required to stay current.
How embeddings and vector search find relevant passages is by matching meaning rather than exact words. Embeddings are numerical representations of data that capture relationships between inputs, stored as arrays of floating point numbers called vectors. Embeddings map content into a continuous vector space where closer proximity means more similar meaning, which lets models process large datasets efficiently. The query is converted into an embedding, that embedding is compared to document embeddings through similarity search, and the most semantically relevant passages are retrieved.
Many search engines store embeddings in a vector database, which is optimized for similarity search operations. Supported grounding sources for this flow include up-to-date internet information through Google Search, an index of organizational data, results from existing databases like Cloud SQL or Firestore, and data retrieved through online service APIs.
How RAG adds citations and source transparency is by carrying source locations from retrieval into the final answer. A RAG corpus is the managed collection of files that supplies grounding material, and teams can upload, import, list, get details about, or delete files in the corpus. The retrieval flow moves from the prompt to the knowledge base and then to the generated response:
Citation means linking each fact to its source location, such as a page, paragraph, table, or row. Clear parser instructions help by telling the model exactly what to extract and what to avoid, such as analysis, inference, or opinions, so the answer stays faithful to the cited source.
How Agent Assist uses live and curated knowledge shows how external conversations improve summarization. Agent Assist summarization pairs a generator that produces candidate summaries with a dataset that supplies the conversations to summarize. Generating new summaries means the model is grounded in the selected dataset during that run, while using existing summaries means earlier output is only being graded.
The two knowledge sources differ in purpose and operation:
| Source type | Best for | How it works |
|---|---|---|
| Agent Assist Storage | Live and production traffic | Randomly samples actual traffic from a chosen date range after the training cutoff |
| Conversational Insights Dataset | Testing specific scenarios | Uses a curated dataset with domain language, products, and test cases |
Summarization autoevaluation scores output on accuracy, completeness, and adherence using large language model judges, evaluating hundreds of conversations in about 20 to 30 minutes. Each evaluation supports a maximum of 100 conversations, and Comparison mode lets teams compare up to five runs side by side with higher scores highlighted in green.
Exam tip: Comparison mode is only valid when both evaluations use the same dataset, verified by matching Dataset ID in the metadata.
Google Cloud grounding offerings are the managed search, data, and web paths that supply verifiable context before generation. Pre-built retrieval-augmented generation is a design where search supplies fresh context before a large language model 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 model uses both the user question and those passages to generate a response.
How pre-built retrieval grounds answers with Vertex AI Search is by placing verified passages alongside the question. 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 model as added context. Grounding ties an answer to specific, retrievable source content so it can be checked, which reduces hallucinations where a confident response cannot be grounded. Vertex AI Search is a managed search engine, so Google Cloud operates the optimized search and vector infrastructure and prevents direct access to underlying embeddings.
The trust boundary sits at the search-engine layer because applications query the search engine rather than reading raw vector data. Internal uses include employee assistants that answer from company documents, while external uses include customer-facing assistants that answer from product content. Other paths depend on where trusted information lives, including Google Search for public information, Vertex AI Search for indexed enterprise content, and APIs for live actions and outside systems.
Snippets, extractive answers, and extractive segments are three kinds of verbatim extracts that Vertex AI Search can return. Snippets are short previews with hit highlighting, while extractive answers and extractive segments are longer verbatim sections taken directly from the source document. The request controls the output with returnSnippet for snippets and maxExtractiveAnswerCount for extractive answers, where the default is 0 and the maximum is 5.
| Search output | What it provides | Typical use and availability |
|---|---|---|
| Snippet | Brief verbatim extract with bold highlighting, returned in derivedStructData.snippets | Preview text to judge relevance; available for unstructured and website search |
| Extractive answer | Short verbatim paragraph, table, or list, returned in extractive_answers | Precise answer when exact wording matters; requires Enterprise edition features |
| Extractive segment | Longer verbatim passage than an extractive answer | Input context for a model and for post-processing; requires Enterprise edition features |
Extractive answers can serve as an alternative to summarized responses when exact wording matters, while extractive segments give the model broader context for synthesis. Snippets are briefer and more uniform since July 2023 and no longer provide page numbers, while extractive answers provide page numbers where available.
Choosing a data store for RAG workloads determines where facts come from and how much management is required. The ordered retrieval flow for RAG APIs turns a query into a grounded answer: first convert the query into an embedding, then search the index with similarity search, then retrieve the most relevant documents, then augment the prompt, and finally generate a grounded response. Vertex AI Search is the optimized, managed option when teams want broad source support without managing embeddings.
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 with custom tuning |
| Vertex AI RAG Engine | Managed orchestrator | You are building a search engine for RAG with orchestrator control |
| AlloyDB or Cloud SQL | SQL database | Data already lives in SQL or needs programmatic OLTP access |
| BigQuery | Analytical warehouse | Data is a large OLAP dataset with batch and SQL access |
Grounding can also use non-vector databases by querying Cloud SQL or Firestore and placing the result directly into the prompt. A reference architecture can be used to build a tailor-made search engine 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.
How live web grounding adds current facts is by connecting the model to real-time internet data. Training data is a fixed snapshot taken when the model was built, so the model may invent answers about recent events missing from that snapshot. Grounding with Google Search retrieves relevant search results and passes them to the model as context, so the model generates from retrieved information and provides verifiable citations.
Grounding metadata is the supporting information that links specific claims to web pages found through search, typically with source title, link, and supporting text span. Data flows from Google Search results into the model response, then into grounding metadata, and then from the citation link to the source page. The user can open the source link and compare the claim against the original content to decide whether to trust that part. On Gemini Enterprise Agent Platform, grounded responses combine the end-user prompt, customer-provided context, retrieved web information, and recommended search suggestions.
Continue with this study guide: Google Cloud grounding offerings:
Identifying how sampling parameters and settings control model behavior explains how teams tune randomness, size, and safety. Probabilistic control through temperature and top-p tunes how random or predictable word choices are, since the same prompt can produce different results. In the Google Cloud ecosystem, these settings work together with token limits and safety checks to keep performance reliable.
How temperature and top-K control randomness is by narrowing or widening the model's next-token choices. Temperature (opens in a new tab) is the generation parameter that controls prediction randomness on a scale from 0.0 to 1.0, where lower values produce less random output and higher values produce more random output. Top-K sampling changes how the model selects tokens for output in the same direction, where lower values produce less random responses and higher values produce more random responses.
| Parameter | What it controls | Effect of a lower value | Effect of a higher value |
|---|---|---|---|
| Temperature | Randomness of predictions | Less random, more predictable output | More random, more diverse output |
| Top-K sampling | How the model selects tokens for output | Less random responses | More random responses |
In the Agent Platform SDK for ABAP, temperature is configured as the Randomness temperature field in the generation parameters table /GOOG/AI_CONFIG, alongside Model Key, Model ID, Google Cloud Key Name, Region Location ID, and Publisher ID. The model class depends on the Model Key, and the Model Key carries the temperature value to the model. Lower values support expected and repeatable output, while higher values support creative output but raise the chance of inaccurate results.
Exam tip: If input or output exceeds the maximum token limit, safety classifiers are not applied — keep prompts and max output settings within limits to keep safety checks intact.
How output length and token limits control cost and safety is by capping how much text a model takes in and generates. Every request is measured in tokens, which are small pieces of text, and every model has a fixed maximum input and output token limit. Setting a maximum output length below that cap lets an application limit resource use, reduce waiting time, and keep answers the right size for the task. A short cap fits summaries, labels, or chatbot replies, while a longer cap fits detailed explanations or creative drafts.
Fixed limits are also a safety boundary, not just a size boundary. If input or output exceeds the limit, safety classifiers are not applied, which can lead to poor performance and unexpected results. Performance can also drop when input has an unusual or complex structure, even within limits, because models handle common text formats most reliably. Randomness settings alone do not guarantee accuracy, since models still need context grounded in real-world information and high-quality prompts.
How safety services and incident response protect data is by gating access, recording access, and correcting violations. Gemini Enterprise Agent Platform APIs provide safety attribute scoring to test safety filters and set confidence thresholds, and Vertex AI Studio includes built-in content filtering. Google recommends assessing security risks, performing safety testing, configuring safety filters if required, and then monitoring content with user feedback.
Services that gate, log, and protect data cover different boundaries:
| Service | What it protects | How it works |
|---|---|---|
| Access Approval | Google administrator access to customer data | Requires customer approval before access for support |
| Access Transparency | Visibility into Google administrative access | Logs administrative access by authorized personnel |
| Assured Workloads | Regulatory and regional compliance | Creates control packages for programs such as FedRAMP or Sovereign Controls for EU |
| Cloud KMS with Cloud EKM | Encryption keys for data at rest | Keeps keys in a third-party system outside Google infrastructure |
| Confidential Computing | Data in use | Encrypts data while it is being processed |
Access Approval gates access until the customer approves it, while Access Transparency records that access in logs tied to the approval. Incident response then finds and fixes violations in order: first signal development builds threat indicators, then threat detection scans logs for matches, then incident investigation classifies the cause, and finally remediation documents the incident and improves protections.
Grounding is the ability to connect model output to verifiable sources of information at generation time. It reduces hallucinations where the model generates content that is not factual and provides auditability through grounding support links to sources. A claim that is only partially supported by retrieved facts counts as ungrounded, even if part of the sentence is correct.
First-party enterprise data is information the organization owns or controls and is reached through Agent Search, RAG Engine, Elasticsearch, or your search API for retrieval-augmented generation (RAG). Third-party specialized data is external data from a specialized provider, such as Google Maps for geospatial context, Web Grounding for Enterprise for controlled web answers, and parallel web search for recent web information. General world data is broad public knowledge reached through Google Search grounding.
Retrieval-augmented generation (RAG) is a grounding technique where relevant external information is retrieved and added to the model prompt before generation. Data flows from the grounding source to the prompt and then to the model, so the model reasons over retrieved documents instead of relying only on internal patterns. The model then generates a response constrained by the retrieved evidence, which improves factual accuracy and contextual relevance.
Choose Vertex AI Search when you want retrieval-augmented generation (RAG) over many sources without managing embeddings. Vertex AI Search is a fully managed search engine where Google Cloud operates the optimized search and vector infrastructure and prevents direct access to underlying embeddings. Choose Vertex AI Vector Search when you need low-latency vector search with custom tuning.
Last updated