AWS Logo
Menu
Amazon Bedrock "PowerPoint Generator" Hands-On!

Amazon Bedrock "PowerPoint Generator" Hands-On!

Are you making many PowerPoint slides at your work? Make Amazon Bedrock Agents to do it instead of you!

Published Mar 20, 2025

Overview of this Hands-on Workshop

The generative AI boom shows no signs of slowing down, but many of you may have already experimented enough with RAG systems. The next trend appears to be "AI agents" that can automatically complete tasks on behalf of humans.
AWS cloud's generative AI service "Amazon Bedrock" includes a managed service called "Agents for Amazon Bedrock" that makes it easy to create such agents.
With this service, you can create intelligent agents just by clicking through the AWS Management Console GUI, without having to write extensive Python code.

The Application We'll Build

When a user requests "create a document about xxx," the agent will:
  • Perform web searches to gather information
  • Create a PowerPoint presentation and store it in S3, generating a signed URL
  • Send the URL to the user via email
The process happens automatically. If there are any questions, the agent will ask the user for clarification, and the AI will flexibly adjust the next actions based on the results of each step (for example, if email delivery fails, it will display the results on the chat screen). 

Architecture

We were previously using DuckDuckGo for web searches as it didn't require an API key, but due to recent rate limiting issues, we've updated the instructions to use Tavily instead.
Although not included in this workshop, you can also combine this with the "Knowledge Base" feature to implement RAG for searching internal company documents.

What is Bedrock?

It's an AWS service that allows you to use various AI models as APIs in a serverless manner. For those interested, I've prepared an overview document:

Hands-on Instructions

You can complete this workshop with just a web browser. Since everything is built using serverless architecture, the cost should be minimal.

1. Create an AWS Account

Create a new AWS account by following the instructions at:
After creating your account, sign in to the AWS Management Console using the URL below:
Once signed in, switch your region to "Oregon" in the top right.
For this workshop, we'll only use the Oregon region (as it has the most lenient model usage quota restrictions for Bedrock).

2. Bedrock Configuration

Now let's set up the generative AI service.
Type bedrock in the search box at the top of the Management Console to navigate to the Amazon Bedrock console.

Enable Model Access

From "Model access" in the bottom left, let's enable Anthropic's Claude.
Click "Enable specific models" and check Anthropic > Claude 3.5 Sonnet v2.
You'll be asked to declare your intended use. Fill in the following basic information:
  • Company name: Your company name
  • Company website URL: Your company's website
  • Industry: Your company's industry
  • Target users: Internal employees
  • Use case description: Personal testing or similar
After completion, the model will be enabled in 1-2 minutes. You can proceed to the next step without waiting.

Create an Agent

Next, go to "Agents > Create agent".
Keep the default agent name and click "Create".
The agent builder screen will open. Configure it as follows:
  • Select model: Anthropic > Claude 3.5 Sonnet v2 > US Claude 3.5 Sonnet v2 (select the inference profile, not on-demand)
  • Instructions for the agent:
  • Additional settings
    • User input: Enabled
After configuring these settings, click "Save" at the top of the screen.

Create Action Groups

In Bedrock agents, tasks that the AI can execute are defined as "action groups." We'll create three action groups: "Web Search," "Slide Creation," and "Email Sending."
Click the "Add" button in the action groups section at the bottom of the agent builder screen.

Action Group (First)

  • Action group name: search-web
  • Description: Performs a web search with the given query and returns the results.
  • Action group function 1
    • Name: search-web
    • Description: Performs a web search with the given query and returns the results.
    • Parameters: As follows
NameDescriptionTypeRequired
queryWeb search querystringTrue
After configuring these settings, leave the rest at their defaults and click "Create" in the bottom right. Similarly, click "Add" for action groups to create the next one.

Action Group (Second)

  • Action group name: create-pptx
  • Description: Creates a PowerPoint explanatory document in Japanese for the given topic.
  • Action group function 1
    • Name: create-pptx
    • Description: Creates a PowerPoint explanatory document in Japanese for the given topic.
    • Parameters: As follows
NameDescriptionTypeRequired
topicMain topic of the slidesstringTrue
contentContent of the slidesstringTrue
After configuring these settings, leave the rest at their defaults and click "Create" in the bottom right. Similarly, click "Add" for action groups to create the next one.

