Explainer
Grounding vs RAG, and where web search fits in
Grounding vs RAG in plain terms: grounding is the goal, RAG and web search are routes to it. What each costs, how each fails, and which your app needs.

Grounding is the goal: connecting a model’s answer to sources you can check. RAG is one way to get there, using documents you index; web grounding is another, using a live search the model vendor runs for you.
So the real decision isn’t “grounding or RAG”. It’s which source of truth your questions need, and who runs the retrieval: you, your model vendor, or a search API you call yourself. Below is what each route is, what it costs per 1,000 questions, how it fails, and which one I’d pick for each kind of app.
Short on time?
Short on time? Here's my pick by question type
- Answers live in your own documents
- RAG, on Gemini File Search or OpenAI file search
- Gemini File Search doesn't charge for storage or query embeddings. On OpenAI, file search is $2.50 per 1,000 calls.
- Questions about today's web, with citations
- The grounding tool of the model you already use
- Gemini's Google Search grounding: 5,000 free a month, then $14 per 1,000 queries. OpenAI or Claude web search: $10 per 1,000 plus tokens.
- Web results you need to keep or rerank
- A search API you call yourself, feeding your RAG step
- Brave at $5 per 1,000 for an independent index, or a SERP API such as apiserpent.com when you need Google's results.
- A corpus under about 200,000 tokens
- Skip RAG: put it in the prompt
- That's Anthropic's guidance for knowledge bases of roughly 500 pages or less.
- Regulated data
- RAG inside your own boundary
- Microsoft says Grounding with Bing Search data flows outside the Azure compliance and Geo boundary.
Prices verified . Sponsors cannot buy a verdict or a position.
This guide sits in my search API hub. It’s about which source of truth to ground on and who runs retrieval; whether one retrieval pass is enough or you need an agent that searches in a loop is a separate question, which I’ll cover in its own guide.
What’s the difference between grounding and RAG? #
Grounding names an outcome, and RAG names a method. Grounding means tying a model’s answer to sources you can check; RAG is one way to do it, retrieving passages from documents you index and adding them to the prompt. Web grounding is another way, where the model vendor runs a live search for you.
Google’s definition: “In generative AI, grounding is the ability to connect model output to verifiable sources of information.” (Google Cloud).
RAG is one way to do that. Microsoft calls it “a pattern that extends LLM capabilities by grounding responses in your proprietary content” (Microsoft). Notice the word “grounding” inside the definition of RAG: the two terms overlap by design.
Google makes the overlap explicit. Its list of grounding sources includes Google Search, Google Maps, Agent Search (which uses RAG), RAG Engine (“managed RAG service”), Elasticsearch, Web Grounding for Enterprise, Parallel web search, and “Your search API” (Google Cloud). Decagon, a vendor, puts it neatly: “All RAG implementations are forms of grounding, but grounding can be achieved through other means.” (Decagon).
Here’s how the terms line up, with who runs the retrieval in each case.
| Term | What it is | Who runs retrieval | Example |
|---|---|---|---|
| Grounding | The goal: answers tied to checkable sources | Anyone | Any of the rows below |
| RAG | Retrieve passages from a knowledge base, add them to the prompt, then generate | You, or a hosted RAG tool | Gemini File Search, OpenAI file search |
| Web grounding | The model writes queries, the vendor runs a web search, the answer comes back with citations | The model vendor | Gemini’s Google Search grounding, OpenAI or Claude web search |
| Search API plus your own RAG | You call a search API, fetch pages, and run the RAG step yourself | You | Brave or Perplexity Search feeding your pipeline |
| Document-grounded generation | The whole document goes into the context window | Nobody: there’s no retrieval | Pasting a contract into the prompt |
Sources: Google, Microsoft, Anthropic, J Pathol Clin Res.
That last row matters more than it looks. A 2025 letter in the Journal of Pathology: Clinical Research separates the two: document-grounded generation “is equivalent to inserting the entire document text into the context window”, while naive RAG passes only the “relevant parts” (Hewitt, Wiest, Kather).
Structured data is a fourth route the other pages raise. Alation’s guide focuses on grounding answers in governed, structured data such as SQL tables (Alation), and Google’s list includes Maps and Elasticsearch. If your question is “what’s this customer’s order status”, a direct lookup beats both RAG and web search.
How does RAG work, in plain terms? #
RAG gives the model a second memory it can look things up in. The 2020 paper that named it combined “the parametric memory”, a pre-trained model, with “the non-parametric memory”, which was “a dense vector index of Wikipedia, accessed with a pre-trained neural retriever” (Lewis et al.).
Anthropic’s plainer version: “RAG is a method that retrieves relevant information from a knowledge base and appends it to the user’s prompt” (Anthropic). You chunk your documents, embed them, search the index at question time, and paste the best chunks into the prompt.
Microsoft lists five hard parts, including understanding the query, keeping token counts down, and security. On that last one, its RAG overview is blunt: “Users and agents must only retrieve authorized content” (Microsoft). If different users may see different documents, your index has to enforce that.
You don’t have to build the index yourself. Two hosted tools do it for you:
-
Gemini File Search is the Gemini API’s managed RAG tool. It chunks (with configurable size and overlap), embeds and searches for you; storage and query-time embeddings are free, and indexing is billed at the Gemini Embedding rate of $0.15 per 1M tokens (Gemini Embedding 2 text is $0.20). Documents can be up to 100 MB, stores range from 1 GB (free tier) to 1 TB (tier 3), and Google suggests keeping a store under 20 GB for speed.
Answers carry
file_citationannotations, with page numbers for paginated files such as PDFs. Raw files are deleted after 48 hours; the embeddings have no expiry (File Search, pricing). -
OpenAI file search retrieves “in a knowledge base of previously uploaded files through semantic and keyword search”, using vector stores, and returns
file_citationannotations (OpenAI). It costs $2.50 per 1,000 calls, with storage at $0.10 per GB per day after the first free GB (OpenAI pricing). Its docs note that loweringmax_num_results“can help reduce both token usage and latency, but may come at the cost of reduced answer quality”.
If your corpus is web pages you collect yourself, my guide to web scraping for RAG covers crawling and chunking.
What does web grounding do differently? #
The vendor runs the retrieval, over the live web, on the vendor’s terms. Microsoft’s Foundry docs describe the steps: the agent formulates a query, the tool runs the search on Bing, the agent synthesizes an answer, and it cites its sources with URLs (Microsoft Foundry).
It’s RAG-shaped (retrieve, then generate), but you don’t own the index, the ranking or the bill’s structure. Here’s how the four big tools compare.
| Tool | Whose search | Citations you get back | Domain control | Price, verified 2026-11-16 |
|---|---|---|---|---|
| Gemini: Grounding with Google Search | url_citation annotations (URL, title, start and end index) plus search_suggestions HTML |
Not covered here | 5,000 free a month on Gemini 3+, then $14 per 1,000 executed queries; 1,500 a day cap | |
OpenAI web_search |
Not stated on the page I read | url_citation annotations, plus a sources list of every URL consulted |
Up to 100 allowed or blocked domains | $10 per 1,000 calls plus search content tokens |
| Claude web search | Not stated on the page I read | Citations always on, with cited_text of up to 150 characters |
Allowed or blocked domains, not both | $10 per 1,000 searches plus tokens |
| Microsoft Foundry: Web Search, Grounding with Bing Search, Bing Custom Search (preview) | Bing | Source attribution in the response | Not covered here | Grounding with Bing and Bing Custom Search: $14 per 1,000 transactions. Web Search: no per-query price on the pages I read |
Sources: Gemini docs, Gemini pricing, OpenAI, OpenAI pricing, Claude, Microsoft Foundry, Bing pricing.
A few details change how these behave in practice:
- The model decides whether to search. Gemini’s model decides whether to search and writes its own queries (Gemini). OpenAI’s
tool_choice: "auto"makes search optional too (OpenAI). - Queries multiply on Gemini. On Gemini 3+ your project “is billed for each search query that the model decides to execute”, so two searches for one prompt count as “two billable uses of the tool for that request” (Gemini). Gemini 2.5 is still billed per grounded prompt, at $35 per 1,000 after 1,500 free a day (pricing).
- OpenAI has a cache-only mode. Setting
external_web_access: falselimits search to cached content, and search context is capped at 128K (OpenAI). - Claude can filter results in code. On tool versions from 20260209, dynamic filtering runs code over the results before they reach the context (Claude). Results also count as input tokens in later turns, and failed searches aren’t billed.
- Microsoft recommends Web Search over Grounding with Bing Search; both are generally available, and Bing Custom Search is in preview (Microsoft Foundry). Bing’s pricing page lists 150 transactions a second and 1 million a day (Bing).
Microsoft’s recommended tool is the one without a public price on the pages I read, so if you’re on Foundry, ask before you budget. For Gemini’s version in depth, including its display terms, see my Google Search grounding guide.

