hands-on lab

Embedding Documents With LangChain and Amazon Bedrock

Difficulty: Intermediate
Duration: Up to 1 hour
Students: 104
Rating: 4/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Embeddings are used in Generative AI to represent high-dimensional data in a lower-dimensional space. They are numerical representations, or vectors, of data that capture the relationships between data points. AI models can use these mathematical representations to generate new data points similar to the original data. Embeddings are crucial for implementing a Retrieval-Augmented Generation (RAG) model, which combines generative AI models with retrieval models to improve the quality of generated data.

LangChain is a framework for developing Large Language Model (LLM) applications. The LangChain framework provides various integrations for embedding models, including Amazon Bedrock.

In this lab, you will learn how to create a PDF document embedding application using the LangChain framework and deploy it using AWS Serverless Application Model (SAM).

Learning objectives

Upon completion of this intermediate-level lab, you will be able to:

  • Utilize the LangChain framework to create a PDF document embedding application
  • Deploy the embedding application and its resources using AWS SAM

Intended audience

  • Candidates for the AWS Certified Machine Learning Specialty certification
  • Cloud Architects
  • Software Engineers

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • Amazon Bedrock
  • AWS Lambda
  • Amazon Simple Storage Service (S3)
  • Amazon Simple Queue Service (SQS)
  • AWS Serverless Application Model (SAM)

The following content can be used to fulfill the prerequisites:

Environment before

Environment after

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Setting up the AWS SAM CLI
Reviewing the Embedding Solution
Working With LangChain and Amazon Bedrock in AWS Lambda
Generating PDF Document Embeddings