Back to blog
ChatGPT13 min read

Grounding Gemini with Google Search (Prompt Patterns)

Gemini grounding search, verified at Google's docs on September 16, 2026: how the google_search tool decides to search, what it costs, where the app differs, and prompts that ask for it.

NH
Nafiul Hasan
Founder, Prompt Architects

TL;DR: Gemini grounding search is a Gemini API feature: enable the google_search tool and the model decides, prompt by prompt, whether to search Google, then returns an answer with inline citations. The consumer Gemini app has no documented grounding switch. Prompts that name dates, entities and "current" facts give the model a clear reason to search. Always check the citations.

Grounding with Google Search is a tool in the Gemini API. Google's developer page, which we read on September 16, 2026, says it "connects the Gemini model to real-time web content" and lists three benefits: fewer hallucinations, access to recent information, and citations.

The mechanics matter more than the pitch, so here they are in Google's order. Your app sends a prompt with the google_search tool enabled. Then comes the step most tutorials skip: "The model analyzes the prompt and determines if a Google Search can improve the answer." If it decides yes, it writes one or more search queries, runs them, reads the results and writes a response.

That second step is the whole reason prompt patterns matter. Turning the tool on does not guarantee a search. It gives the model permission to search when it thinks it should.

This post is about the Gemini API and, briefly, the Gemini app. If you use Gemini inside Gmail, Docs or Sheets, that is a different surface with its own rules, covered in Prompting Gemini Inside Google Workspace.

Is grounding available in the Gemini app or only in the API?

In the API, it is a documented switch. In the consumer app, it is not.

Google's Gemini Apps help article, checked the same day, says the app "may provide links to sources and related content", which can include public websites, files you uploaded, or connected Workspace content. You find them under a Sources button at the bottom of a response or inline. The same article says "Not all responses include related links or sources." We found no documented setting that makes the app search on every prompt.

One change worth flagging. Search engine listings for the same help article still show an older title that also mentioned double-checking responses, and older descriptions of a double-check button. The live article on September 16, 2026 is titled "View related sources from Gemini Apps", and the double-check section is not on the page. We are not saying the feature is gone from the app, since we could not test every account. We are saying Google's current help article no longer documents it.

Google's own advice for app users is blunt. Its "Learn about responses" article says "Gemini can hallucinate and present inaccurate information as factual." Grounding in the app is something Gemini may do, not something you can require.

SurfaceCan you switch grounding on?Where sources appearSource checked
Gemini APIYes, google_search toolInline url_citation annotationsai.google.dev, Sep 16, 2026
Google AI StudioPricing page notes some models "Can be tested in Google AI Studio"In the Studio interfaceai.google.dev pricing, Sep 16, 2026
Gemini Enterprise Agent PlatformYes, Google Search groundingResponse metadata plus required Search Suggestionsdocs.cloud.google.com, Sep 16, 2026
Gemini appNo documented switchSources button, when providedsupport.google.com, Sep 16, 2026

Note the third row's name. The Vertex AI grounding URL now redirects to a page under "Gemini Enterprise Agent Platform", although its code samples still refer to Vertex AI. If you follow an older tutorial, expect the product name to differ.

How do you turn on Google Search grounding in the Gemini API?

Add the tool to your request. Google's current examples use the Interactions API and gemini-3.8-flash:

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    model="gemini-3.8-flash",
    input="Who won the euro 2024?",
    tools=[{"type": "google_search"}],
)

print(interaction.output_text)

That is Google's own example, reformatted onto more lines. Google's page also notes that older models used a different tool name, and that current models should use google_search. If a tutorial shows google_search_retrieval or a dynamic retrieval threshold, it was written for an older generation.

The Interactions API reference lists a search_types option on the search tool, with web_search (text results) and image_search (image bytes returned). It also lists a tool_choice setting with the values auto, any, none and validated. The reference does not explain how those modes apply to the built-in search tool, so if you need a search on every call, test it rather than assuming.

