Grounding
Grounding means making an AI model base its answer on specific, trusted information supplied at request time, such as your documents, database records or search results, rather than on its training memory alone.
Also known as: Grounded generation, source grounding
How it works
The application finds relevant facts first and puts them in the model's context with an instruction to answer only from them. Sources can be:
- Passages from a document store, found through retrieval-augmented generation (RAG).
- Records from a database or API, such as an order status or account balance.
- Live web search results, which Google's Gemini API and other providers offer as a built-in grounding option.
Good grounded answers cite which source supports each claim, so a reader or a checking step can verify them. Some platforms return citation metadata alongside the text.
Why it matters
A model's training data is general, fixed at a cutoff date and knows nothing about your private policies. Grounding brings in current, company-specific facts and is the main practical defense against hallucination. It is not automatic, though. Answers can still drift from the source, and a good answer depends on retrieving the right passage in the first place. Measure two things separately: whether retrieval found the right sources, and whether the answer stayed faithful to them. Groundedness or faithfulness scores are standard metrics in evaluation tools for this reason. Grounding also helps with governance, since every answer can be traced to a document owner. Gepton builds grounded search in AI-powered search.
Grounding in depth
A grounded answer pipeline, step by step
- Understand the question: rewrite follow-ups into standalone queries ("what about for contractors?" becomes "leave policy for contractors"), and detect whether the question needs documents, live records or both.
- Retrieve with permissions: search only sources the user is allowed to see, using filters on metadata such as department, region and document status.
- Select and order: rerank candidates and keep the few passages that best support an answer; see reranking.
- Generate with constraints: instruct the model to answer only from the supplied sources, to cite them, and to say when the sources do not contain the answer.
- Verify: check that cited passages exist and support the claims, and that numbers in the answer appear in the sources.
- Present: show citations as links to the source document and section, so people can check.
Example: grounding on live records and documents together
Example: a hypothetical logistics company's internal assistant answers "Can we still deliver order 48213 by Friday under the express SLA?". The assistant calls the order system for the shipment's current status and location, retrieves the express service terms from the policy library, and asks the model to answer using only those two sources. The answer cites the tracking record and the clause from the terms. If the tracking API fails, the assistant says it cannot confirm the status rather than guessing from the policy alone. Numbers in the reply, such as dates, are checked against the API response in code before the answer is shown.
Measuring groundedness
| Stage | Metric | How |
|---|---|---|
| Retrieval | Context recall and precision | Labeled questions with known supporting passages |
| Generation | Faithfulness | Share of claims supported by the supplied context, often scored by an LLM judge and spot-checked by people |
| Citations | Citation accuracy | Do the cited passages actually support the sentence? |
| Abstention | Correct "I don't know" rate | Questions deliberately outside the sources |
Tools such as Ragas, DeepEval and TruLens include groundedness and faithfulness metrics. Some providers also offer citation features that return source spans with the answer.
Common mistakes
- Retrieving too many loosely related passages, which gives the model room to mix sources incorrectly.
- No abstention path, so the model fills gaps from training memory.
- Grounding on outdated documents because superseded versions were never removed from the index.
- Ignoring access control, so grounded answers quote documents the user should not see.
- Measuring only final answer quality, which hides whether problems come from retrieval or generation.
Related terms
Grounding is the goal; RAG is the most common way to achieve it, supported by embeddings, chunking and semantic search. It is the main defense against hallucination, and knowledge graphs can ground answers that depend on relationships. Try it in our document Q&A tool. We build grounded systems in AI-powered search and knowledge management agents.
Questions about Grounding
Something else? Send us your question and an engineer replies with next steps.
Is grounding the same as RAG?
They are closely related but not identical. Grounding is the property you want: answers based on specific, trusted sources supplied at request time. Retrieval-augmented generation is the most common technique for achieving it with documents, by searching an index and putting the results in the prompt. Grounding can also use live API data, database records or web search, none of which require a document index. So RAG is one way to ground a model, and a grounded system often combines RAG with other sources.
How do we keep grounded answers up to date when documents change?
Treat the document index as a living system. Connect it to the source systems so new and edited documents are re-indexed automatically, and deleted or superseded ones are removed. Store effective dates and status on each chunk so retrieval can prefer current versions. Assign owners to document collections who are responsible for accuracy. Monitor questions where the assistant could not find an answer, since they often point to missing or outdated content, and review a sample of answers after major policy changes.