Giter Club home page Giter Club logo

rag-based-ai-chatbot's Introduction

RAG-based-ai-chatbot

Amazon Bedrock 으로 RAG(retrieval augmented generation) Chatbot을 제작한 프로젝트입니다. 본 프로젝트를 이용해서 사용자는 LLM 모델을 사용해서 질문에 대한 응답을 생성할 수 있습니다. 또한 참고할 문서를 업로드 하고, 응답 생성시 참고하여 문서의 도메인 특화된 응답을 얻을 수 있습니다.

Command

Docker build

docker buildx build --no-cache --platform=linux/amd64 -t qarag .

Docker tag

docker tag qarag:latest [ACCOUNT ID].dkr.ecr.us-west-2.amazonaws.com/qarag:latest

Docker push

docker push [ACCOUNT ID].dkr.ecr.us-west-2.amazonaws.com/qarag:latest  

Cloud Architecture

cloud-architecture-02

Amazon Bedrock을 이용해서 응답을 생성하고, Amazon OpenSearch를 이용해서 문서와 임베딩 벡터 값을 저장합니다. Frontend 와 Backend가 포함된 본 애플리케이션은 Amazon ECS에 배포되어 운영됩니다.

Application Architecture

애플리케이션을 구성하고 있는 아키텍처에 대해 살펴보도록 하겠습니다.

UseCase

usecase-01
  • Store Document: 응답 생성시 참고할 문서를 업로드합니다.
  • Delete Document: 업로드한 문서를 삭제합니다.
  • Get Answer: LLM 과 업로드한 문서를 참고하여 응답을 생성합니다.

Overview Diagram

app-architecture-overview
  • Chatbot Interface: 사용자와 상호작용 할 수 있는 Chatbot 형태의 인터페이스를 제공합니다.
  • Generator: Prompt 를 생성해서 LLM 으로 부터 응답 생성을 요청합니다.
  • Retriever: Prompt 생성에 팔요한 사용자의 질문과 가장 관련이 있는 문서를 검색합니다.
  • Knowledge Source: 문서를 임베딩 벡터와 함께 저장합니다.
  • LLM(Large Language Model): 응답을 생성합니다.

Module Diagram

app-architecture-diagram

Sequence Diagram

Store Documents

참고할 문서를 Chunk 단위로 나누고 Embedding Vector 로 변환하여 원본과 함께 저장합니다.

app-architecture-sequence-01

Delete Document

저장된 문서와 Embedding Vector 를 제거합니다.

app-architecture-sequence-02

Get Answer

질문과 연관된 문서를 찾아서 Prompt 를 만들어서 응답을 생성하는데 사용합니다.

app-architecture-sequence-03

References

rag-based-ai-chatbot's People

Contributors

hijigoo avatar

Stargazers

 avatar  avatar Jinwoo Yoon avatar SEOLHEE KIM avatar Kyoungsu Park avatar

Watchers

 avatar

Forkers

napkin-dl

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.