CertKeen

Databricks Generative AI Engineer Associate · Free practice question 6 of 12

Fitting retrieved context in the window

Hartwell Pottery's RAG app retrieves 40 chunks per question, and requests now fail because the prompt exceeds the LLM's context window. What is the most direct fix?

  1. A.Increase the embedding dimension of the index
  2. B.Remove the system prompt entirely
  3. C.Retrieve fewer, more relevant chunks, for example by lowering k or reranking
  4. D.Add more chunks so the model has a complete picture
Show answer and explanation

Correct answer: C. Retrieve fewer, more relevant chunks, for example by lowering k or reranking

Why: The prompt is too large because too much context is included; retrieving fewer chunks, or reranking and keeping only the best ones, brings the prompt within the window and often improves focus. Embedding dimension does not affect prompt length. Dropping the system prompt removes needed instructions, and adding chunks makes the overflow worse.

More free Databricks Generative AI Engineer Associate questions