liveBook · Manning

Knowledge base

As explained in Build an Advanced RAG Application (From Scratch)

A knowledge base is an organized repository of facts, documents, or other information intended to support retrieval and reasoning.

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

How Build an Advanced RAG Application (From Scratch) covers it

How deep it goes
Explains the RAG role and demonstrates embedding, normalization, indexing, retrieval, and prompting, without detailing storage maintenance.
Examples
Demonstrates a Paris hotel-review index queried for Eiffel Tower views and used to generate a cited recommendation.
What you can do after
Build a small semantic search knowledge base with SentenceTransformer embeddings, FAISS retrieval, and generated answers.
How it connects
Connects knowledge bases to query processing, document embeddings, retrieval systems, document retrievers, context, prompts, and decoder models.

Also explained in

Compare how 15 books explain knowledge base →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build an Advanced RAG Application (From Scratch). The section links point to the parts of the book it draws on.