Course menuAIP-C01

Exams / AIP-C01 / Document metadata and filtering for precise retrieval / Question 1

AIP-C01 practice question: Document metadata and filtering for precise retrieval

Foundation Model Integration, Data Management, and Compliance A free question from our original AIP-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 regional water utility keeps about 9,000 operating procedures in one knowledge base. Each procedure belongs to a department, such as billing, field operations or customer care, and has an effective date.

Staff ask questions in a chat tool that already knows their department. Answers must come only from procedures for that department that are in force on the date of the question, and staff must never see another department's procedures.

The team wants one knowledge base to manage, and the filtering must be applied before the top results are chosen, so that enough matching results are returned.

Which solution meets these requirements?

Choose one answer.

  1. A. Write the department name and effective date at the top of each document's text so the embeddings capture them, and rely on similarity to rank that department first.
  2. B. Add a .metadata.json sidecar file with department and effective date attributes beside each procedure, and pass a filter on those attributes in every retrieval request.
  3. C. Create one knowledge base for each department, and have the application choose the knowledge base that matches the user's department before each query, so that the data is separated by design.
  4. D. Store the department and date of each document in a DynamoDB table, retrieve the top results first, and then drop any result whose metadata does not match the user's department and date.
Show the answer and explanation

Answer: B

  • A. Wrong: Similarity scores do not enforce a hard rule, so procedures from other departments can still be returned. Dates written as text are also not compared reliably, so the access and date rules are not guaranteed.
  • B. Right: Sidecar metadata is stored with each document, and the query-time filter limits retrieval to matching attributes before the top results are chosen. One knowledge base stays in place, and the department rule is enforced by the query itself. Learn more: Include metadata in a data source to improve knowledge base query (opens in a new tab)
  • C. Wrong: Separate knowledge bases do isolate the data, but the team would sync, monitor and pay for nine thousand documents spread across many bases. The requirement for one knowledge base to manage is not met.
  • D. Wrong: Filtering after retrieval can leave too few results, because the top results may belong to other departments and are discarded. The requirement that filtering happen before the top results are chosen is not met.

Explanation

Sidecar metadata with department and effective date, combined with a retrieval filter, enforces both rules inside one knowledge base and before the top results are chosen. Text-only metadata is not a hard rule, separate knowledge bases add management overhead, and post-retrieval filtering can return too few results.

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 Document metadata and filtering for precise retrieval? The 5 full-length practice sets have 6 more Document metadata and filtering for precise retrieval questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets