This respository implements a scalable RAG solution for a GenAI Q&A use case.
- app: Streamlit app for testing the GenAI application in you preferred IDE
- backend: Lambda function used as backend for the GenAI application
- data_workflow: Lambda functions used in the StepFunction workflow for indexing PDF and txt documents
- fargate: Fargate content for deploying the frontend app using Fargate
- notebooks: Jupyter notebooks for testing the SageMaker Endpoints, and indexing workflows
- setuo: CFN template for deploying the AWS resources
-
Have an existing Amazon S3 Bucket
-
Put the lambda_layers zip files in an Amazon S3 bucket:
- Option 1:
- Download the two layers from Releases
- Rename each file as lambda_layer.zip
- Option 2:
- Build two .zip files starting from the requirements.txt
- Rename each file as lambda_layer.zip
- Put each file name in your existing Amazon S3 Bucket
- gen-ai-qa/layers/langchain/lambda_layer.zip
- gen-ai-qa/layers/pdf-parser-layer/lambda_layer.zip
- Option 1:
- Deploy cfn-template.yml
- Check the Lambda Layer Paths are reflecting your path
- Provide the name of you Amazon S3 Bucket defined in the Prerequsites1
- Navigate the AWS Console under Cloudformation
- Take the name of the resources created
- Amazon S3 Bucket name
- Amazon OpenSearch Domain Endpoint and add https:// as prefix
- Take the name of the resources created
- Edit backend/config.yaml
- Add Amazon OpenSearch Domain Endpoint and add https:// as prefix under es_credentials -> endpoint
- Upload backend/config.yaml in the created Amazon S3 Bucket by the CloudFormation template under gen-ai-qa/configs/configs.yaml
- Edit configs.yaml
- aws: AWS Credentials for invoking the Lambda backend
- s3: Amazon S3 Bucket name created by the Cloudformation template
- Deploy fargate
./fargate/deploy_stack.sh