https://github.com/garbii1/personal-data-assistant-chatbot
Create your own Retrieval-Augmented Generation (RAG) chatbot for PDFs. This project uses LangChain, Flask, and an LLM (IBM WatsonX/Hugging Face) to build a conversational AI that understands your documents.
https://github.com/garbii1/personal-data-assistant-chatbot
ai chatbot chroma document-qa flask hugging-face langchain large-language-models llm natural-language-processing pdf-chatbot personal-data-assistant python rag retrieval-augmented-generation watsonx web-application
Last synced: about 1 month ago
JSON representation
Create your own Retrieval-Augmented Generation (RAG) chatbot for PDFs. This project uses LangChain, Flask, and an LLM (IBM WatsonX/Hugging Face) to build a conversational AI that understands your documents.
- Host: GitHub
- URL: https://github.com/garbii1/personal-data-assistant-chatbot
- Owner: Garbii1
- Created: 2025-06-16T17:25:33.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-17T17:06:35.000Z (4 months ago)
- Last Synced: 2025-06-17T18:23:05.104Z (4 months ago)
- Topics: ai, chatbot, chroma, document-qa, flask, hugging-face, langchain, large-language-models, llm, natural-language-processing, pdf-chatbot, personal-data-assistant, python, rag, retrieval-augmented-generation, watsonx, web-application
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π€ Personal Data Assistant Chatbot
Welcome to your own **PDF-powered AI Chatbot**! This project helps you build a smart, document-aware chatbot using Flask, LangChain, and modern LLMs. Upload a PDF, ask questions, and get instant, context-aware answersβall through a beautiful web interface.
---
## π Features
- **Chat with your PDFs**: Upload any PDF and ask questions about its content.
- **Modern UI**: Clean, responsive frontend with light/dark mode.
- **Flexible LLM Backend**: Use IBM WatsonX or Hugging Face models.
- **Fast & Private**: All processing happens locally or in your own cloud.
- **Easy Deployment**: Run locally or with Docker in minutes.---
## π Table of Contents
- [Getting Started](#getting-started)
- [How It Works](#how-it-works)
- [Running the Application](#running-the-application)
- [Docker Deployment](#docker-deployment)
- [Switching to Hugging Face](#switching-to-hugging-face)
- [Project Structure](#project-structure)
- [License](#license)---
## π Getting Started
### Prerequisites
- Python 3.x
- `pip` and `virtualenv`
- `git`### Installation
```bash
# Clone the repository
$ git clone https://github.com/Garbii1/personal-data-assistant-chatbot.git
$ cd personal-data-assistant-chatbot/build_chatbot_for_your_data# Create and activate a virtual environment
$ pip install virtualenv
$ virtualenv my_env
# On Windows:
$ my_env\Scripts\activate
# On macOS/Linux:
$ source my_env/bin/activate# Install dependencies
$ pip install -r requirements.txt
$ pip install langchain-community
```---
## βοΈ How It Works
### π₯οΈ Frontend
- **`index.html`**: Chat interface layout
- **`static/style.css`**: Modern, responsive styles (light/dark mode)
- **`static/script.js`**: Handles chat, file upload, and UI events### π§ Backend
- **`worker.py`**: Handles PDF processing, embeddings, and LLM queries
- **`server.py`**: Flask server, API endpoints, and file handling#### Main Flow
1. **Upload PDF** β Processed & split into chunks
2. **Embeddings** β Chunks stored in a vector database (Chroma)
3. **Ask Questions** β LLM retrieves relevant info and answers---
## βΆοΈ Running the Application
```bash
$ python server.py
```
Visit [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser. Upload a PDF and start chatting!---
## π³ Docker Deployment
```bash
# Build the Docker image
$ docker build . -t build_chatbot_for_your_data# Run the container
$ docker run -p 8000:8000 build_chatbot_for_your_data
```
Access at [http://127.0.0.1:8000](http://127.0.0.1:8000).---
## β¨ Switching to Hugging Face LLM
1. Install extra dependencies:
```bash
pip install langchain==0.1.17 huggingface-hub==0.23.4
```
2. Get your Hugging Face API key from [huggingface.co](https://huggingface.co/settings/tokens)
3. Edit `worker.py`:
- Replace the `init_llm()` function as shown in the code comments
- Set your API key and desired model (e.g., `mistralai/Mistral-7B-Instruct-v0.3`)---
## π Project Structure
```
personal-data-assistant-chatbot/
βββ build_chatbot_for_your_data/
β βββ Dockerfile
β βββ requirements.txt
β βββ server.py
β βββ worker.py
β βββ static/
β β βββ script.js
β β βββ style.css
β βββ templates/
β βββ index.html
βββ my_env/ (virtual environment)
βββ README.md
```---
## π License
This project is licensed under the MIT License. See the [LICENSE](build_chatbot_for_your_data/LICENSE) file for details.---
> **Made with β€οΈ by Garbii1**