Skip to content

How to Personalize Bedrock Agent Chat Using User Email ID and Action Group

0

I'm in the process of creating a Bedrock agent and I want to personalize the chat experience for users. Specifically, I want to include the email ID of the logged-in user in the context before the chat starts, so that the agent can greet the user by name. Additionally, I want the agent to process this data using an action group directly. Could you guide me on how to achieve this setup?

asked 2 years ago699 views
1 Answer
0

Hi Rahul,

To personalize the chat experience for users and include the email ID of the logged-in user in the context before the chat starts, you can follow these steps:

  1. Define a function detail in your action group that includes an email parameter:

    • In the Amazon Bedrock console, go to the "Action groups" section and create a new action group.
    • In the "Action group details" section, select "Define with function details" as the action group type.
    • Add a new function and define a parameter for the email address, making it a required field.
  2. Process the email parameter using an action group:

    • In the "Actions" section of the action group, you can define an action that processes the email parameter.
    • You can use the email parameter to personalize the chat experience, such as greeting the user by name.

Here's an example of how you can define the function details and an action to process the email parameter:

Function Details:
Parameter Name: Email
Parameter Type: string
Required: Yes

Action:
Action Type: Custom
Action Name: Greet User
Parameters:
  - Email
Action Logic:
  Greet the user by name using the provided email address

By following these steps, you can include the email ID of the logged-in user in the context before the chat starts and process this data using an action group in your Bedrock agent.

You can follow these documents for more details.

Create an action group for an Amazon Bedrock agent - Amazon Bedrock

Define function details for your agent's action groups in Amazon Bedrock - Amazon Bedrock

Add an action group to your agent in Amazon Bedrock - Amazon Bedrock

AWS
answered 2 years ago
  • It's a good idea to greet the user with an email ID, but I want to provide the email ID from the SDK using the API field 'sessionAttribute'. Is that possible? The action group might create an agent to capture the email ID whenever a user says, "This is my email." It won’t be constant. Let me know if I'm thinking in the right direction or if you have a better solution.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.