promptgarten ๐ŸŒฑ
๐ŸŒ ES
Conceptโ—โ—โ—‹4 min ยท +40 XP

Web Search and Grounding: Letting Agents Fetch Current Facts

Grounding means tying a model's answer to something it can point to right now - like a live search result - instead of relying purely on what it memorized during training.

What grounding means

A model's training data has a cutoff and gets fuzzy on details it saw rarely. Grounding fixes that by connecting an answer to an external, checkable source - typically a live web search - instead of letting the model reconstruct facts purely from memory. The model still writes the answer, but while looking at retrieved text.

Where citations come from

When an agent runs a web_search call, it gets back snippets of real pages. A well-built grounded answer points back to those snippets - so if it says "version 5.2 shipped in June," you can check that against the actual source instead of trusting the model's word.

When it genuinely helps

Anything that changes after the training cutoff: library versions, today's prices, a company's latest terms, breaking news. Also niche facts the model saw too rarely to remember reliably - grounding turns "the model's best guess" into "the model's best guess, checked against a source."

When it hurts

Web search adds latency - a round trip before the model can even start answering. It costs money per search call, on top of tokens. And it opens a door: any page the agent reads can carry hidden instructions meant for the model, not you (prompt injection). A stable, well-known fact rarely needs a search - it just adds cost and risk for no gain.

EXAMPLE

Question: "What's the current pricing for Claude's web search tool?" Without grounding (from training memory): "I believe it's around $10 per 1,000 searches, but check current pricing since I may be out of date." With grounding (web search enabled): Model issues query -> gets back a snippet from platform.claude.com -> answers: "Web search costs $10 per 1,000 searches, plus standard token costs for the retrieved content. [Source: platform.claude.com/docs/.../web-search-tool]" Config snippet limiting exposure: { "tools": [{ "type": "web_search_20250305", "name": "web_search", "max_uses": 3, "allowed_domains": ["platform.claude.com", "docs.anthropic.com"] }] } Quick decision table: | Question type | Grounding? | |---|---| | "What year was Python created?" | No - stable fact | | "What's the latest version of React?" | Yes - changes often | | "Summarize this PDF I uploaded" | No - already in context | | "What did our competitor announce this week?" | Yes - needs current web data |

๐Ÿ› ๏ธ EXERCISE โ€” TRY IT YOURSELF

Test the difference between an ungrounded and a grounded answer on a question where facts change over time.

  1. Pick a question whose answer changes over time (e.g. "what's the latest stable version of Node.js").
  2. Ask a model with no web/tool access and note whether it flags the answer as possibly outdated.
  3. Ask the same question with web search enabled and compare the answer plus its citation.
  4. Click through the citation and check whether the source page actually supports the claim.
  5. Note which parts of the grounded answer came directly from the source vs. were the model's own phrasing.

โœ… SELF-CHECK

  • โ˜ Did the ungrounded answer explicitly warn you it might be outdated, or state it with false confidence?
  • โ˜ Did the citation in the grounded answer actually support the specific claim it was attached to?

QUICK QUIZ

Why doesn't a citation next to a grounded answer guarantee the claim is correct?

Share:๐•in๐Ÿ’ฌ

SOURCES

RELATED TOPICS

RAG (Retrieval-Augmented Generation) โ—โ—โ—‹Prompt injection โ—โ—โ—Context strategies for agents โ—โ—โ—Hallucination: Why AI Confidently Lies โ—โ—‹โ—‹