Embeddings and document prep for RAG: MLA-C02 study notes and practice questions
What to know about Embeddings and document prep for RAG for the MLA-C02 exam, from the Data Preparation for ML and AI domain (28% of the exam guide), then 2 free questions to test it. Part of the MLA-C02 study guide.
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.
A logistics broker is building a Bedrock knowledge base over PDF rate sheets. Each sheet holds tables of lane rates, fuel surcharges and accessorial fees, with a header row that repeats across pages.
When the knowledge base uses default fixed-size chunking on plain text extraction, answers quote rates from the wrong lane because a table row is split across two chunks. The fix must keep each table row intact and must not require the broker to convert the PDFs by hand.
Which change meets these requirements?
Choose one answer.
AA. Increase the chunk size so that most rate sheets fit into one chunk, and keep plain text extraction.
BB. Export every rate sheet to a spreadsheet by hand each month, and upload the spreadsheets to the data source in place of the PDFs.
CC. Choose a parsing option that understands tables in PDFs, such as Bedrock Data Automation or a foundation model parser, and chunk the parsed output.
DD. Switch the vector store from Amazon OpenSearch Serverless to Amazon Aurora PostgreSQL with pgvector, and keep the same parsing and chunking settings.
Show the answer and explanation
Answer: C
A. Wrong: Large chunks can hold a whole sheet, but retrieval then returns too much text for the model and dilutes the relevant lane. The stem asks to keep table rows intact in a retrievable form.
B. Wrong: This would handle tables, but manual conversion each month conflicts with the requirement. The team would also lose the source PDFs as the authoritative documents.
C. Right: Correct. The default parser extracts only plain text, while Bedrock Data Automation and foundation model parsers extract tables with their structure before chunking. The broker keeps the original PDFs and needs no manual conversion. Learn more: Parsing options for your data source (opens in a new tab)
D. Wrong: The vector store stores embeddings and does not decide how a PDF table is split into chunks. Changing it does not address the split row.
Explanation
The rows are split because the default parser flattens the PDF tables into plain text before chunking. A parsing option that understands tables, such as Bedrock Data Automation or a foundation model parser, preserves the table structure, and chunking then works on structured content. Larger chunks, manual spreadsheets and a different vector store do not change how the tables are parsed.
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 →