Code Monkey home page Code Monkey logo

bedrockchat's Introduction

BedrockChat

BedrockChat acts as a conversational interface, leveraging generative AI models fine-tuned on your content. This feature provides users with accurate, timely information and expert insights, transforming static content consumption into a dynamic, interactive experience. BedrockChat is powered by AWS Bedrock, AWS Kendra, LangChain and Streamlit for UI.

Potential benefits of BedrockChat include an increase in user numbers and subscriptions for your website, which could lead to an increase in revenue. Furthermore, it could help solidify your position as a trusted information source within the industry.

This AI-driven application offers:

  • State-of-the-art Retrieval Augmented Generation (RAG) mechanism designed to mitigate hallucinations and model drifting.
  • The ability to reference sources, allowing users to click and access the full content of your website, reinforcing their engagement.
  • A modular architecture, allowing for flexibility in swapping the LLM or knowledge base with newer technologies as they become available.
  • Ensured data security as you host and deploy your retrieval system and LLM in your account, eliminating the need to send data to a third party.

Installation

To set up the application, follow the steps below:

Prerequisites You need to have AWS account with access to AWS Bedrock and AWS Kendra. Create an index in AWS Kendra and using one of the provided connectors (for example, Web crawler), ingest documents into the AWS Kendra index.(Please note that AWS Kendra and AWS Bedrock are NOT part of AWS free tier and you will be charged)

  1. Clone the repository:
    git clone https://github.com/iut62elec/BedrockChat.git
  2. Navigate into the project directory:
    cd BedrockChat
  3. Create and activate a virtual environment:
    python3.8 -m venv .venv
    source .venv/bin/activate
  4. Upgrade pip and install the required dependencies:
    pip install --upgrade pip
    pip install boto3==1.26.163
    pip install watchdog
    pip install streamlit
    pip install langchain
    pip install streamlit-cognito-auth
    python -m pip install ./whl_files/botocore-1.29.162-py3-none-any.whl
    python -m pip install ./whl_files/boto3-1.26.162-py3-none-any.whl
    python -m pip install ./whl_files/awscli-1.27.162-py3-none-any.whl
  5. Deactivate and reactivate the virtual environment with AWS credentials (Remember to replace "AWS_PROFILE_WITH_Bedrock_KENDRA_access" and "XXXXX" with your actual AWS profile and Kendra index ID):
    deactivate
    export AWS_PROFILE=AWS_PROFILE_WITH_Bedrock_KENDRA_access
    export AWS_REGION="us-east-1" 
    export KENDRA_INDEX_ID_BR="XXXXX"
    source .venv/bin/activate
    
  6. Navigate into the source code and run the application:
    cd ./src
    streamlit run app_BedrockChat.py bedrock

This will open a local server at http://localhost:8501/, where you can start interacting with the AI!

Disclaimer

This repository represents my viewpoints and not those of my past or current employers, including Amazon Web Services (AWS). All third-party libraries, modules, plugins, SDKs, product names, logos, and brands are the property of their respective owners. This code acts as a sample to use AWS Bedrock for Chatbot and has been tested on a Mac device and works well, but use at your own caution. This software or code is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. It is intended to serve as a sample or pseudocode for a Proof of Concept (POC) only. In no event shall the authors be liable for any claim, damages, or other liability, whether in an action of contract, tort or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software. Please note that your use of this code constitutes acceptance of this statement.

bedrockchat's People

Contributors

jpedram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gopinaath

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.