Create AI Skills with Grounded by knowledge base Model connections

This is the next logical step after creating a Grounded by knowledge base Model connection. You would create an AI Skill and connect it to a Grounded Model connection from Amazon Bedrock.

A Pro Developer creates AI Skills so the Bot Creators can use these in their automations and save time and effort.

AI Skills are created by connecting to Model connections the Pro Developer has access to, and fine-tuning prompts by testing them with different foundational models to find the best response that addresses the business ask. These AI Skills are made available to developers for use and reuse to help accelerate creating automations across solutions.

Prerequisites

A Pro Developer requires these roles and permissions to create and test AI Skills.
  • Role: AAE_Basic, Pro Developer Custom role
  • Permission: Bot Creator

See Roles and permissions for AI Tools

Other requirements:

Besides the roles and permissions the Pro Developer must be connected to a Bot Agent 22.60.10 and later. As part of testing the Model connection, you would have to run the bot on your desktop. Hence ensure the Bot Agent is configured to your user. If you have to switch connection to a different Control Room, see: Switch device registration between Control Room instances.

Procedure

  1. Log in to the Control Room and navigate to Automation > Create new or ‘+’ icon and choose AI Skills.
  2. Provide a name and description and click Create & edit to display a template outline.
  3. In the AI Skills screen, click Choose model connection to choose from the available list of Model connections you have access to. You would choose the Grounded by knowledge base Model connection from Amazon Bedrock.
    These Model connections are created by the Automation Admin and assigned to your user with a custom role.
  4. After selecting a Model connection, the AI Skills is set up with the default parameter settings that is optimal for the chosen model. You can change the settings as required.
    The AI Skill editor displays with default parameter values set by the model vendor which you can configure as required. These values can be configured when creating a Knowledge Base in Amazon Bedrock.

    The parameter values for creating a Prompt is populated based on the selected foundational model.

    For details of parameter settings for the supported foundational models, see Understanding parameter settings for supported foundational models.

    Note: You can set different parameter values to test and determine the values that are best suited for your use case. Changing the parameter values will influence the model response.
  5. Next, add a filter condition. This is an optional field that supports a JSON format for entering the filter value. For steps on creating a search filter in this format, see: How to generate a JSON Filter for Amazon Bedrock
    Adding a filter helps narrow down the model's search to the specific content segment within a large document in the Amazon Knowledge Base.
  6. Now you can start creating an AI Skill and add prompt inputs, as required. Let us use an example to walk you through the steps.
  7. In the Prompt field enter your Prompt text with the input variables.
    What is the gift tax limit for the year 2024?

    Prior to this step, you would have uploaded tax rule PDF documents for the last 3 years along with their metadata files in the Amazon S3 bucket such as: tax_rules_2022.pdf, tax_rules_2023.pdf, tax_rules_2024.pdf, tax_rules_2022.pdf.metadata.json, tax_rules_2023.metadata.json.pdf, and tax_rules_2024.pdf.metadata.json.

    Each metadata.json file has a metadataAttribute by the name Year with values such as 2022, 2023, and 2024 for each metadata file.

    The response for the Prompt text should be referenced from the tax_rules_2024.pdf document that can be made possible by adding the 2024 Year filter. This filter will narrow down the search to the matching tax_rules_2024.pdf file.

  8. Click out of the Prompt entry field.
    You can optionally add a Prompt Input by clicking Add prompt input.
  9. Click Get response to get a response from the model.
    Note: Prompt data details could contain PHI, PII or other sensitive data you choose to enter in the Prompt. We recommend being mindful of this when testing and executing a Prompt.
  10. Based on your provided filter condition, the Grounded model returns a response in the Response field, and additionally displays a Citations field displaying all citation references.

    Citations are chunks of information stating, which section of a document stored in the Amazon Knowledge Base, the response is referenced from. When you click a citation, you can see the chunk of information under the Content section, in addition to the URI which is a URL to the document where it is stored in the Amazon Knowledge Base.

    Note: The number of citation responses returned by the model call can be configured by updating the Document retrieval count parameter for that Model connection. The response returns citations based on the number value you add for the Document retrieval count parameter.

    Optionally, you can add a filter JSON to query specific data matching the metadata. This helps narrow down the search to the relevant context with accuracy.

Next steps

Your next step would be to check-in the AI Skill to make it available to Citizen Developers using the AI Skills package.

Why would you check-in an AI Skill?

After creating an AI Skill, check it into the Public folder. This will let the Pro Developer, and Citizen Developer use it from the AI Skills package in the production environment.

A Task Bot, with one or multiple embedded AI Skills can be added to a larger automation that would run a complete workflow scenario. You would create such a workflow in a Process Composer.

Note: When you create or test an AI Skill in the AI Skill screen, the success or failure details along with the model responses can be viewed in these navigation screens:
  • Administration > AI governance > AI Prompt log
  • Administration > AI governance > Event log
  • Administration > Audit log

See AI governance.

As the next step in your sequence of tasks, go to Use AI Skills in a Task Bot and use the AI Skill in an automation.