Prompt augmentation adds information found through retrieval to a prompt, giving an LLM relevant knowledge or memory as context. Retrieval searches external sources; augmentation supplies the results to the model. This lets an agent draw on stores larger than its context window while keeping each call within that window’s limit. section 6.1
In retrieval-augmented generation, augmentation follows a two-phase flow:
- Ingestion: load documents, split them into chunks, embed them, and store them for search. section 6.1.1
- Retrieval: search for chunks related to a user query, then add the matches to the prompt as context. section 6.1.1
A grounded answer
For “capital of France,” retrieval finds the matching text “capital of France is Paris.” Adding that text to the prompt gives the LLM context for its answer. section 6.1.1
Figure 6.2 RAG can be broken into two phases: ingestion and retrieval. First, documents are loaded, transformed, embedded, and stored in a searchable datastore. Second, they can be retrieved using query mechanisms as part of context augmentation.
Follow the document path from ingestion and storage to retrieval and prompt context. section 6.1.1
