Code Monkey home page Code Monkey logo

genai-qa-rag's Introduction

GenAI Q&A RAG

This respository implements a scalable RAG solution for a GenAI Q&A use case.

Architecture

User Interaction

Architecture

Document Indexing

Architecture

Repository Content

  1. app: Streamlit app for testing the GenAI application in you preferred IDE
  2. backend: Lambda function used as backend for the GenAI application
  3. data_workflow: Lambda functions used in the StepFunction workflow for indexing PDF and txt documents
  4. fargate: Fargate content for deploying the frontend app using Fargate
  5. notebooks: Jupyter notebooks for testing the SageMaker Endpoints, and indexing workflows
  6. setuo: CFN template for deploying the AWS resources

Prerequisites

  1. Have an existing Amazon S3 Bucket

  2. Put the lambda_layers zip files in an Amazon S3 bucket:

    1. Option 1:
      1. Download the two layers from Releases
      2. Rename each file as lambda_layer.zip
    2. Option 2:
      1. Build two .zip files starting from the requirements.txt
        1. langchain
        2. pdf-parser-layer
      2. Rename each file as lambda_layer.zip
    3. Put each file name in your existing Amazon S3 Bucket
      1. gen-ai-qa/layers/langchain/lambda_layer.zip
      2. gen-ai-qa/layers/pdf-parser-layer/lambda_layer.zip

Deployment

  1. Deploy cfn-template.yml
    1. Check the Lambda Layer Paths are reflecting your path
    2. Provide the name of you Amazon S3 Bucket defined in the Prerequsites1
  2. Navigate the AWS Console under Cloudformation
    1. Take the name of the resources created
      1. Amazon S3 Bucket name
      2. Amazon OpenSearch Domain Endpoint and add https:// as prefix
  3. Edit backend/config.yaml
    1. Add Amazon OpenSearch Domain Endpoint and add https:// as prefix under es_credentials -> endpoint
  4. Upload backend/config.yaml in the created Amazon S3 Bucket by the CloudFormation template under gen-ai-qa/configs/configs.yaml

Optional: Deploy Fargate Application

  1. Edit configs.yaml
    1. aws: AWS Credentials for invoking the Lambda backend
    2. s3: Amazon S3 Bucket name created by the Cloudformation template
  2. Deploy fargate
    1. ./fargate/deploy_stack.sh

genai-qa-rag's People

Contributors

brunopistone avatar

Stargazers

 avatar  avatar Abdullah Yahya avatar HsinWei Chen avatar Jonathan Experton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.