Where does a search API fit? #
It’s the third route: you call a search API yourself, fetch the pages you need, and run your own RAG step over them. Google even lists “Your search API” as a grounding source (Google Cloud), which shows Google sees it as grounding too.
This route wins when the hosted tools’ terms get in the way. Microsoft’s Bing page says grounding “Outputs are not directly accessible for use in other applications or programs” (Bing). If you need to store results, rerank them, mix them with your own documents, or hand them to a local model, you want results you hold yourself.
Your main options, verified 2026-11-16:
- Perplexity Search API: ranked results “with titles, URLs, and extracted text; there is no generated answer”, at $5 per 1,000 requests or $1 with Fast Search (quickstart, pricing). If you’re moving off Sonar, my Perplexity API alternatives guide prices the replacements by job.
- Brave Search API: $5 per 1,000 with a $5 monthly credit, from Brave’s own index. Storing results or using them for training needs a custom plan (Brave), so check that before you build a cache.
- AWS AgentCore Web Search and Microsoft Web IQ: $7 per 1,000 queries each; Web IQ’s Browse is $1 per 1,000 (AWS, Web IQ).
- A SERP API, when you need Google’s own results. apiserpent.com returns Google, Bing, Yahoo, DuckDuckGo or Brave results as parsed JSON with titles, URLs and snippets, and its docs say nothing about returning the pages themselves, so you still fetch them (docs). It costs $0.60 per 1,000 at the Default rate (the first deposit is $10 minimum) and down to $0.03 after a $1,250 deposit, with purchased credit that never expires (checked 24 November 2026: pricing, FAQ). The catches: there’s “No public SLA” for pay-as-you-go accounts, its terms make you indemnify the vendor, and its pricing page now warns that prices may rise from December 2026, so recheck before you budget.
The trade is more work for more control: you write the fetching, chunking and prompting that the hosted tools do for you. My guide to LLM web search versus a search API walks through the total-cost method, and search vs fetch vs browser covers what to do once you have the links.
What does each route cost per 1,000 questions? #
Web grounding on current models costs $10 to $14 per 1,000 searches in tool fees; hosted RAG over your own files costs less per question; a search API you call yourself ranges from under $1 to $7 per 1,000, before fetching and tokens.
| Route | Unit price, verified 2026-11-16 | What’s extra |
|---|---|---|
| Gemini 3+ Google Search grounding | 5,000 free a month, then $14 per 1,000 executed queries; 1,500 a day cap | Model tokens |
| Gemini 2.5 grounding | 1,500 free a day, then $35 per 1,000 grounded prompts | Tokens |
OpenAI web_search |
$10 per 1,000 calls | Search content tokens and model tokens |
| Claude web search | $10 per 1,000 searches | Results billed as input tokens, also on later turns |
| Grounding with Bing Search (Foundry) | $14 per 1,000 transactions | Azure model usage |
| Foundry Web Search (Microsoft’s recommended tool) | No per-query price on the pages I read | Azure model usage |
| AWS AgentCore Web Search, Microsoft Web IQ Web | $7 per 1,000 | Your model |
| OpenAI file search (hosted RAG) | $2.50 per 1,000 calls | $0.10 per GB a day after 1 GB; tokens |
| Gemini File Search (hosted RAG) | No per-query fee; indexing at $0.15 per 1M embedding tokens | Retrieved tokens; storage free |
| Search API you call, then your own RAG | Perplexity Search $5 ($1 Fast), Brave $5, apiserpent.com $0.03 to $0.60 per 1,000 (checked 2026-11-24) | Page fetching (SERP APIs return snippets and links only); your model |
Sources: Gemini pricing, OpenAI pricing, Claude, Bing, Microsoft Foundry, AWS, Web IQ, Perplexity, Brave, apiserpent.com.
Here’s a worked example. The volumes are my assumptions, not measurements: 10,000 questions a month, one search or retrieval per question, tool fees only, before tokens.
- Gemini 3+: (10,000 − 5,000 free) × $14 ÷ 1,000 = $70. If the model runs two queries per question: (20,000 − 5,000) × $14 ÷ 1,000 = $210. That’s about 667 queries a day, under the 1,500 cap.
- OpenAI or Claude web search: 10,000 × $10 ÷ 1,000 = $100 each, plus tokens.
- Grounding with Bing Search: 10,000 × $14 ÷ 1,000 = $140.
- AgentCore or Web IQ: 10,000 × $7 ÷ 1,000 = $70.
- Brave, then your own RAG: 10,000 × $5 ÷ 1,000 = $50, minus the $5 monthly credit = $45. Perplexity Fast Search would be $10. apiserpent.com at its Default rate would be 10,000 × $0.60 ÷ 1,000 = $6, for snippets only, with fetching full pages on top and a Default cap of 10,000 calls a day.
- Hosted RAG on OpenAI: 10,000 × $2.50 ÷ 1,000 = $25, plus a 5 GB store at (5 − 1) × $0.10 × 30 = $12, so $37 plus tokens.
- Hosted RAG on Gemini File Search: no per-query fee. Indexing a 20-million-token corpus once costs 20 × $0.15 = $3.00, and storage is free.
That’s my calculation on list prices verified 2026-11-16. The pattern: answering from your own documents is cheap per question, while web grounding’s tool fee is the bigger line. A search API you call yourself is the cheapest web route on fees but moves the work, and the fetch costs, onto you.
How does each one fail? #
Differently, and that’s the most useful thing to know before you choose. RAG fails quietly inside your pipeline; web grounding fails inside someone else’s.
| RAG over your documents | Web grounding from the model vendor |
|---|---|
| Missing content answered anyway. The first of seven failure points in Barnett et al.: the answer isn’t in your corpus, and the model replies regardless | The model doesn’t search. Foundry’s troubleshooting lists “No citations in response” when “The model generated a response without using search results” |
| The right chunk ranks too low, or never makes it into the context | Queries multiply. On Gemini 3+ each executed query is billed |
| Stale index. It only knows what you last indexed | Your data leaves the boundary. For Grounding with Bing, the DPA doesn’t apply and data “flows outside the Azure compliance and Geo boundary” |
| Access control gaps. Users must only retrieve content they’re allowed to see | Reuse limits. Bing grounding outputs can’t be used in other applications |
| Can only be validated in operation, per Barnett et al. | Display duties. OpenAI says you “must show inline citations as prominent, clickable links” |
Sources: Barnett et al., Microsoft RAG, Microsoft Foundry, Gemini, Bing, OpenAI.
The Seven Failure Points study is worth reading whole. Its list runs from FP1 Missing Content and FP2 Missed the Top Ranked Documents through Not in Context, Not Extracted, Wrong Format and Incorrect Specificity to FP7 Incomplete. Its authors conclude that “validation of a RAG system is only feasible during operation” and that a RAG system’s robustness “evolves rather than designed in” (Barnett et al.).
On Microsoft’s data boundary, the exact wording matters for compliance teams: “The Microsoft Data Protection Addendum doesn’t apply to data sent to Grounding with Bing Search”, the tools “don’t respect VPN or private endpoints”, and “your data flows outside the Azure compliance and Geo boundary” (Microsoft Foundry). The same page’s comparison table says data from the recommended Web Search tool also flows outside the Azure compliance boundary. That’s why my pick for regulated data is RAG you run inside your own boundary.
Citations don’t prove much on either side. OpenAI’s sources field lists “the complete list of URLs the model consulted”, which is often longer than the citations (OpenAI). Fini, a vendor, sums it up: “A citation proves retrieval happened, not that the answer used it” (Fini).
Does retrieval help at all? On hard questions, yes. The FRAMES benchmark reports “0.40 accuracy with no retrieval” rising to “0.66 (>50% improvement)” with a multi-step retrieval pipeline, on multi-hop questions (Krishna et al.). And retrieval failures can be reduced: Anthropic reports its Contextual Retrieval cut top-20 retrieval failures from 5.7% to 1.9% with reranking, though those are its own numbers (Anthropic).
What I couldn’t find is any independent accuracy comparison of Google’s, OpenAI’s, Anthropic’s and Microsoft’s grounding tools. If you need to measure your own, Alation’s guide suggests metrics such as groundedness, context precision and citation accuracy (Alation).

