[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

Grounding with Google Search

🔍 Grounding & Vertex Search 12m 250 BASE XP⌨ HANDS-ON LAB

Real-Time Fact Checking

LLMs hallucinate, especially regarding recent events. Vertex AI allows you to instantly "Ground" Gemini's responses using Google Search.

from google.genai import Tool

# Enable Google Search Grounding
tool = Tool.from_google_search_retrieval()

response = model.generate_content(
    "What is the stock price of Alphabet today?",
    tools=[tool]
)

The response will include citations and links to the exact web pages it used to construct the factual answer.

⌨ HANDS-ON LABGround Gemini with Google Search
⭐ +150 XP

Your bot keeps hallucinating stock prices. Fix it from the terminal: call generateContent with the google_search tool attached and inspect the returned citations.

1Capture an access token in the TOKEN variable.
2POST to generateContent with "tools":[{"google_search":{}}] so Gemini can verify facts against live Search.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 2 — type "hint" if stuck
SYNAPSE VERIFICATION
QUERY 1 // 2
What does 'Grounding with Google Search' achieve?
It searches your local files
It reduces hallucinations by verifying facts against live Google Search results and providing citations
It improves the UI design of your app
It caches search history