https://github.com/engichang1467/rag-chatbot-langchain
Retrieval Augmented Generation Chatbot with Langchain 🦜🔗 and HuggingFace 🤗
https://github.com/engichang1467/rag-chatbot-langchain
chatbot huggingface langchain rag
Last synced: about 2 months ago
JSON representation
Retrieval Augmented Generation Chatbot with Langchain 🦜🔗 and HuggingFace 🤗
- Host: GitHub
- URL: https://github.com/engichang1467/rag-chatbot-langchain
- Owner: engichang1467
- License: mit
- Created: 2024-03-21T06:49:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T07:20:45.000Z (over 2 years ago)
- Last Synced: 2025-09-10T04:57:32.550Z (10 months ago)
- Topics: chatbot, huggingface, langchain, rag
- Language: Python
- Homepage: https://huggingface.co/spaces/mca183/retrieval-augmented-generation-langchain
- Size: 4.88 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RAG Chatbot with Langchain and HugginFace 🦜🔗🤗
Retrieval Augmented Generation Chatbot using Langchain 🦜🔗 and HuggingFace 🤗
## Overview
The concept of Retrieval Augmented Generation (RAG) involves leveraging pre-trained Large Language Models (LLM) alongside custom data to produce responses. This approach merges the capabilities of pre-trained dense retrieval and sequence-to-sequence models. In practice, RAG models first retrieve relevant documents, then feed them into a sequence-to-sequence model, and finally aggregate the results to generate outputs. By integrating these components, RAG enhances the generation process by incorporating both the comprehensive knowledge of pre-trained models and the specific context provided by custom data.
## Getting Started
### Environment Setup
To get started, create a virtual environment and activate it:
```bash
virtualenv venv
source venv/bin/activate
```
Create a local environment file (`.env`) and add your huggingface API key:
```bash
HF_TOKEN=your_huggingface_api_key
```
### Install Dependencies
Next, install the required dependencies using pip:
```bash
pip install -r requirements.txt
```
### Run the Application
Now, you can run the application:
```bash
gradio app.py
```
This will start the application, allowing you to chat with the RAG model.
## Usage
Once the application is up and running, you can interact with the chatbot through a web interface.
## Additional Resources
- Check out the chatbot on [](https://huggingface.co/spaces/mca183/retrieval-augmented-generation-langchain)
- Explore more about the databricks-dolly-15k dataset [here](https://huggingface.co/datasets/databricks/databricks-dolly-15k)
- Explore more about the Dynamic-TinyBERT model [here](https://huggingface.co/Intel/dynamic_tinybert)
- Explore more about the sentence-transformers (`all-MiniLM-L6-v2`) model [here](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)