Skip to content

repository for SageMaker Jump Start and MongoDB Vector Search Generative AI usecase

Notifications You must be signed in to change notification settings

mongodb-partners/SageMaker_JumpStart_MongoDB_VectorSearch_GenerativeAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

Generative AI Solution: Lambda function to vectorize data

Introduction

This repository demonstrates how to vectorize the data using the Amazon SageMaker Jumpstart models.

Prerequisite

sam cli

MongoDB Atlas Databse with Sample Data

Steps

Update the environment variable for ATLAS_URI

update the ATLAS_URI value in template.yaml and .env files.

Generate Vector Embeddings

Generate the vector embedding(egVector) for fullplot field in sample_mflix.movies collection

cd mdb_lex_lambda2/mdb_lex_lambda/util
python3 mongodb_vectorization_search.py

Create Index

Create the Vector Search Index for the egVector field created in the previous step.

  {
    "mappings": {
      "dynamic": true,
      "fields": {
        "egVector": {
          "dimensions": 384,
          "similarity": "euclidean",
          "type": "knnVector"
        }
      }
    }
  }

Build and Deploy

cd ..

sam build

sam package

sam deploy

Troubleshoot

Refer to the Cloudformation Event for any errors

About

repository for SageMaker Jump Start and MongoDB Vector Search Generative AI usecase

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages