Course menuAIP-C01

Exams / AIP-C01 / Exposing retrieval to models as tools (function calling, MCP) / Question 1

AIP-C01 practice question: Exposing retrieval to models as tools (function calling, MCP)

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 home goods retailer offers a shopping assistant that answers questions about return policies, shipping rules and warranties from its knowledge base.

Most customer messages are chitchat, order status requests or product questions that need no policy text. Searching the knowledge base on every message adds latency and cost, and it sometimes puts unrelated passages into the prompt.

The assistant should search only when a policy answer is needed, and the search must run through the same model call that decides the reply.

Which design meets these requirements?

Choose one answer.

  1. A. Run a knowledge base search on every user message, and always prepend the top 10 passages to the prompt, so that the model has policy context ready for any question.
  2. B. Paste the full text of all policy pages into the system prompt of every request, so that the model never needs to search and always sees the complete policies.
  3. C. Declare a search_policies tool in the Converse request, and let the model call it only when a policy answer is needed, with the application running the search.
  4. D. Fine-tune a model on the policy pages so that it memorizes the rules, and remove the knowledge base entirely, since the model will then answer policy questions without any search.
Show the answer and explanation

Answer: C

  • A. Wrong: Searching on every message is the behavior the team wants to stop, because it adds latency and cost to chitchat and order requests. Unrelated passages would still reach the prompt, so this option misses the requirement.
  • B. Wrong: The complete policy text is large, so every request would pay for those tokens, including the chitchat ones. This adds the cost and latency the team is trying to remove.
  • C. Right: Tool use lets the model decide per message whether to call the search, and the application runs the retrieval and returns results in the same conversation. Chitchat and order requests never trigger a search, which meets every requirement. Learn more: Call a tool with the Converse API (opens in a new tab)
  • D. Wrong: Fine-tuning does not reliably memorize policy wording, and policies change, so answers would drift from the current rules. Removing retrieval also loses the citations and freshness the assistant needs.

Explanation

Tool use lets the model call the policy search only when a message needs a policy answer, so most messages skip retrieval. The application runs the search and returns the results in the same conversation. Searching every time, putting all policies in the prompt and fine-tuning each add cost, drift or lost grounding.

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 Exposing retrieval to models as tools (function calling, MCP)? The 5 full-length practice sets have 5 more Exposing retrieval to models as tools (function calling, MCP) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets