New1 billion tokens free on sign-up — crawl, parse, chunk and embed on the houseSee pricing
SarvCrawlSarvCrawl

Glossary · AI and LLM dataUpdated

What is LLM grounding?

LLM grounding is the practice of making a language model answer from specific source material supplied at query time, such as retrieved documents or web pages, rather than from its training data alone, so each claim can be traced to and checked against a cited source.

01What grounding isof 06

What grounding is

A language model answers from patterns learned in training. It has no record of where a fact came from, it does not know anything newer than its cutoff, and it does not know your internal documents. Asked anyway, it can produce a fluent answer that is wrong.

Grounding changes the question. Instead of what do you know about X, the model is asked what do these passages say about X. The passages come from a retrieval step, a search of a knowledge base or the web, and each one carries its source. Retrieval-augmented generation is the most common way to ground a model.

How it works

  1. Retrieve passages relevant to the question, each with its URL or document reference.
  2. Put them in the prompt, numbered, with the source next to each.
  3. Instruct the model to answer only from those passages, cite the number for each claim, and say so when the passages do not contain the answer.
  4. Render the citations as links, so a reader can check the claim against the source.
Answer using only the sources below. Cite each claim as [n].
If the sources do not answer the question, say you do not know.

[1] https://docs.example.com/limits
Each API key allows 10 requests per second.

[2] https://docs.example.com/errors
A 429 response includes a Retry-After header.

Question: What happens if I exceed the rate limit?

What grounding does and does not fix

Grounding makes answers checkable and lets them reflect current or private material. It does not guarantee they are correct. A model can still misread a passage, merge two sources into a claim neither makes, or attach a citation to a sentence the source does not support.

The bigger risk is upstream. If retrieval returns the wrong passages, the model is grounded in the wrong material and answers confidently from it. Most grounding problems are retrieval problems, which is why hybrid search and reranking matter.

Common mistakes

  • Passages without sources. If the URL is not in the prompt, the model cannot cite it.
  • No permission to refuse. Without an explicit way out, the model fills gaps from training data and the answer looks grounded when it is not.
  • All passages from one page. One source cannot be cross-checked. Retrieve from several.
  • Too much context. Twenty passages dilute the relevant one and cost tokens. A handful of good ones works better.
  • Never checking citations. Spot-check that cited passages actually support the sentence.

How SarvCrawl handles it

SarvCrawl provides the retrieval half of grounding and leaves generation to your model. Crawl, scrape, web search or upload material into a knowledge base, then query it. Smart search (POST /api/kb/:id/search/smart) returns ranked chunks, each with its source_url, for your own LLM to answer from and cite. It does not generate an answer itself.

curl -s -X POST https://crawl.sarv.com/api/kb/$KB_ID/search/smart \
  -H "x-api-key: $KB_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":"What happens if I exceed the rate limit?","size":5}'
# ranked chunks, each with source_url, to number and cite in your prompt

Hybrid search (GET /api/kb/:id/search/embed) sets low_confidence when nothing matched on keywords and similarity is low, which is a signal to have your model decline. Knowledge-base search is on paid plans. The full pipeline is in build a RAG knowledge base from a documentation site.

Frequently asked questions

Is grounding the same as RAG?

Grounding is the goal, answers tied to supplied sources. RAG is the most common way to reach it: retrieve passages, put them in the prompt, generate from them.

Does grounding stop hallucinations?

It reduces them and makes them easier to catch, because claims can be checked against cited sources. A model can still misread or misattribute a passage, and bad retrieval produces confidently wrong grounded answers.

How should citations be formatted?

Number each passage in the prompt with its source URL, ask the model to cite numbers inline, and turn the numbers into links in the interface. Keep the source next to the text so the model cannot confuse which passage said what.

What should happen when the sources do not answer the question?

The model should say so. Tell it explicitly that "I do not know" is an acceptable answer, and add a retrieval-side confidence check so weak matches are flagged before generation.

SarvCrawl

Turn any site into a searchable knowledge base

Crawl pages and parse documents into clean markdown, then chunk, embed and search them from one API.