Action Group (Third)

  • Action group name: send-email
  • Description: Sends the URL of the created PPTX file to the user via email.
  • Action group function 1
    • Name: send-email
    • Description: Sends the URL of the created PPTX file to the user via email.
    • Parameters: As follows
NameDescriptionsTypeRequires
urlSigned URL of the PPTX filestringTrue
After configuring these settings, leave the rest at their defaults and click "Create" in the bottom right. Once you've created all three action groups, they should appear in the agent builder as shown below.

3. Create an S3 Bucket

Let's create a storage location for the PowerPoint documents that the agent will generate.
Navigate to the Amazon S3 console and create a new bucket.
Choose a unique name (such as pptx-yournickname-YYYYMMDD) that won't conflict with other users. All other settings can remain at their defaults.
Make a note of the S3 bucket name, as you'll need it later.

4. SNS Configuration

To send emails from Lambda, we need to configure Amazon SNS in advance.
From the SNS console, create a topic named bedrock-agent. You can leave all other settings at their defaults.
Once the topic is created, copy the "ARN" to a notepad as you'll need it later.
Next, let's create a "subscription" to deliver messages that arrive at this topic.
  • Protocol: Email
  • Endpoint: Your email address
After configuring these settings, a confirmation email will be sent to the address you specified. Click the "Confirm subscription" link to enable notification delivery.

5. Lambda Configuration

Lambda functions were automatically created when we set up the Bedrock agent action groups, but the code is mostly empty, so we need to edit it.
Navigate to the AWS Lambda console, open "Functions," and confirm that three functions have been created in the Northern Virginia region.

Prepare Lambda Layers

Before creating Lambda functions for each action group, let's prepare the external Python libraries needed by Lambda as "layers."
First, launch CloudShell by clicking the [>.] icon in the top right of the management console.
Run the following commands to ZIP the two Python libraries (Tavily and python-pptx):
Click "Actions > Download File" in the top right of CloudShell, enter layer.zip as the file path, and download the ZIP file to your local machine.
Once the download is complete, you can close the CloudShell window.

Create a Lambda Layer

First, go to "Layers > Create layer" and create a Lambda layer with the ZIP file we just created:
  • Name: tavily-pptx
  • Upload .zip file: Specify the downloaded ZIP file (approximately 14MB)
  • Compatible architectures: x86_64
  • Compatible runtimes: Python 3.9
Leave the other settings as they are and click "Create." It will take about 10 seconds.

Configure Lambda Functions

Next, from the left sidebar's "Functions," we'll configure each of the three functions.

search-web Function

  • Code source: Overwrite with the following and click "Deploy":
Then scroll down and configure the following settings:
  • Runtime settings: Click "Edit"
    • Runtime: Python 3.9
  • Layers: Click "Add a layer"
    • Custom layers: tavily-pptx
    • Version: 1
Next, configure the following from the "Configuration" tab:
  • General configuration: Click "Edit"
    • Timeout: 0 minutes 30 seconds
  • Environment variables: Click "Edit"
    • Key: TAVILY_API_KEY
    • Value: Sign up at the following site and copy your API key
Tavily is a web search service specialized for LLMs. Remarkably, you can execute up to 1,000 search API calls per month with the free plan.
For this simple workshop, we're setting the API key as an environment variable, but for production use, please utilize AWS Secrets Manager or similar services for secure operations.
Once completed, find the next function and proceed with the following configuration.

create-pptx Function

  • Code source: Overwrite with the following and click "Deploy":
  • Runtime settings: Click "Edit"
    • Runtime: Python 3.9
  • Layers: Click "Add a layer"
    • Custom layers: tavily-pptx
    • Version: 1
