AMAZON.QnAIntent - Amazon Lex

AMAZON.QnAIntent

Note

Before you can take advantage of the generative AI features, you must fulfill the following prerequisites

  1. Navigate to the Amazon Bedrock console and sign up for access to the Anthropic Claude model you intend to use (for more information, see Model access). For information about pricing for using Amazon Bedrock, see Amazon Bedrock pricing.

  2. Turn on the generative AI capabilities for your bot locale. To do so, follow the steps at Optimize bot creation and performance with generative AI.

Responds to customer questions by using an Amazon Bedrock FM to search and summarize FAQ responses. This intent is activated when an utterance is not classified into any of the other intents present in the bot. Note that this intent will not be activated for missed utterances when eliciting a slot value. Once recognized, the AMAZON.QnAIntent, uses the specified Amazon Bedrock model to search the configured knowledge base and respond to the customer question.

If the response from the FM is unsatisfactory or the call to the FM fails, Amazon Lex V2 then invokes the AMAZON.FallbackIntent.

Warning

You can't use the AMAZON.QnAIntent and the AMAZON.KendraSearchIntent in the same bot locale.

The following knowledge store options are available. You must have already created the knowledge store and indexed the documents within it.

If you select this intent, you configure the following fields and then select Add to add the intent.

  • Bedrock model – Choose the provider and foundation model to use for this intent. Currently, Anthropic Claude V2 and Anthropic Claude Instant are supported.

  • Knowledge store – Choose the source from which you want the model pull information from to answer customer questions. The following sources are available.

    • OpenSearch – Configure the following fields.

      • Domain endpoint – Provide the domain endpoint that you made for the domain or that was provided to you after domain creation.

      • Index name – Provide the index to search. For more information, see Indexing data in Amazon OpenSearch Service.

      • Choose how you want to return the response to the customer.

        • Exact response – When this option is enabled, the value in the Answer field is used as is for the bot response. The configured Amazon Bedrock foundation model is used to select the exact answer content as-is, without any content synthesis or summarization. Specify the name of the question and answer fields that were configured in the OpenSearch database.

        • Include fields – Returns an answer generated by the model using the fields you specify. Specify the name of up to five fields that were configured in the OpenSearch database. Use a semicolon (;) to separate fields.

    • Amazon Kendra – Configure the following fields.

      • Amazon Kendra index – Select the Amazon Kendra index that you want your bot to search.

      • Amazon Kendra filter – To create a filter, select this checkbox. For more information on the Amazon Kendra search filter JSON format, see Using document attributes to filter search results.

      • Exact response – To let your bot return the exact response returned by Amazon Kendra, select this checkbox. Otherwise, the Amazon Bedrock model you select generates a response based on the results.

        Note

        To use this feature, you must first add FAQ questions to your index by following the steps at Adding frequently asked questions (FAQs) to an index.

    • Amazon Bedrock knowledge base – If you choose this option, specify the ID of the knowledge base. You can find the ID by checking the details page of the knowledge base in the console, or by sending a GetKnowledgeBase request.

The responses from the QnAIntent will be stored into the request attributes as shown below:

  • x-amz-lex:qnA-search-response – The response from the QnAIntent to the question or utterance.

  • x-amz-lex:qnA-search-response-source – Points to the document or list of documents used to generate the response.