Course menuAIF-C01

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.

Last verified against current AWS documentation ·How we write our questions

A city council's resident help assistant uses Amazon Bedrock Knowledge Bases over policy documents that were already chunked, embedded and stored in a vector index.

Put these steps in the order they happen when a resident asks a question, first step first.

Put these 5 steps in order.

  1. A. The resident's question is converted into a vector by an embedding model
  2. B. The foundation model generates an answer from the augmented prompt
  3. C. The most similar chunks are returned as context for the prompt
  4. D. The vector index is searched for chunks similar to the question's vector
  5. E. The retrieved chunk text is added to the prompt before generation
Show the answer and explanation

Correct order: A, D, C, E, B

  1. A. The resident's 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. The embedding model has to produce vectors that can be compared with the index.
  2. D. The vector index is searched for chunks similar to the question's vector Second: similarity search compares the question's vector with the document vectors in the index. It returns the chunks whose meaning is closest to the question.
  3. C. The most similar chunks are returned as context for the prompt Third: the chunks that matched the search are returned as the context that will ground the answer. Only the closest matches are passed on, not the whole document set.
  4. E. The retrieved chunk text is added to the prompt before generation Fourth: the user's prompt is augmented with the retrieved text, so the model answers from the council's documents. The model sees the question together with this supporting text.
  5. B. The foundation model generates an answer from the augmented prompt Fifth: generation happens last, once the prompt contains the retrieved context. The model then writes an answer grounded in the council's policy text.

Explanation

At query time a knowledge base embeds the question, searches the vector index for similar chunks, adds the retrieved text to the user's prompt, and has the foundation model generate the answer. Chunking and embedding happened earlier, when the documents were loaded.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on RAG, knowledge bases and vector stores? The 5 full-length practice sets have 20 more RAG, knowledge bases and vector stores questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets