RAG-ChatBOT / README.md
aadil732's picture
Adding Readme.md
82c164b
metadata
title: RAG ChatBOT
emoji: πŸ‘
colorFrom: pink
colorTo: pink
sdk: docker
pinned: false
short_description: This is a RAG Based ChatBOT by Mohammed Adil.

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

RAG Based Chatbot

The RAG-based AI ChatBot is designed to streamline information retrieval from lengthy PDF files, catering to professionals like Researchers, Teachers, Engineers, and anyone. Utilizing Pinecone Vector Database, Gemini API, and Sarvam AI, it generates relevant answers from internal documents. It also generates speech from the response using an LLM. Built with Streamlit for the frontend and FastAPI for the backend, the chatbot leverages Langchain to handle queries efficiently. The project offers fast and accurate insights, optimizing document-based research and decision-making processes.

The primary data of this project is based on Chapter 11 - Sound, Book Science of CBSE class 9th. To change the data for personal use, open the file named "api.py", go to line 164, and instead of "./data/ncert_data.pdf", paste the filepath of your document. Rerun the script, and your program is good to go.

Click to watch the YouTube Video

πŸ’» Built with

Python is used as the main language to build this project.

Python Libraries mainly used in the project:

APIs used in the project:

Version control tool and containerization technologies:

🧐 Features

Here are some of the project's best features:

  • Completely built with Python.
  • Agent based query handling.
  • Containerized whole project using Docker.
  • Support for long content files.
  • Free and open-source resources used to built.

πŸ› οΈ Installation Steps

By Basic Way

  1. Clone the repo

    git clone https://github.com/aadil080/Sarvam-ML-Assignment.git
    
  2. Change the working directory and install the requirements

    pip install -r requirements.txt
    
  3. Create & add environment variables in the ".env" file

    PINECONE_API_KEY = <your_pinecone_index_api_key>
    PINECONE_INDEX_NAME = <your_pinecone_name>
    GOOGLE_API_KEY = <your_google_gemini_1.5_flash_api_key>
    SARVAM_API_KEY = <your_sarvam_ai_text_to_speech_api_key>
    
  4. Execute the bash file

    bash start.sh
    

Using Docker

  1. Clone the repo

    git clone https://github.com/aadil080/Sarvam-ML-Assignment.git
    
  2. Create & add environment variables in the ".env" file

    PINECONE_API_KEY = <your_pinecone_index_api_key>
    PINECONE_INDEX_NAME = <your_pinecone_name>
    GOOGLE_API_KEY = <your_google_gemini_1.5_flash_api_key>
    SARVAM_API_KEY = <your_sarvam_ai_text_to_speech_api_key>
    
  3. Execute the Docker image creation command

    docker build -t <image_name> . # here period represents the dockerfile path
    
  4. Create a new container from the created image

    docker run -p 8000:80 <image_name>
    

Usage

After all the above steps, open your browser on the same machine and type the address below:

http://localhost:8501

πŸ›‘οΈ License

This project is licensed under the Apache-2.0 license.