Skip to content

Transform your documents into intelligent conversations. This open-source RAG chatbot combines semantic search with fine-tuned language models (LLaMA, Qwen2.5VL-3B) to deliver accurate, context-aware responses from your own knowledge base. Join our community!

Notifications You must be signed in to change notification settings

Kathan-max/RAG-Enhanced-Chatbot-with-LoRA-Fine-Tuning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG-Enhanced-Chatbot-with-LoRA-Fine-Tuning

📌 Overview

RAG-Enhanced-Chatbot-with-LoRA-Fine-Tuning is a Retrieval-Augmented Generation (RAG) based chatbot that leverages external knowledge sources and enhances generation quality using LoRA fine-tuning. It enables efficient domain-specific adaptation of large language models while combining it with semantic search for grounded, accurate, and context-rich responses.

UI

Chat UI

image

Document Ingestion

image

🚀 Key Features

  • 🔍 Retrieval-Augmented Generation (RAG): Combines document retrieval with generative responses for factual accuracy.
  • 🧠 LoRA Fine-Tuning: Efficient fine-tuning of pre-trained models with low resource requirements.
  • 📄 Multi-Format Document Ingestion: Supports PDFs, text files, and scanned documents (via OCR).
  • ⚙️ Modular Pipeline: Separates data ingestion, chunking, embedding, retrieval, and generation for flexibility.
  • 🌐 Custom Knowledge Base: Tailor your chatbot to domain-specific knowledge.

🛠️ Tech Stack

  • Language Models: Hugging Face Transformers (e.g., LLaMA, Qwen2.5VL-7B, etc.)
  • Vector Database: FAISS / Pinecone / Chroma
  • Embeddings: OpenAI / Hugging Face Embedding APIs
  • Fine-Tuning: LoRA (via peft)
  • Backend: Python
  • Parsing Tools: PyMuPDF, pdfminer, pytesseract

📂 Project Structure

RAG-Enhanced-Chatbot-with-LoRA-Fine-Tuning/
├── data_ingestion/          # Document parsing and preprocessing
├── chunking/                # Context-aware document chunking
├── embeddings/              # Embedding generation and storage
├── retriever/               # Vector search and retrieval logic
├── generator/               # LLM generation with context
├── finetuning/              # LoRA fine-tuning scripts
├── api/                     # REST or chat API integration
├── requirements.txt         # Python dependencies
└── README.md                # Project overview and instructions

✅ Use Cases

  • 💬 Customer support chatbots with company-specific knowledge
  • 🧾 Legal or healthcare assistants with regulated document references
  • 📚 Academic or research tools grounded in verified sources
  • 🏢 Enterprise knowledge management bots

🧪 Getting Started

  1. Clone the repository:

    git clone https://github.com/yourusername/RAG-Enhanced-Chatbot-with-LoRA-Fine-Tuning.git
    cd RAG-Enhanced-Chatbot-with-LoRA-Fine-Tuning
  2. Install dependencies:

    pip install -r requirements.txt
  3. Prepare your documents in the /data_ingestion/ directory.

  4. Run the ingestion pipeline to chunk and embed your documents.

  5. Launch the chatbot (with or without an API/UI) and start chatting!


📋 Prerequisites

  • Python 3.8+
  • CUDA-compatible GPU (recommended for LoRA fine-tuning)
  • Sufficient storage for vector embeddings and model weights

🔧 Configuration

Before running the project, configure the following:

  • Set your API keys for embedding services (OpenAI, Hugging Face)
  • Choose your preferred vector database (FAISS for local, Pinecone/Chroma for cloud)
  • Select the base language model for fine-tuning
  • Adjust chunking parameters based on your document types

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.


📞 Support

If you encounter any issues or have questions, please open an issue on GitHub or contact the maintainer.

About

Transform your documents into intelligent conversations. This open-source RAG chatbot combines semantic search with fine-tuned language models (LLaMA, Qwen2.5VL-3B) to deliver accurate, context-aware responses from your own knowledge base. Join our community!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published