Google's supported-models table on the grounding page lists every current Gemini 3.x Flash model, Gemini 3.1 Pro Preview, two image preview models, and Gemini 2.5 and 2.0 models.

What does a grounded Gemini response contain?

A grounded response is more than text. Per Google's docs, it includes:

  • A google_search_call step listing the queries the model ran.
  • A google_search_result step with search_suggestions, an HTML snippet for showing search suggestions in your UI.
  • The answer text, with url_citation annotations. Each one has a URL, a title, and start_index and end_index values marking which part of the text it supports.

Two practical points follow. First, log the queries. They show you what the model actually searched for, which is often the fastest way to see why an answer went wrong. Second, build citations from the annotations, not from anything the model writes in prose. The annotation ties a span of text to a URL; a URL typed into the answer does not.

How much does Gemini grounding cost?

It depends on the model generation. Google's grounding page says that with Gemini 3, "your project is billed for each search query that the model decides to execute." If the model runs two queries for one prompt, that is two billable uses. Gemini 2.5 and older models are billed per prompt instead.

The pricing page listed grounding for Gemini 3.8 Flash as not available on the free tier. That billing model has a prompt-design consequence. A vague prompt can lead the model to run several searches to work out what you meant. A precise prompt usually needs fewer. Precision is cheaper as well as better.

Google does not publish a list of phrases that trigger a search. What it documents is that the model decides whether a search "can improve the answer." So the practical goal is to make that obvious. The patterns below are our guidance, based on that documented behaviour, not rules from Google. Test them on your own traffic.

Pattern 1: Anchor the question in time

Questions about now, this week or a named recent date cannot be answered from training data alone.