Next, configure the following from the "Configuration" tab:
  • General configuration: Click "Edit"
    • Timeout: 0 minutes 30 seconds
  • Environment variables: Click "Edit > Add environment variable"
    • Key: S3_BUCKET_NAME
    • Value: The S3 bucket name you created earlier (check in another tab if you didn't make a note of it)
  • Permissions: Click the "Role name" under execution role
You'll be taken to the IAM role editing screen. Click "Add permissions > Attach policies".
Find and check AmazonS3FullAccess, then click "Add permissions".
Once completed, find the next function and proceed with the following configuration.

send-email Function

  • Code source: Overwrite with the following and click "Deploy":
Note: Runtime and layer settings are not required for this function.
Next, configure the following from the "Configuration" tab:
  • Environment variables: Click "Edit"
    • Key: SNS_TOPIC_ARN
    • Value: The SNS topic ARN you created earlier (check in another tab if you didn't make a note of it)
  • Permissions: Click the "Role name" under execution role
You'll be taken to the IAM role editing screen. Click "Add permissions > Attach policies".
Check AmazonSNSFullAccess and click "Add permissions".

6. Verify Agent Operation

Now that we've configured everything, let's test if the agent works properly before integrating it into the application.
Navigate to the Bedrock console, go to "Agents," and click on the agent name you created earlier.
Click "Prepare" in the test sidebar on the right.
Try sending Research KDDI Agile Development Center Corporation and create a PowerPoint in the chat box.
After waiting 30 seconds to 1 minute, you'll get a response from the agent. You should also receive an email from Amazon SNS.
Clicking the URL allows you to download the PowerPoint!
The CEO's name might be slightly off, but since the agent is performing web searches, it's able to gather quite accurate information just from the company acronym, with minimal hallucination.
Once you've confirmed it's working, create an alias by clicking "Aliases > Create" at the bottom of the agent screen. This is like releasing a new version of the agent.
  • Alias name: v1
Once the alias is registered, copy both the agent "ID" at the top of the screen and the "Alias ID" at the bottom of the screen to a notepad, as you'll need them later.
If things aren't working properly, try the following to identify the cause:
  • Check the agent trace
  • Check the log stream via "Monitoring > View CloudWatch logs" in Lambda
Common issues include:
  • Is the model properly enabled?
  • Are you working in a region other than Northern Virginia?
  • Are there any errors in the action group parameters (e.g., typos in variable names)?
  • Did you forget to "Deploy" the Lambda function code?
  • Is there an issue with the Lambda layer contents?
  • Are there any gaps in Lambda runtime settings, layers, environment variables, or IAM roles?
  • Did you click the confirmation email from SNS?
  • Have you hit the rate limit (Service Quotas) for Claude 3.5 Sonnet v2?
Note that Bedrock is in high demand globally, and newly created AWS accounts have quite low initial quotas. If you hit rate limits, consider switching to a different model like Claude 3 Sonnet, or submit a request to AWS Support to increase your quota (though this can take several days).

7. Frontend Development

Now that the agent is working on its own, let's integrate it into an application.
First, paste the following source code into a notepad on your computer, and replace the XXXXXXXXXX in lines 8-9 with the agent ID and alias ID you created earlier.
Then save it locally as frontend.py.
Open CloudShell again and upload this file via "Actions > Upload file" in the top right.
Then, run the following commands:
If a Streamlit access URL appears, the app has started successfully.
Next, click the "+" at the top of CloudShell to launch a second "us-east-1" terminal and run:
When a confirmation message appears, type yes and press Enter. This will generate a URL through the Pinggy external service that allows access to this app.
Copy the HTTPS URL (the one on the bottom) and access it from a separate browser tab.
Click "Enter site" to access the Python app you uploaded. The frontend is displayed using the Streamlit framework.
Let's try using this app.
The agent's trace information is output in real-time to the Streamlit frontend.
If you encounter errors, recheck that you correctly copied the agent ID and alias ID into the Python file you uploaded.
To delete an existing file before re-uploading, you can use the following command:
To allow access to the Python app running on CloudShell, we're using an external service called Pinggy to generate a temporary URL accessible from the internet.
Note: For security reasons, be careful not to share this URL with unintended third parties.
You can share the URL you copied with colleagues to let them try the app.
Note that CloudShell automatically stops after 20-30 minutes, requiring you to restart Streamlit and Pinggy. Also, with the free version of Pinggy, URLs are accessible for only 60 minutes.
If you have time, consider experimenting with prompt tuning or Lambda modifications:
  • Modify the agent instructions
  • Revise the action group descriptions
  • Create a knowledge base and add RAG functionality
  • Modify Lambda functions to add features like image generation

Cleanup

Since we used a serverless configuration, leaving the environment as is will generate minimal charges, but to prevent security incidents, we recommend closing the AWS account (or, if not closing it, setting up MFA for the root user).
Note: If you close your account, you won't be able to create another AWS account with the same email address, so consider changing to a disposable email address beforehand.
 

2 Comments