Use case Answer-engine research

How to capture Google AI Mode
grounding queries

When Google AI Mode decides a question needs the live web, it writes its own Google searches, runs them, and cites a handful of domains. Plenty of prompts never trigger that at all. The ones that do tell you exactly which searches your pages have to win. Here is how to see them, with code and with Moose.

Watch Moose do it Show me the code
Chat Workflows
Hi, Moosehttps://himoose.com
New chat
Home Inbox Context Visibility Workflows Audio Chats Library Connections
Recents
Sam SamPremium
Capture AI Mode grounding … New chat Share
Capture AI Mode grounding queries
What prompt do you want Google AI Mode grounding queries for?
best payroll software for a 20 person company
Checking Gemini grounding queries…
Google AI Mode grounding queries

Gemini used 6 Google grounding queries while grounding this prompt.

Prompt

best payroll software for a 20 person company

Grounding queries
  • best payroll software for small business 2026
  • payroll software pricing 20 employees per month
  • top rated payroll providers small business reviews
  • payroll software with benefits administration small business
  • best payroll software for startups official pricing
  • small business payroll software comparison features
Cited sources
  • forbes.com
  • nerdwallet.com
  • g2.com
  • capterra.com
  • businessnewsdaily.com
  • pcmag.com
  • techrepublic.com
  • usnews.com
  • softwareadvice.com
Grounded response
Enter the prompt you want to inspect with Google AI Mode grounding queries…
Quick start Google AI Mode g… GPT-5.6 Luna Send
Hi, Moose 0.3.281 Beta Need help?
A recreation of the real thing. One prompt in, the query set and the cited domains out.
Moose, a dog, supervising a desk

Chief desk supervisor. Has no opinion on grounding metadata. Still gets a photo on every page.

The definition

What is a grounding query?

A grounding query is a Google search the model writes for itself before it answers you. It reads your prompt, judges whether searching would make the answer better, and if it would, writes one or more searches of its own and runs them. It never looks up the sentence you typed.

When it does search, two things come back and both are recoverable: the queries it wrote, and the domains it cited. One tells you what the contest was, the other tells you who is currently winning it. When it does not search, that is a finding too. The model thinks it already knows your category, and it is answering from memory.

What the user typed
best payroll software for a 20 person company
1 prompt
What Google searched for
best payroll software for small business 2026
payroll software pricing 20 employees per month
top rated payroll providers small business reviews
payroll software with benefits administration small business
best payroll software for startups official pricing
small business payroll software comparison features
6 grounding queries
Who got cited
forbes.com nerdwallet.com g2.com capterra.com businessnewsdaily.com pcmag.com techrepublic.com usnews.com softwareadvice.com
9 domains
Without Moose

How to capture grounding queries with code

This one is not a scraping problem. A grounded response comes back as a list of steps, and one of them, google_search_call, holds the exact queries the model ran. Thirty lines and you have your first capture. The difficulty is not the first capture. It is the four hundredth.

gemini api
# grounding.py · the queries Google wrote for itself

import os, json
from google import genai

PROMPT = "best payroll software for a 20 person company"

client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])

interaction = client.interactions.create(
    model="gemini-3.6-flash",
    input=PROMPT,
    # search is opt-in here. the model still decides
    # on its own whether this prompt needs it.
    tools=[{"type": "google_search"}],
)

queries, sources = [], []
for step in interaction.steps:
    if step.type == "google_search_call":
        queries += step.arguments["queries"]
    if step.type == "model_output":
        for block in step.content:
            # citations hang off spans of the answer text
            for a in (block.annotations or []):
                if a.type == "url_citation":
                    sources.append(a.title)

print(json.dumps({
    "prompt":  PROMPT,
    "queries": queries,      # empty means it never searched
    "sources": sorted(set(sources)),
}, indent=2))
// grounding.mjs · same call, node

import { GoogleGenAI } from '@google/genai';

const PROMPT = 'best payroll software for a 20 person company';

const client = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });

const interaction = await client.interactions.create({
  model: 'gemini-3.6-flash',
  input: PROMPT,
  // search is opt-in here. the model still decides
  // on its own whether this prompt needs it.
  tools: [{ type: 'google_search' }],
});

const queries = [];
const sources = [];

for (const step of interaction.steps) {
  if (step.type === 'google_search_call')
    queries.push(...step.arguments.queries);
  if (step.type === 'model_output')
    for (const block of step.content)
      // citations hang off spans of the answer text
      for (const a of block.annotations ?? [])
        if (a.type === 'url_citation') sources.push(a.title);
}

console.log(JSON.stringify({
  prompt: PROMPT,
  queries,                        // empty means it never searched
  sources: [...new Set(sources)].sort(),
}, null, 2));
Where it stops being easy
One prompt is not a programme

A capture is one prompt, one moment. The value is fifty prompts on a schedule, deduped, diffed against last month. That is the part nobody wants to build twice.

Search does not always fire

The model decides whether the prompt needs the web. When it decides no, there is no search step at all and nothing tells you why. You have to detect the empty case and decide whether it is a retry or a real finding.

Citations are not a list

Sources arrive as annotations pinned to character ranges in the answer, not as a sources array. Turning that into the nine domains you actually want means walking every annotation and deduping.