Which one does your app need? #
Decide by where the answer lives: in your own documents (RAG), on the live web (web grounding or a search API), or both. Here’s what I’d pick for each kind of question, on the evidence above.
| Your questions are about | My pick | Why |
|---|---|---|
| Your own docs, tickets or policies | RAG: Gemini File Search, or OpenAI file search if you’re on OpenAI; your own index if you need per-user access control | Web search can’t see private content |
| A small corpus, under about 200,000 tokens | Put it all in the prompt | Anthropic’s guidance: below roughly 500 pages, skip retrieval |
| What’s true on the web today, with citations | The web grounding tool of the model you use: Gemini Google Search, or OpenAI or Claude web search | One call, citations built in |
| Web data you must store, rerank or feed a local model | A search API you call yourself (Brave for an independent index; a SERP API for Google’s results), then your own RAG | Hosted tools restrict reuse |
| Regulated data that must stay in your boundary | RAG inside your boundary; avoid Foundry’s Bing-backed web tools | Microsoft’s DPA and Geo boundary warning |
| Both private and live facts | RAG first, with web grounding as a fallback tool | Covers both sources of truth |
Sources: Anthropic, Microsoft RAG, Microsoft Foundry, Bing, Brave.
If you’re still choosing which search API to call, my guide to web search APIs compares them by job.
What I would do #
I’d start with the question log. If most questions are about our own documents, I’d ship RAG first, on whichever hosted file search matches the model we already use, and add web grounding only as a tool the model can call when the documents don’t have the answer.
If the questions are about the live web and I don’t need to keep anything, I’d use the grounding tool built into my model. If I need to store or rerank the results, I’d call a search API myself and feed my own RAG step.
FAQ
What is grounding in an LLM?
Grounding means connecting a model's answer to sources you can check. Google defines it as 'the ability to connect model output to verifiable sources of information'. RAG over your own documents and web search grounding are two ways to do it.
Is RAG a type of grounding?
Yes. Google defines grounding as connecting model output to verifiable sources and lists its managed RAG Engine as one grounding source. Microsoft describes RAG as 'grounding responses in your proprietary content'. Grounding is the goal; RAG is one technique for reaching it.
Does grounding stop hallucinations?
No. It gives the model sources to work from, but each route still fails in known ways: a RAG system can answer when the right content is missing, and a web grounding tool can answer without searching at all. A citation shows retrieval happened, not that the answer used it. I found no independent accuracy comparison across the big vendors' grounding tools.
Is Grounding with Google Search just RAG over the web?
It has the same shape: retrieve, then generate. The difference is who runs it. With Google Search grounding, the model decides whether to search and writes the queries, Google runs them on its own index, and on Gemini 3 and later you pay for each query executed.
When should I use a search API instead of a grounding tool?
When you need to keep, rerank or reuse the results, or feed them to a model the vendor doesn't host. Microsoft's Bing pricing page says grounding outputs 'are not directly accessible for use in other applications or programs'. A search API you call yourself returns results you can pass into your own RAG step, subject to that API's own terms: Brave, for example, needs a custom plan for storage.
Can I combine RAG and web grounding?
Yes. Google lists both Google Search and its RAG Engine as grounding sources, and nothing in the docs I read forces you to pick one. A common shape is RAG over your own documents first, with a web grounding tool the model can call when the answer isn't there.
What does web grounding cost per query?
Verified 2026-11-16: Gemini 3 and later get 5,000 free search queries a month, then $14 per 1,000 executed queries; OpenAI's web search is $10 per 1,000 calls plus search content tokens; Claude's is $10 per 1,000 searches plus tokens; Microsoft's Grounding with Bing Search is $14 per 1,000 transactions. I found no published per-query price for Microsoft's recommended Foundry Web Search tool.
Do I need a vector database for RAG?
Not necessarily. Hosted tools such as Gemini File Search and OpenAI file search handle chunking, embeddings and search for you. You'd run your own index when you need control, for example making sure users only retrieve content they're allowed to see. And if your whole corpus is under about 200,000 tokens, Anthropic suggests skipping retrieval and putting it in the prompt.
Sources
28 sources, accessed to .
Official pricing, docs, changelogs and status pages 21
- Google Cloud: grounding overview (Vertex AI)
- Microsoft: RAG in Azure AI Search
- Microsoft Foundry: web grounding tools overview
- Microsoft: Grounding with Bing Search pricing
- Gemini API: grounding with Google Search
- Gemini API pricing
- Gemini API: File Search
- OpenAI docs: web search tool
- OpenAI API pricing (tools)
- OpenAI docs: file search tool
- Anthropic: Claude web search tool
- Anthropic: Contextual Retrieval (Sep 19, 2024)
- Perplexity Search API quickstart
- Perplexity API pricing
- Brave Search API plans
- Amazon Bedrock AgentCore pricing
- Microsoft Web IQ
- apiserpent.com pricing
- apiserpent.com API docs
- apiserpent.com FAQ
- apiserpent.com terms (31 October 2026)
Independent benchmarks and published studies 4
- Lewis et al.: Retrieval-Augmented Generation for knowledge-intensive NLP tasks (2020)
- Krishna et al.: FRAMES benchmark for retrieval-augmented generation
- Barnett et al.: Seven failure points when engineering a RAG system (2024)
- Hewitt, Wiest, Kather: document-grounded generation vs RAG (J Pathol Clin Res, 2025)
Last updated: 16 November 2026. Researched and drafted with AI tools; human editorial review and publication approval are pending.



