Giter Site home page Giter Site logo

chatbot-apps's Introduction

Bedrock 기반 챗봇 애플리케이션

실행 순서

  1. 필요한 패키지 설치:
pip install -r requirements.txt

*여러 라이브러리가 설치되기 때문에, 사용 환경에 따라 의존성 오류가 발생할 수 있습니다. 설치 전에, 기존 환경과의 버전 호환성을 체크해주세요.

  1. 원하는 챗봇 애플리케이션 실행:
streamlit run {Chatbot file}.py

예시

1. Basic Chat

streamlit run 1.basic-chat.py

Basic Chat

2. Chat with Input

streamlit run 2.chat-with-input.py

Chat with Input

  • 기본 챗봇 기능 (1. Basic Chat)
  • 파일 입력을 "단기 보관 메모리(Short Term Memory)"로 활용
    • 지원하는 입력 유형 : 이미지, PDF, CSV, 파이썬 코드 등

3-1. Chat RAG FAISS with Image Context

streamlit run 3-1.chat-rag-faiss.py

Chat RAG FAISS

  • 기본 챗봇 기능 (1. Basic Chat)
  • 파일 입력을 "장기 보관 메모리(Long Term Memory)"로 활용
    • 입력된 PDF 파일을 벡터로 변환 (Bedrock 임베딩 모델)
    • 변환된 벡터를 FAISS의 로컬 데이터베이스에 저장
    • 사용자 질문을 시맨틱 검색하여, 답변을 위한 컨텍스트로 활용
  • PDF 페이지를 이미지로 저장한 후, 검색 결과의 컨텍스트로 제공
    • 추가 라이브러리 sudo apt-get install poppler-utils

3-2. Chat RAG OpenSearch with Hybrid Retriever

  1. CloudFormation 파일(cloudformation/setup_opensearch.yaml)로 OpenSearch 클러스터 생성
    • 기존에 생성된 클러스터를 재사용 가능
  2. libs/opensearch.yml 파일의 연결 정보 업데이트
  3. 챗봇 애플리케이션 실행
streamlit run 3-2.chat-rag-opensearch-hybrid.py

Chat with Input

  • 기본 챗봇 기능 (1. Basic Chat)
  • 파일 입력을 "장기 보관 메모리(Long Term Memory)"로 활용
    • 입력된 PDF 파일을 벡터로 변환 (Bedrock 임베딩 모델)
    • 변환된 벡터를 Amazon OpenSearch Service 클러스터에 저장
    • 사용자 질문을 시맨틱 & 텍스트으로 검색하고, 검색 결과를 조합(앙상블)하여 답변을 위한 컨텍스트로 활용
  • OpenSearch Hybrid Search 코드 활용 : aws-ai-ml-workshop-kr

4. Chat SQL Agent

streamlit run 4.chat-sql-agent.py

Chat SQL Agent

  • 사용자의 자연어 질문을 Agent 기반으로 SQL 쿼리 변환/실행
  • 샘플 데이터베이스(Chinook DB)를 활용하거나, 데이터베이스 URI 입력
  • DB 스키마(테이블/컬럼)에 대한 상세 Description 참고 로직 : DynamoDB 활용
  • 샘플 쿼리의 RAG 패턴 참조 기능 : OpenSearch Hybrid Search 활용

chatbot-apps's People

Contributors

kevmyung 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.