liveBook · Manning

Grounding

As explained in Context Engineering

Grounding is the practice of supplying a model with evidence that supports or constrains its generated response.

Grounding supplies an LLM with evidence to support or constrain its response. A grounded factual claim is supported by material placed in the context window, so it can be traced to a source rather than resting on parametric memory. Grounding does not guarantee truth or establish that the source itself is reliable. section 3.1

External knowledge can come from documents, incident logs, structured repositories, or curated collections. The system must select appropriate information and insert it into the working context when needed. In retrieval-augmented generation (RAG), it retrieves relevant passages at query time; agentic RAG can add query reformulation, tool selection, and iteration over results. section 3.1 section 3.2

Figure 3.1 RAG architecture: the indexing pipeline converts data into vector embeddings, while the generation pipeline matches the query against those embeddings and passes the corresponding text chunks to the LLM
rag v11

The architecture separates offline indexing from query-time retrieval and generation: external data is indexed ahead of time, while matching text chunks enter the LLM context for a request. section 3.2

Grounding code review comments

A code review system can assess whether generated comments are supported by the actual diffs. HalluJudge illustrates this approach with reference-free detection. section 12.2.2

Evidence can fail to reach or govern the answer: retrieval may miss a source, reranking may select the wrong chunk, or the generator may ignore evidence. Source freshness and authority, permission filters, and prompt assembly also affect reliability. Grounding is one defense against hallucination, not a complete solution; faithfulness metrics and traces help check whether answers are supported by the supplied context. section 12.2.2 section 1.3.1 section 3.2

How Context Engineering covers it

How deep it goes
Explains context selection and retrieval flow, then identifies failure points from retrieval through generation.
Examples
Illustrates grounding with code review comments assessed against diffs and specifications structured for machine verification.
What you can do after
Evaluate whether generated claims are supported by supplied context using faithfulness metrics and traces.
How it connects
Connects grounding to retrieval-augmented generation, agentic RAG, hallucination, and faithfulness metrics.

Also explained in

Compare how 13 books explain grounding →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Context Engineering. The section links point to the parts of the book it draws on.