Giter Site home page Giter Site logo

misterretriverite's Introduction

Mister RetrieveRite

Mr. RetrieveRite is a tool based on RAG (Retrieval Augmented Generation), designed for effective, efficient, and high-quality search and text generation.

Table of Contents

Overview

Brief Description

Retrieval-Augmented Generation (RAG) enhances large language models (LLMs) by incorporating external knowledge sources, enabling more informed responses beyond the model's training data. It is a cost-effective approach to improving LLM output so it remains relevant, accurate, and useful in various contexts all without the need to retrain the model.

Watch the video

Why?

  • Challenges to LLMs : Making things up when it does not have the answer; presenting ou-of-date or generic information.
  • Cost-effective implementation : The computational and financial costs of retraining base models for organization or domain-specific information are high. Aditionally APIs charge for processing tokens. Giving only relevant input to generate a response can be cost efficient.
  • Current information : LLMs are trained on a data upto a specific date. RAG allows developers to provide the latest research, statistics, or news to the generative models while maintaining relevancy.
  • Enhanced user trus : RAG can provide source attribution. The output includes refrences to sources so the user may cross check.

Technologies used

  • Langchain, OpenAI API, Hugging Face, Streamlit, FAISS
  • For this project Langchain and OpenAI API is used for processing data and giving prompts; Hugging Face's transformer model is used to create embeddings; Faiss is used for retrieval; and Streamlit is used to design UI.

Target Audience

  • Customer Service Industry
  • Advertising and Marketing
  • Education and E-Learning
  • Healthcare Industry
  • E-commerce and Retail Industry

Technical Architecture

Technical Architecture

  • Data Ingestion : Used Langchain's UnstructuredURLLoader class to load data from urls.
  • Split data into chunks : Used langchain's RecursiveCharacterTextSplitter class.
  • Vector DB : Vectorized the chunks using HuggingFaceBgeEmbeddings, create a FAISS vector store using the embeddings and the splits .
  • Retrieval and prompt : Retrieve the relevant chunks from the DB store and formulate an LLM prompt. Used RetrievalQAWithSourcesChain class and OpenAI API.

Project Status

  • Phase 1 : Currently the project works as a prototype. You can copy paste three urls from the internet and ask questions. The project has the foundational structure to expand on its capabilities to deal with large information database.

Future Scope

  • Host the app on a server
  • Make it more application specific and build different products out of it.
  • Make the data-ingestion system more robust
  • Include a more robust and capable Vector DB

Installation

** Python 3.9**

  1. Clone this repository to your local machine using:
    $ git clone https://github.com/Palpendiculal/MisterRetriveRite.git
    $ cd your_project
  2. Create a conda environment and install dependencies
    $ pip install -r requirements.txt

Usage

  1. Update the .env file with your API key
  2. To run the app copy the following command in your terminal:
    $ streamlit run app.py
  3. Copy paste urls from the internet and ask questions.

Model and Data

For embeddings used all-mpnet-base-v2 from Huggingface. For prompts used gpt-3.5-turbo-instruct from OpenAI

API Keys and Credentials

To generate an API key go to OpenAI website. Generate the key and update your .env

Contributing

To contribute feel free to fork the repo. Please do not hesitate to contact me on LinkedIn

Acknowledgments

https://www.lettria.com/blogpost/retrieval-augmented-generation-5-uses-and-their-examples https://colabdoge.medium.com/what-is-rag-retrieval-augmented-generation-b0afc5dd5e79 https://www.hopsworks.ai/dictionary/vector-database https://codebasics.io/

Contact

[LinkedIn] (https://www.linkedin.com/in/varun-kumar-singh-b01083148/)

git config --global user.name "Dephinate" git config --global user.email "[email protected]"

misterretriverite's People

Stargazers

Hitesh Bhadana avatar Ashish Bhogate avatar Arnav Raviraj avatar Gargi  Sadashiv Gaitonde avatar

Watchers

Varun Singh 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.