In a retrieval-augmented generation (RAG) application, a knowledge base is a trusted source of external information, such as company documents. This differs from information a model learned during pretraining: RAG retrieves relevant knowledge-base content and adds it to the prompt. section 1.4.2 section 6.1.2
A RAG workflow prepares and uses the knowledge base in stages:
- Ingest documents, split them into chunks, and create embeddings that represent their meaning. section 1.4.2
- Store chunks and their embeddings in a vector database so relevant content can be retrieved by similarity. section 1.4.2
- Retrieve focused context for a question and add it to the prompt, rather than passing in entire large documents. section 1.4.2 section 6.1.2
Figure 1.9 A collection of documents is split into text chunks and transformed into vector-based embeddings. Both text chunks and related embeddings are then stored in a vector store.
Shows how documents become chunks and embeddings stored together in a vector store. section 1.4.2
Retrieving only relevant content can reduce token costs and improve speed and accuracy. Results still depend on finding useful context; adding loosely related material can be less effective than providing a smaller, focused selection. section 1.4.2 section 6.1.2