You pay per query, not per prompt

On Gemini 3 models each search the model runs is billed separately, so a prompt that grounds six times costs six. Fine for a demo. Less fine when someone asks what the monthly line item is.

Storage is the actual product

Queries only mean something next to the last capture. Once you have that thought, you are no longer writing a script, you are maintaining a database.

With Moose

Or you ask, and it is done in three moves

Same call, same field, none of the plumbing around it. Moose keeps every run, so the interesting question stops being "what did it search for" and becomes "what changed since last month".

01
Open a chat and ask

Type "capture AI Mode grounding queries", or hit the quick start chip in the composer. No key to paste, no client to install.

02
Give it the prompt

A question your buyer would actually type. Moose runs it grounded and pulls the queries and the cited domains out of the response.

03
Keep the run

Queries and sources land in your library, exportable, and diffable against every earlier capture of the same prompt.

Grounding capture is on the managed plan only

Same as fan-out capture. The run has to go straight to Google with search grounding enabled, and routed access through OpenRouter strips the grounding metadata before it reaches you. If you are on BYOK Free or BYOK, everything else in Moose still works. This one feature does not.

Real output

One capture, in full

Captured for the prompt best payroll software for a 20 person company. Six searches, nine domains cited. Note how few of the searches carry the words the buyer typed.

Google AI Mode · 6 grounding queries
01 best payroll software for small business 2026
02 payroll software pricing 20 employees per month
03 top rated payroll providers small business reviews
04 payroll software with benefits administration small business
05 best payroll software for startups official pricing
06 small business payroll software comparison features
Cited sources · 9
01 forbes.com
02 nerdwallet.com
03 g2.com
04 capterra.com
05 businessnewsdaily.com
06 pcmag.com
07 techrepublic.com
08 usnews.com
09 softwareadvice.com
What to do with them

Grounding queries are the keyword list Google is actually using

The real query set
Your buyer asked one thing. Google searched for six.

Those six searches decide which pages get retrieved and read. Optimising for the phrasing your buyer used is optimising for a query the retriever never ran.

The qualifiers
Watch which constraints survive the rewrite

Company size, price, integration, industry: whichever qualifier makes it into the grounding queries is the one Google thinks the answer depends on. That is your page structure, handed to you.

The citations
The cited domains are the current standings

Same prompt, same nine sites, week after week. If you are not one of them, that is the honest measure of the gap. If you are, that is worth defending.

The trend
One capture is a snapshot. Twelve weeks is a signal.

Queries drift as the index and the model change. A query that appears three weeks running is a topic arriving, and you have a head start on it.

Fan-out and grounding are not the same thing

Both engines decompose your question before searching. What they expose, how many searches they run, and how you get at them are all different.

ChatGPT fan-out
How you get itDrive a logged-in browser and read the search tool calls out of a private stream
Typical countTen to fifteen searches on a comparison prompt
Tell-tale shapesite: queries naming brands the model already trusts
StabilityUndocumented payload. It has changed before, quietly
Read the fan-out page
Google AI Mode grounding
How you get itA documented step on a grounded API response, if the model chose to search
Typical countTwo to eight, depending on how contested the answer is
Tell-tale shapePlain keyword searches, plus citations pinned to the answer text
StabilityDocumented, though the response shape has changed with the API before
You are on this page

Questions people actually ask

Are these literally the queries AI Mode runs?

Here is the honest version. The queries come from Gemini's grounding metadata, which is the same search-grounding machinery AI Mode is built on, run through the public API. It is the closest reproducible read anyone can get, and in practice the query sets look like what AI Mode produces. It is not a wiretap on google.com/aimode, and Moose will not claim it is. Treat it as a very good proxy, not a transcript.

Why did I only get two queries back?

Because the model decided two were enough. Narrow, local, or well-worn questions ground with one or two searches. Broad comparison questions, the kind buyers ask before they pick a vendor, routinely pull six or more. The count is itself a signal: a prompt that grounds heavily is a prompt where the answer is still contested.

Do the queries change if I run the same prompt again?

Yes, at the edges. The core searches are stable, the long tail moves, and the cited domains move faster than the queries do. That is why one capture is a snapshot and a run history is a signal. Same prompt, same day of the week, and watch what enters and leaves.

Can I capture grounding queries on the free plan?

Not this one. Grounding capture needs a direct grounded call to Google, and BYOK Free and BYOK both route through OpenRouter, which does not pass the grounding metadata through. It is a managed plan feature, same as ChatGPT fan-out capture. Everything else, including instant visibility checks across five real AI search engines, runs on the free plan.

Why is there no clean list of cited sources?

Because Google does not return one. Citations come back attached to spans of the answer text, each carrying a URL and a title that is usually just the domain. The clean list of nine is something you assemble by walking every annotation and deduping. Moose does that and shows you the domains, because the domain is the part you can act on.

Should I write a page per grounding query?

No. Six queries around one buying question usually want one strong page that answers all six, not six thin ones. The query set tells you what has to be on the page: the pricing, the size qualifier, the comparison, the independent review angle. Group by intent, then write once.

More things to ask Moose

All use cases
Runs on your machine

See the searches behind
the answer.

Download Hi, Moose, open a chat, and ask. Free to install, free to run local visibility checks, no meter.