Prepare and test your skills
Prepare and test your skills
Mitigation of model hallucinations is the use of retrieval-augmented generation (RAG) (opens in a new tab) to anchor answers in retrieved evidence instead of letting the model guess. Foundation models (opens in a new tab) predict likely responses from statistical patterns learned during training, so they can produce fluent but false information when facts are missing or out of date. RAG reduces this risk by adding real-time or organizational documents to the prompt before generation, so the output is derived from verifiable evidence.
Foundation models are large models trained on vast amounts of data across text, images, video, and audio. A foundation model uses statistical modeling to predict a likely response to a prompt and to generate new content based on patterns from its training data. Because generation is probabilistic prediction rather than lookup, the model can invent plausible-sounding details when it lacks current facts or specific organizational knowledge. Grounding corrects this weakness by supplying external data for the model to use during generation.
Retrieval-augmented generation (RAG) is a grounding technique where relevant external information is retrieved and added to the model prompt to produce informed and accurate responses. 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. Supported grounding sources include up-to-date information from the internet through Google Search, an index of organizational data with a search engine, results from existing databases like Cloud SQL or Firestore, and data retrieved through online service APIs.
A typical RAG flow moves through an ordered sequence:
A left-to-right process flow showing user query leading to Retrieve, Augment, and Generate steps that produce a grounded answer with citations.
Gemini models can evaluate whether internal knowledge is sufficient or whether grounding with Google Search is required, which helps keep answers current when facts change after training.
Embeddings are numerical representations of data, such as text, images, or videos, that capture relationships between different inputs. An embedding converts raw content into arrays of floating point numbers called vectors, mapping data into a continuous vector space where closer proximity means more similar meaning. This vector form lets machine learning models process large datasets efficiently and discern nuanced patterns that would be hidden in raw data.
Systems that use retrieval-augmented generation (RAG) depend on embeddings to match a user query with relevant knowledge. The query is first converted into an embedding, then that embedding is compared to the embeddings of documents in the knowledge base through similarity search in vector space. Many search engines store embeddings in a vector database, which is an optimal format for similarity search operations and for retrieving the most semantically relevant information to ground the response.
Exam tip: A model without RAG answers from internal probabilistic patterns, while RAG answers from retrieved documents added to the prompt — choose RAG when factual accuracy requires verifiable evidence.
Integration of real-time and proprietary knowledge means supplying a generative AI model with information that was never part of its original training data. Agent Assist (opens in a new tab) summarization shows how this works: external conversations flow into a summarization generator, and the generated summaries are then measured to confirm the external knowledge improved them. Instead of relying only on frozen historical knowledge, the system retrieves external content and places it into the prompt, so output reflects what is true right now and true for that organization.
Agent Assist summarization draws on two external data sources, and the choice decides whether output reflects live conditions or a controlled test scenario. Agent Assist Storage is the real-time path because it samples actual traffic from a chosen date range, so summaries are grounded in conversations that occurred after the model's training cutoff. A Conversational Insights Dataset is the proprietary path because it is curated by the organization, so it carries domain-specific language, products, and scenarios that a general model would not know.
| Source type | Best for | How it works |
|---|---|---|
| Agent Assist Storage | Live and production traffic | You select a date range and sample size, and the evaluation randomly samples from actual traffic stored in your system |
| Conversational Insights Dataset | Testing specific scenarios | You select a curated dataset created in Customer Experience Insights, which suits golden sets or specific test cases |
Raw transcript files must first be converted into the supported format before they can be uploaded as a dataset.
The external knowledge reaches the output through an ordered evaluation workflow that pairs a generator with a dataset and then produces summaries from that pairing. The generator is the model configuration that produces candidate summaries, and its section definitions serve as ground truth for scoring. The summary source step controls whether the generator actually reads the external conversations during that run.
The workflow runs in this order:
Generating new summaries means the model is grounded in the selected dataset during that run, while using existing summaries means the output was produced earlier and is only being graded. For the final score to reflect generator quality, each section's instructions must match those in the generator.
Summarization autoevaluation is the measurement step that scores generated summaries on accuracy, completeness, and adherence. Large language model (LLM) based judges produce these scores, replacing the slow, expensive, and subjective process of humans reading transcripts and grading summaries by hand. The feature evaluates hundreds of conversations in about 20 to 30 minutes, which makes it practical to check whether newly integrated knowledge changed output quality.
After a run completes, a scorecard shows a score for each metric, and clicking any conversation row reveals the raw transcript, the summary candidates, and an explanation of a specific score. The Agent Assist console shows high-level results, but the row-by-row CSV export in Cloud Storage is the source of truth for deep troubleshooting. Comparison mode lets you select two distinct evaluation runs and see them side by side, with higher scores highlighted in green, and you can compare up to five evaluations at once. To compare generator versions, create a second generator that uses a different version, run both evaluations against the same dataset, and then compare.
Exam tip: Comparison mode is only valid when both evaluations use the same dataset. If the dataset changes between runs, the comparison is invalid, so always verify the Dataset ID matches in the metadata.
Limits and boundaries for autoevaluation constrain how much real-time and proprietary knowledge can be tested at once. Each evaluation supports a maximum of 100 conversations, and the feature is available only in three Agent Assist regions. The feature also does not support VPC Service Controls, so it cannot be placed inside that network security perimeter. Automated scores are trustworthy but should still be verified because edge cases exist, so auditing a small sample manually against the Cloud Storage CSV export builds trust in the automated score.
Enhancement of transparency and source attribution is the ability of retrieval-augmented generation (RAG) to link each claim in an answer back to its original source. When a user sends a prompt, the retrieval component searches a connected knowledge base for relevant information and passes those results to the model. Because the final answer is built from retrieved passages, each fact can be traced back to its original file and location.
The RAG retrieval flow connects a user question to specific source material before any answer is written. The flow moves from the prompt to the knowledge base and then to the generated response, which makes verification possible. A RAG knowledge base can be built from uploaded local files or by selecting an existing knowledge base.
The ordered flow is:
This order matters because the model writes only after the sources are supplied. If the retrieved results include source locations, the answer can carry those locations forward as citations.
Citation in RAG means presenting each fact in a structured list and linking it to its source location. The source location names where the fact came from, such as a page, paragraph, table, or row, and can link to its sample page. This structure lets a reader check an AI-driven insight against the original material instead of trusting the summary alone.
Clear parser (opens in a new tab) instructions make those citations more reliable. A well-designed prompt tells the model exactly what to extract, such as names, dates, numbers, attributes, or relationships, and tells it to extract only what the document explicitly says. The prompt also constrains the model by listing actions to avoid, such as analysis, interpretation, summarizing, inferring, or giving opinions. Specific, detailed, and constraining instructions help keep the answer faithful to the source that will be cited.
Exam tip: RAG supports verification because an answer can link to a page, paragraph, table, or row, while a model-only answer has no source location to check.
A RAG corpus is the managed collection of files that supplies grounding material, and its file operations support transparency over time. Teams can upload a file from local storage to add context, import a set of files from other storage, list all files in the corpus, get details about a single file for use by the model, and delete a file from the corpus. The get operation is especially important for attribution because it returns details about a RAG file that the model can use when forming a cited answer.
The File search tool (opens in a new tab) provides a simpler way to use those files for RAG. The tool is configured with a descriptive name, a description that helps the AI decide when to use it, a location for the automatically created knowledge base, and the files selection itself. Accurate parsing further supports trust because the parser can link section titles to details on later slides, relate columns and headers in large tables, follow flowchart logic, and capture relationships between headings and text. When parsing preserves that structure, citations point to the correct section, table, or step rather than to a disconnected fragment.
Retrieval-augmented generation (RAG) reduces hallucinations by retrieving relevant external documents and adding them to the prompt before generation, so the model generates from verifiable evidence instead of only internal probabilistic patterns. Foundation models predict likely responses from statistical patterns learned during training and can invent plausible details when facts are missing or out of date, while grounding can supply up-to-date information through Google Search, an organizational data index, Cloud SQL or Firestore results, or online service APIs.
Embeddings convert content such as text, images, or videos into arrays of floating point numbers called vectors in a continuous vector space where closer proximity means more similar meaning. For retrieval-augmented generation (RAG), the user query is converted into an embedding and compared to document embeddings through similarity search in vector space, often using a vector database optimized for similarity search, to retrieve the most semantically relevant information to ground the response.
Comparison mode is only valid when both evaluations use the same dataset, verified by matching Dataset ID in the metadata. Each autoevaluation supports a maximum of 100 conversations and scores accuracy, completeness, and adherence, and up to five evaluations can be compared at once with higher scores highlighted in green.
Last updated