MLA-C02 practice question: Embeddings and document prep for RAG (1 of 2)
Data Preparation for ML and AI A free question from our original MLA-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.
A dental chain has built an Amazon Bedrock knowledge base over its insurance-plan documents, covering several plan types. Patients ask questions such as what a crown costs under the Gold plan, and the assistant sometimes quotes text from the Silver plan.
The fix must restrict retrieval to documents for the patient's own plan without editing the documents. The application already knows each patient's plan and can pass it with every query.
Which change meets these requirements?
Choose one answer.
AA. Lower the chunk size from 300 tokens to 100 tokens so that each chunk contains only one benefit description.
BB. Add a metadata file next to each plan document with the plan type as an attribute, and pass a filter on that attribute with each retrieval request.
CC. Create a separate knowledge base for each plan type, and have the application route each question to the knowledge base that matches the patient's plan.
DD. Ask the foundation model in the prompt to ignore any plan other than the patient's, and rely on it to follow that rule.
Show the answer and explanation
Answer: B
A. Wrong: Smaller chunks may split benefits more finely, but they do not stop Silver text from being retrieved for a Gold patient. The retrieval still searches all plans.
C. Wrong: Separate knowledge bases can restrict retrieval, but the team would run several data sources and sync jobs and maintain routing logic for each plan. Metadata filtering achieves the same restriction within one knowledge base.
D. Wrong: A prompt instruction is not a retrieval control, and the model can still be given the Silver text. The stem asks for a change that restricts what is retrieved.
Explanation
Metadata files give each document attributes such as plan type, and a retrieval filter on that attribute makes each query search only the matching plan. Chunk size does not restrict which plan is searched. Separate knowledge bases add sync jobs and routing to maintain, and prompt instructions rely on the model instead of restricting retrieval.
Want more on Embeddings and document prep for RAG? The 5 full-length practice sets have 8 more Embeddings and document prep for RAG questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →