AIP-C01 practice question: Query expansion, decomposition and rewriting
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.
A travel company's assistant answers questions from its fare rules, baggage policy and pet travel documents, all stored in one knowledge base.
A customer asks: compare the cancellation terms and the baggage allowance for the Lisbon fare, and tell me whether my dog can ride in the cabin. The assistant returns a long answer that covers only the cancellation terms, because a single search for the whole question ranks those passages highest.
The team wants every part of a multi-part question answered from the right passages, with the answer still grounded in the retrieved text.
Which TWO approaches meet these requirements? (Choose two.)
Choose two answers.
AA. Retrieve the top 100 passages for the full question in one search, and send all of them to a larger generation model, which can sort out which passages answer each part.
BB. Ask the customer to send each part of the question in a separate message, and answer each message with its own search, so the assistant never needs to split a question.
CC. Turn on query decomposition in the knowledge base's RetrieveAndGenerate settings, so that the question is split into sub-queries that are each retrieved before the answer is written.
DD. Convert the question into a SQL query and run it against a structured data knowledge base connected to Amazon Redshift, so that each policy is looked up as a table row.
EE. Build an agent on AgentCore Runtime with a knowledge base search tool, and let the agent call the tool once for each part of the question before it writes the answer.
Show the answer and explanation
Answers: C, E
A. Wrong: The right passages may still be ranked below the cancellation text, and a larger model cannot read passages that were never retrieved. The requirement for per-part retrieval is not met.
B. Wrong: This works, but it moves the splitting work to the customer and changes the product experience. The requirement is for the assistant to answer multi-part questions by itself.
E. Right: The agent decides the parts, calls the search tool separately for each, and answers only from the returned passages. Each part gets its own retrieval, which meets both the completeness and grounding requirements. Learn more: Overview of Amazon Bedrock AgentCore (opens in a new tab)
Explanation
Both correct approaches split the question into parts and retrieve for each part, so the baggage and pet passages are not crowded out. Query decomposition does the splitting inside the knowledge base request, while the agent chooses its own searches, and both answer from the retrieved text. A single large search, a structured knowledge base over free text and pushing the work to the customer each fail a requirement.
Want more on Query expansion, decomposition and rewriting? The 5 full-length practice sets have 6 more Query expansion, decomposition and rewriting questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →