Bridging Healthcare Gap: GenAI Therapist with human empathy (Part 5)

Danny Chan - Sep 14 - - Dev Community

Create Bedrock Agent:

Step 1:
Image description

Image description

Image description

Step 2:
Image description

Image description

Image description

Step 3:
Image description

Image description

Image description

Image description

Step 4:
Image description

Image description

Step 5:
Image description

Image description

Step 6:

Image description

Image description



Deploy Bedrock Agent:

Step 1:
Image description

Image description

Step 2:
Image description

Image description

Image description

Image description

Step 3:

Image description

Image description

Image description



Inference parameters:

Image description

Temperature: 0
Randomness
Degree of variability in response
no variability

Top P: 1
most probable tokens to generate next
Don’t want creativity

Top K: 0
choose smaller number of next output text
Don’t want creativity



Responsible AI:

Image description



Guardrail: harmful categories & prompt attacks filters:

Step 1:

Image description

Image description

Image description

Step 2:

Image description

Image description

Image description

Image description

Step 3:

Image description

Image description

Image description



Guardrail: denied topic:

Step 1:
Image description

Image description

Step 2:
Image description

Image description

Image description

Image description

Name:
Medical Advice

Definition For Topic:
Discussions that involve providing guidance, recommendations, or suggestions related to health, medical treatments, symptoms, or overall wellness.

Sample Phrases:

  • How to manage chronic pain?
  • Recommend a diet for heart health.
  • What to do for persistent headaches?
  • Is it safe to combine medications?
  • How to improve mental well-being?

Step 3:

Image description

Image description

Step 4:

Image description

Image description



Guardrail: sensitive information filters:

Step 1:
Image description

Image description

Step 2:
Image description

Image description

Image description

Image description

Name: Account Number
Regex pattern: [A-Za-z]{6}\d{4}
Guardrail behavior: Mask
Add description - optional: Matches account numbers in the format XXXXXX1234

Step 3:
Image description

Image description



Guardrail: contextual grounding check:

Step 1:

Image description

Image description

Image description

Image description

Step 2:

Image description

Image description



Attach Guardrail to Bedrock Agent

Step 1:

Image description

Image description

Step 2:

Image description

Image description

Image description



Advantages of AWS Bedrock Agent:

Secure Data:

  • Data securely executed on AWS user VPC.

Seamless Integration:

  • Integrates seamlessly with the SDK.

Auto Scalable Operations:

  • Auto scales to handle data volumes.

Reduced Operational Overhead:

  • Minimizes on-premises infrastructure.

Simplified Compliance:

  • Facilitates compliance with data regulations.

Flexible Configuration:

  • Offers customizable configuration options.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .