Skip to content

aws-east-ai/Bedrock-Claude-Deep-Dive-Workshop

Repository files navigation

Amazon Bedrock and Claude Deep Dive Workshop

This hands-on workshop, aimed at developers and solution builders, introduces how to leverage foundation models (FMs) e.g. Titan and Claude 3 through Amazon Bedrock.

Labs include:

  • 01 - Text Generation [Estimated time to complete - 20 mins]
    • Text generation with Bedrock
    • Text summarization with Titan and Claude
    • QnA with Titan
  • 02 - RAG and Knowledge bases [Estimated time to complete - 45 mins]
    • Simple RAG with Claude 3 and LangChain
    • Managed RAG retrieve and generate example
    • Langchain RAG retrieve and generate example
  • 03 - Image and Multimodal [Estimated time to complete - 45 mins]
    • Image understanding & visual QA
    • Bedrock Titan Multimodal embeddings
    • Multimodal RAG
  • 04 - Tool Use [Estimated time to complete - 45 mins]
    • Tool use workflow
    • Chatbot with tool use
  • 05 - Agents [Estimated time to complete - 30 mins]
    • Restaurant agent
    • Agent with action and knowledge base
  • 06 - Security and Gorvernance [Estimated time to complete - 30 mins]
    • Bedrock guardrails

Getting started

Choose a notebook environment

This workshop is presented as a series of Python notebooks, which you can run from the environment of your choice:

Enable AWS IAM permissions for Bedrock

The AWS identity you assume from your notebook environment (which is the Studio/notebook Execution Role from SageMaker, or could be a role or IAM User for self-managed notebooks), must have sufficient AWS IAM permissions to call the Amazon Bedrock service.

To grant Bedrock access to your identity, you can:

  • Open the AWS IAM Console
  • Find your Role (if using SageMaker or otherwise assuming an IAM Role), or else User
  • Select Add Permissions > Create Inline Policy to attach new inline permissions, open the JSON editor and paste in the below example policy:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "BedrockFullAccess",
            "Effect": "Allow",
            "Action": ["bedrock:*"],
            "Resource": "*"
        }
    ]
}

⚠️ Note: With Amazon SageMaker, your notebook execution role will typically be separate from the user or role that you log in to the AWS Console with. If you'd like to explore the AWS Console for Amazon Bedrock, you'll need to grant permissions to your Console user/role too. You can run the notebooks anywhere as long as you have access to the AWS Bedrock service and have appropriate credentials

For more information on the fine-grained action and resource permissions in Bedrock, check out the Bedrock Developer Guide.

Clone and use the notebooks

ℹ️ Note: In SageMaker Studio, you can open a "System Terminal" to run these commands by clicking File > New > Terminal

Once your notebook environment is set up, clone this workshop repository into it.

git clone https://github.com/aws-east-ai/Bedrock-Claude-Deep-Dive-Workshop
cd Bedrock-Claude-Deep-Dive-Workshop

You're now ready to explore the lab notebooks! Start with 00_Prerequisites/01_bedrock_basics.ipynb for details on how to install the Bedrock SDKs, create a client, and start calling the APIs from Python.