Giter Club home page Giter Club logo

ragbot's Introduction

RAG chatbot powered by ๐Ÿ”— Langchain, OpenAI, Google Generative AI and Hugging Face ๐Ÿค—

RAG architecture with Langchain components.

Project Overview

Although Large Language Models (LLMs) are powerful and capable of generating creative content, they can produce outdated or incorrect information as they are trained on static data. To overcome this limitation, Retrieval Augmented Generation (RAG) systems can be used to connect the LLM to external data and obtain more reliable answers.

The aim of this project is to build a RAG chatbot in Langchain powered by OpenAI, Google Generative AI and Hugging Face APIs. You can upload documents in txt, pdf, CSV, or docx formats and chat with your data. Relevant documents will be retrieved and sent to the LLM along with your follow-up questions for accurate answers.

Throughout this project, we examined each component of the RAG system from document loader to conversational retrieval chain. Additionally, we developed a user interface using streamlit application.

Installation

This project requires Python 3 and the following Python libraries installed:

langchain ,langchain-openai, langchain-google-genai, chromadb, streamlit, streamlit

The full list of requirements can be found in requirements.txt

Instructions

To run the app locally:

  1. Create a virtual environment: python -m venv langchain_env
  2. Activate the virtual environment : .\langchainenv\Scripts\activate on Windows.
  3. Run the following command in the directory: cd RAG_Chatabot_Langchain
  4. Install the required dependencies pip install -r requirements.txt
  5. Start the app: streamlit run RAG_app.py
  6. In the sidebar, select the LLM provider (OpenAI, Google Generative AI or HuggingFace), choose an LLM (GPT-3.5, GPT-4, Gemini-pro or Mistral-7B-Instruct-v0.2), adjust its parameters, and insert your API keys.
  7. Create or load a Chroma vectorstore.
  8. Chat with your documents: ask questions and get ๐Ÿค– AI answers.

Blog post

I wrote a blog post about this project. You can find it here

ragbot's People

Contributors

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