Exams / AIF-C01 / RAG, knowledge bases and vector stores / Question 1
AIF-C01 practice question: RAG, knowledge bases and vector stores (1 of 4)
Applications of Foundation Models A free question from our original AIF-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.
A council has built a residents' help assistant with Amazon Bedrock Knowledge Bases. Its documents have already been chunked, embedded and stored in a vector index. Put these steps in the order they happen when a resident asks a question.
Put these 5 steps in order.
- AA. The question is converted into a vector by an embedding model
- BB. The foundation model generates an answer from the augmented prompt
- CC. The most relevant chunks are returned as context
- DD. The vector index is searched for chunks similar to the question
- EE. The user's prompt is augmented with the retrieved chunks
Show the answer and explanation
Correct order: A, D, C, E, B
- A. The question is converted into a vector by an embedding model First: the question must become a vector before it can be compared with the stored chunk vectors.
- D. The vector index is searched for chunks similar to the question Second: similarity search compares the question vector with the document vectors.
- C. The most relevant chunks are returned as context Third: the chunks that matched the search are retrieved for use in the prompt.
- E. The user's prompt is augmented with the retrieved chunks Fourth: the retrieved text is added to the prompt so the model can ground its answer in it.
- B. The foundation model generates an answer from the augmented prompt Fifth: generation happens last, once the prompt contains the retrieved context.
Explanation
At query time, RAG works in this order: embed the question, search the vector index for semantically similar chunks, retrieve them, add them to the prompt, and send the augmented prompt to the model. This is why RAG answers can cite sources and stay current without retraining the model.
Study
Keep practising
Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.