GapView: Assessing Knowledge-Base Readiness for RAG
Skip to main content
eScholarship
Open Access Publications from the University of California

UC Irvine

UC Irvine Electronic Theses and Dissertations bannerUC Irvine

GapView: Assessing Knowledge-Base Readiness for RAG

Abstract

Retrieval-Augmented Generation (RAG) has emerged as a powerful approach for grounding large language models (LLMs) in external sources of evidence. In a RAG pipeline, documents are embedded and stored in a knowledge base, which a retriever searches to supply relevant context for generation. While prior work has focused on evaluating retrieval quality or generation accuracy, these methods overlook a fundamental question: does the knowledge base itself contain the information needed to answer the intended questions? This dissertation addresses this gap by introducing a framework for systematically measuring knowledge-base sufficiency in RAG systems. The dissertation begins by comparing different embedding models for ICD-10-CM medical coding, showing that general-purpose embeddings such as text-embedding-3-large outperform clinically specialized models in retrieval accuracy. It then presents a conversational RAG assistant for congenital diaphragmatic hernia (CDH) that integrates curated journal articles and clinician-sourced questions to generate evidence-based recommendations with strict citation requirements. Experiments show that expanding the knowledge base improves both completeness and clinical utility, illustrating how knowledge sufficiency directly affects RAG reliability. However, evaluating sufficiency remains challenging because existing benchmarks often overlap with LLM pre-training corpora. To enable fair testing, this dissertation then introduces a synthetic data generation process that produces fictional, surreal documents and paired questions, creating a controlled setting where retrieval performance can be evaluated without contamination from pre-training data. Building on these studies, this work introduces GapView, a framework for evaluating the adequacy of knowledge bases in retrieval-augmented generation (RAG) systems. The core idea is to assess the knowledge base itself—before retrieval—to determine what information is present and what is missing. During development, we found a moderate to strong correlation between human judgments of answer correctness and the cosine similarity between questions and documents. Leveraging this insight, GapView uses cosine similarity to approximate human evaluations and visualizes results through polar and one-dimensional ranked plots, offering an interpretable view of knowledge coverage and deficiency. Evaluations across six synthetic datasets spanning programming and medical domains demonstrate GapView’s ability to reveal missing information and provide a clearer understanding of knowledge-base readiness in RAG systems.