A knowledge base is an organized store of information that a retrieval-augmented generation (RAG) system searches before generating an answer. It connects query processing, document embeddings, retrieval, context assembly, prompting, and decoding, allowing responses to use domain-specific or changing information rather than relying only on model training. section 6.1
A practical knowledge base can begin as filtered documents or records. Encode the records with a sentence-transformer model, normalize the vectors, place them in a FAISS inner-product index, and retrieve the highest-scoring passages for a query. The retrieved records then become model context for answer generation. section 6.1
Hotel-review knowledge base
Filter a hotel dataset to Paris, collect review text, and index its embeddings. A query such as “Hotels with a view of the Eiffel Tower” retrieves highly similar reviews, including results for Pullman Paris Eiffel Tower Hotel. Pass those results to a language model through a prompt that requests a cited answer. section 6.1
Figure 6.1 Architecture of a Retrieval Augmented Generation (RAG) system showcasing the integration of retrieval and generative components for enhanced natural language processing tasks.
Use the architecture diagram to trace how the knowledge base supplies retrieved context to the generative component. section 6.1














