Giter Club home page Giter Club logo

basic-rag-chatbot's Introduction

๐Ÿ’ฌ Basic-RAG-Chatbot

This is a basic RAG chatbot made using LangChain, Streamlit, FAISS, Cohere's embed-english-v3.0 and OpenAI's gpt-3.5-turbo or Cohere's command-r

Setup

Worked with Python 3.11 anything above will probably work.

  1. Clone the repo
git clone https://github.com/Anindyait/RAG-Basics.git

  1. Create and activate virtual environment
cd RAG-Basics
python -m venv .venv
.venv\Scripts\activate

  1. Install Requirements
pip install -r requirements.txt

  1. Go to \.venv\Lib\site-packages\langchain_community\chat_models Open cohere.py and comment out the line "token_count": response.token_count,

  1. Create a .env file and put your Cohere API key as COHERE_API_KEY and OpenAI API key as OPENAI_API_KEY Cohere API Key and OpenAI API Key
OPENAI_API_KEY=[YOUR OPENAI API KEY GOES HERE]
COHERE_API_KEY=[YOUR COHERE API KEY GOES HERE]

The OPENAI_API_KEY is not used by default. The chatbot uses Cohere's embed-english-v3.0 and command-r by default.

  1. Run Chatbot.py streamlit run .\Chatbot.py


Use

  • Navigate to Upload Files in the sidebar to upload your own PDFs (make sure the PDFs are readable) Upload
  • Store the uploaded PDFs in a new or existing index.
  • Navigate to Chatbot and select the desired index (An index on the book Metamorphosis is already created).
  • And ask questions to the chatbot. Chatbot

basic-rag-chatbot's People

Contributors

anindyait avatar priyanka-maz avatar

Stargazers

 avatar

Watchers

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