liveBook · Manning

Document grounding

As explained in Effective Conversational AI

Document grounding is the practice of basing generated responses on identifiable source documents or passages relevant to the query.

Document grounding checks whether a RAG response can be traced to source documents or passages that are relevant to the user’s query. section 6.5.4

A practical grounding evaluation follows these steps:

  • Prepare representative user queries. section 6.5.4
  • Generate responses with the RAG model and identify their supporting documents or passages. section 6.5.4
  • Compare each source with its query, assessing relevance and coverage. section 6.5.4
  • Quantify performance with a grounding score, while using precision, recall, and F1 score for response relevance. section 6.5.4

A grounding check

For each generated answer, record the passages used, compare them with the query, and score how well they support the answer. Review low-scoring cases to find relevance or coverage failures. section 6.5.4

Table 6.6 Prioritized metrics for RAG evaluation based on business objectives
Business objective
Prioritized metrics
Why?
Example
Customer satisfaction
Response accuracy
Relevance
Directly impacts user experience and satisfaction
PharmaBot providing accurate answers to users’ queries
Operational efficiency
Latency
Throughput
Ensures the system can handle high query volumes quickly
A customer support chatbot for a large e-commerce platform should prioritize low latency to provide quick responses during peak shopping times.
Scalability
Queries processed per second
Resource utilization
Evaluates system performance under increasing loads
Chatbot for a healthcare provider managing seasonal spikes in appointments and queries
Cost-effectiveness
CPU usage
Memory usage
Ensures high performance without excessive resource consumption
Chatbot for a non-profit organization providing 24/7 mental health support on limited funding

Use response accuracy and relevance when grounding supports customer satisfaction; choose evaluation metrics according to the operational objective. section 6.5.4

How Effective Conversational AI covers it

How deep it goes
Defines query-to-source comparison and scoring through document relevance and coverage, without prescribing a single scoring formula.
Examples
Uses user queries, generated responses, expected responses, and identified source documents or passages as evaluation artifacts.
What you can do after
Evaluate RAG grounding by identifying supporting passages and scoring their relevance and coverage.
How it connects
Connects RAG with semantic similarity, informativeness, precision, recall, F1 score, and response relevance.

Related concepts

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