An open API service indexing awesome lists of open source software.

https://github.com/intrepidkid/rag-chatbot

RAG chatbot using Intel's Neural Chat 7B LLM, BGE Embeddings, ChromaDB, Langchain, and CTransformers. A simple frontend developed using HTML, CSS and bootstrap. Basic Project to implement the functionality of RAG.
https://github.com/intrepidkid/rag-chatbot

ai bootstrap langchain python3 rag

Last synced: 5 months ago
JSON representation

RAG chatbot using Intel's Neural Chat 7B LLM, BGE Embeddings, ChromaDB, Langchain, and CTransformers. A simple frontend developed using HTML, CSS and bootstrap. Basic Project to implement the functionality of RAG.

Awesome Lists containing this project

README

          

# ๐Ÿง  RAG Chatbot โ€“ Retrieval-Augmented Generation with LangChain

This is a lightweight, local Retrieval-Augmented Generation (RAG) chatbot built using **LangChain**, **Chroma**, and a **local LLM** (neural-chat 7B GGUF model). It allows users to ask questions, and the system responds with contextually relevant answers based on ingested documents.

## ๐Ÿš€ Features

- ๐Ÿ” **Document Search:** Uses Chroma vector store to find relevant chunks.
- ๐Ÿง  **Local LLM:** Uses `CTransformers` to run a GGUF quantized model (no internet required).
- ๐Ÿงพ **Custom PDF Ingestion:** Load and split PDFs using `PyMuPDFLoader`.
- ๐Ÿงฌ **HuggingFace BGE Embeddings:** For high-quality semantic search.
- ๐ŸŒ **Flask Web App:** Simple frontend to interact with the chatbot.

---

## ๐Ÿ—‚๏ธ Project Structure

```
RAG_Chatbot_Inv_Bank/
โ”‚
โ”œโ”€โ”€ Data/
โ”‚ โ”œโ”€โ”€ app.py # Main Flask app
โ”‚ โ”œโ”€โ”€ ingest.py # For loading and vectorizing documents
โ”‚ โ”œโ”€โ”€ neural-chat-7b...gguf # Local quantized LLM (ignored in git)
โ”‚ โ””โ”€โ”€ 400 Questions.pdf # Sample document
โ”‚
โ”œโ”€โ”€ templates/
โ”‚ โ””โ”€โ”€ index.html # Frontend for the chatbot
โ”‚
โ”œโ”€โ”€ stores/ # Chroma vector store (ignored in git)
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md
```

---

## ๐Ÿ› ๏ธ Installation

> ๐Ÿ“ Make sure you have Python 3.10+ and `pip` installed.

```bash
git clone https://github.com/intrepidkid/RAG-Chatbot-.git
cd RAG-Chatbot-

python -m venv venv
venv\Scripts\activate # or source venv/bin/activate on Unix

pip install -r requirements.txt
```

> Make sure to download the `.gguf` model file manually and place it inside the `Data/` folder.

---

## โš™๏ธ Usage

### 1. Ingest Documents

Run this once to process your PDF files and generate embeddings:

```bash
python Data/ingest.py
```

### 2. Start the Flask App

```bash
python Data/app.py
```

Go to `http://127.0.0.1:5000/` to chat!

---

## ๐Ÿ”’ .gitignore Example

```gitignore
venv/
__pycache__/
*.pyc
*.log
.env
*.gguf
stores/
```

---

## ๐Ÿ’ก Tech Stack

- [LangChain](https://www.langchain.com/)
- [CTransformers](https://github.com/marella/ctransformers)
- [ChromaDB](https://www.trychroma.com/)
- [HuggingFace BGE Embeddings](https://huggingface.co/BAAI/bge-large-en)
- Flask + HTML

---

## ๐Ÿงผ TODO

- [ ] Improve UI with streaming response
- [ ] Add file upload functionality
- [ ] Support GPU inference (optional)

---

## ๐Ÿ“œ License

MIT License

---

## ๐Ÿง‘โ€๐Ÿ’ป Author

**@intrepidkid**
๐Ÿ”— [GitHub](https://github.com/intrepidkid)