As of [today's date], what is the current [price / status / version] of
[specific thing]? Give the date shown on each source you use.

Pattern 2: Name the entity precisely

Specific names produce better queries and fewer near-miss results. "The EU AI Act's obligations for general-purpose AI models" beats "AI rules in Europe".

What did [organization]'s official announcement on [date or event] say about
[specific topic]? Use the organization's own site where possible.

Pattern 3: Ask for sources as part of the job

When the task requires citing something, searching is the obvious way to do it.

Answer in no more than 4 sentences. Every factual sentence must be supported
by a cited source. If you cannot find a source for a point, leave the point
out and say what is missing.

Pattern 4: Give the model a way out

Grounded models can still reach for memory when results are thin. Explicit permission to report a gap helps. Perplexity documents the same technique for its own search API, and it transfers well.

If the search results do not answer the question, say "No reliable source
found" and stop. If the results are about a different year, product or
organization than I asked about, say so before answering.

Pattern 5: Separate the search from the writing

For longer outputs, ask for the evidence first, then the prose.

Step 1: Search for [topic] and list the 5 most relevant sources with title,
domain and date.
Step 2: Using only those sources, write a 150-word summary for [audience].
Mark any sentence you could not support.

Pattern 6: Point to known sources with URL context

If you already know which pages should count, Google's grounding page says search grounding can be combined with the URL context tool. Give the URLs and ask Gemini to prefer them, and use search to fill gaps.

For grounding in documents you supply, rather than the web, the techniques in Grounding Techniques: Keeping AI Tied to Your Facts apply directly.

How do you debug a grounded answer that went wrong?

When a grounded answer is wrong, the response usually tells you why, if you look in the right order.

  1. Check whether it searched at all. If there is no google_search_call step, the model answered from memory. Rewrite the prompt so the need for current information is explicit (patterns 1 to 3 above).
  2. Read the queries. The queries in the search call show what the model thought you asked. A query that drops your date range or swaps your entity for a similar one explains most bad answers. Fix the prompt, not the answer.
  3. Match each claim to its annotation. Use start_index and end_index to see exactly which span each URL is meant to support. Sentences with no annotation are the model's own words and deserve the most suspicion.
  4. Open the cited page. Confirm the sentence is there and says the same thing. A real URL attached to a sentence it does not support is still an error.
  5. Try URL context for the page you trust. If you know the right source, pass it directly and compare the two answers.

Keep a small test set of prompts with known correct answers, and rerun it whenever you change models. Google's supported-models list changes often, and a pattern that searched reliably on one model may behave differently on the next. A quick review prompt can help you spot weak spots before a human check:

Review your previous answer. For each sentence, say which cited source
supports it, or write NO SOURCE. List any sentence where the source is
about a different date, product or organization than the question.

Which prompts should not use search grounding?

Not every prompt benefits, and with per-query billing some cost you for nothing:

  • Pure writing tasks. Rewriting your own paragraph needs no search.
  • Reasoning over data you provided. Pass the data in the prompt or with URL context.
  • Private information. Search reaches the public web. It will not find your internal documents.
  • Anything where a fresh but wrong page would be worse than no page. Medical, legal and financial answers need a qualified human check whatever the tool.

Does grounding make Gemini's answers accurate?

It makes them more checkable, which is not the same thing. Google's grounding page lists "Reduce model hallucinations by basing responses on real-world information." as a benefit, and we found no accuracy figure on that page to measure it by.

Independent research on AI search tools is a useful caution. A 2025 Tow Center study of eight AI search tools found high error rates when they were asked to identify the source of news excerpts, and its finding about fabricated or broken links was specific to Gemini and Grok 3. That study tested an earlier generation and one narrow task, so do not stretch it too far. We walk through what it did and did not measure in How Accurate Are Perplexity's Citations?.

Google also documents a publisher-side limit. Its Enterprise Agent Platform page says grounding there "does not use web pages for grounding that have disallowed Google-Extended". Some sites you might expect to be cited may never appear.

A simple verification habit covers most of this. For each citation that supports something important, open the URL, find the sentence, and confirm it says what the answer says. For a full workflow built on that habit, see our guide to using Perplexity for competitive research. The same steps apply to Gemini.

What should you check before shipping a grounded Gemini feature?

A short checklist, drawn from the Google pages cited above:

  1. Model: confirm your model is in the supported-models table on the grounding page, and that you are using google_search, not the older tool.
  2. Billing: with Gemini 3, estimate queries per prompt, not prompts per day. Watch the monthly free allowance and the per-1,000 rate on the pricing page.
  3. Display: render search suggestions and citations the way the terms for your surface require.
  4. Citations: build them from url_citation annotations, and show users which text each source supports.
  5. Fallback: decide what the product says when the model finds nothing. A clear "no reliable source found" is better than a confident guess.
  6. Freshness: re-read Google's grounding and pricing pages before each release. Both changed between the tutorials most people learned from and the versions we read for this post.

If you can tick all six, your grounded feature will fail in visible, fixable ways rather than silent ones.

How do you reuse grounded prompt patterns?

Once a pattern works, save it with the parts that change marked as variables: the entity, the date, the audience, the number of sources. Then you only fill in the blanks next time.

Prompt Architects can store these patterns, fill in variables, and tailor a draft prompt for Gemini as the target platform. It does not run searches, and it cannot switch grounding on for you. That is set in your API request. For longer research inside Gemini's own product, Prompting Gemini Deep Research covers the agent that plans many searches for you, and Gemini vs ChatGPT covers what else changes when you move a prompt between the two.

Free Chrome Extension

Stop rewriting prompts. Start shipping.

Works with ChatGPT, Claude, Gemini, Grok, Midjourney, Ideogram, Veo3 & Kling. 4.8★ on the Chrome Web Store.

Create An Account

Frequently asked questions

Free Chrome Extension

Stop rewriting prompts. Start shipping.

Works with ChatGPT, Claude, Gemini, Grok, Midjourney, Ideogram, Veo3 & Kling. 4.8★ on the Chrome Web Store.

Create An Account