How does 'Search-grounded' mode work under the hood—are citations confidence-weighted and deduplicated? Can we constrain freshness windows, force certain domains, or provide our own corpus for grounding?
The secret sauce is the same as Google Search because the tool relies on the Google Search Index. Currently, the groundingMetadata does not expose a direct confidence score for each citation. The presence of a citation indicates the model found that source relevant for generating a specific part of the response. In terms of deduping, the system generally attempts to provide unique and relevant sources. While you might see citations from different pages on the same domain if they each contribute distinct information, the goal is to provide a concise set of the most useful sources rather than a long list of redundant links.
For bring your own search scenarios, try using function calling with RAG flows
In terms of working under the hood, the first thing the tool will do is analyze your query. For example, a prompt like "Who won the F1 race last weekend?" will trigger a search, while "Write a poem about the ocean" likely won't. The model then formulates one or more search queries based on your prompt to find the most relevant information from the Google Search Index. The most relevant snippets and information from the search results are fed into the model's context window along with your prompt. The model uses this retrieved information as its source of truth to generate a "grounded" response. The API returns the response along with groundingMetadata. This metadata includes the source URLs for the information used, to build citation links back to the original content for verification.
We are working on a filter to constrain to date ranges. You cannot force certain domains (use URL Context for that), but you can exclude some domains from search. The “Bring your own search” option is available through Vertex.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
How does 'Search-grounded' mode work under the hood—are citations confidence-weighted and deduplicated? Can we constrain freshness windows, force certain domains, or provide our own corpus for grounding?
The secret sauce is the same as Google Search because the tool relies on the Google Search Index. Currently, the groundingMetadata does not expose a direct confidence score for each citation. The presence of a citation indicates the model found that source relevant for generating a specific part of the response. In terms of deduping, the system generally attempts to provide unique and relevant sources. While you might see citations from different pages on the same domain if they each contribute distinct information, the goal is to provide a concise set of the most useful sources rather than a long list of redundant links.
For bring your own search scenarios, try using function calling with RAG flows
In terms of working under the hood, the first thing the tool will do is analyze your query. For example, a prompt like "Who won the F1 race last weekend?" will trigger a search, while "Write a poem about the ocean" likely won't. The model then formulates one or more search queries based on your prompt to find the most relevant information from the Google Search Index. The most relevant snippets and information from the search results are fed into the model's context window along with your prompt. The model uses this retrieved information as its source of truth to generate a "grounded" response. The API returns the response along with groundingMetadata. This metadata includes the source URLs for the information used, to build citation links back to the original content for verification.
We are working on a filter to constrain to date ranges. You cannot force certain domains (use URL Context for that), but you can exclude some domains from search. The “Bring your own search” option is available through Vertex.