Building Serverless GenAI Application with Amazon Bedrock

Building Serverless GenAI Application with Amazon Bedrock
Building Serverless GenAI Application with Amazon Bedrock

CLOUD LABS



Building Serverless GenAI Application with Amazon Bedrock

In this Cloud Lab, you’ll build a serverless GenAI question-answering application using Amazon Bedrock, Amazon Bedrock AgentCore, Lambda, API Gateway, and Amplify.

10 Tasks

intermediate

1hr 30m

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

Hands-on experience building a serverless GenAI application using Amazon Bedrock and Amazon Bedrock AgentCore
Understanding how to create a managed knowledge base
The ability to integrate knowledge base, Bedrock Guardrails into the Bedrock AgentCore Gateway
The ability to set up API Gateway and AWS Lambda for seamless backend communication
Hands-on experience deploying a React web application on AWS Amplify and integrating it with backend services

Technologies
Bedrock
Amplify
Aurora logoAurora
Secrets Manager
Lambda logoLambda
API Gateway logoAPI Gateway
Cloud Lab Overview

Amazon Bedrock enables developers to integrate powerful Generative AI models without the complexity of model training, infrastructure management, or scaling. With the introduction of Amazon Bedrock AgentCore, developers now have a highly modular framework to orchestrate AI agents, manage secure data gateways, and route queries seamlessly. By leveraging Bedrock and AgentCore together, you can build intelligent, multi-step applications that process and respond to user queries efficiently.

In this Cloud Lab, you’ll begin by setting up an Amazon Bedrock Managed Knowledge Base. This fully managed service handles data ingestion, embedding generation, and vector storage automatically, eliminating the need to manually configure and manage external vector databases. Next, you’ll configure Amazon Bedrock Guardrails to ensure responsible AI output filtering. Finally, you will build and deploy your AI agent using Amazon Bedrock AgentCore. By integrating the managed knowledge base and guardrails natively via the AgentCore Gateway, your agent will securely orchestrate multi-step retrieval and process user queries using Anthropic's Claude model.


Once your data and models are in place, you’ll create a Lambda function to interact with your Bedrock AgentCore deployment. When a user query is made, the Lambda function will invoke the agent, which automatically retrieves the relevant context from your managed knowledge base. You will configure an API Gateway to trigger this Lambda function, passing the query and returning the processed response. Finally, you’ll integrate the API with a React web application hosted on AWS Amplify, establishing a seamless connection between the frontend and backend services to enable a full AI-powered question-answering experience.


After completing this Cloud Lab, you’ll have the skills to leverage Amazon Bedrock for creating and managing knowledge bases, and deploying modern AI agents using Bedrock AgentCore. You will also gain experience integrating these resources with AWS services like Lambda and API Gateway, and deploying a React web application on AWS Amplify to build a complete serverless GenAI application.

The following is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab:

End-to-end GenAI serverless application with Amazon Bedrock
End-to-end GenAI serverless application with Amazon Bedrock
Cloud Lab Tasks
1.Introduction
Getting Started
2.Set Up the Agent and Lambda
Create an S3 Bucket
Create an Managed Knowledge Base
Create an AgentCore Gateway and Harness
Create a Lambda Function
3.AWS API Gateway and Amplify
Create the REST API
Deploy the React Application
Testing the End-to-End Application Flow
4.Conclusion
Clean Up
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Before you start...

Try these optional labs before starting this lab.

Relevant Course

Use the following content to review prerequisites or explore specific concepts in detail.

Hear what others have to say
Join 1.4 million developers working at companies like