Skip to content

Sujay-Kathi/Enterprise-Chatbot

Repository files navigation

🚀 Enterprise RAG Chatbot

⚡ Enterprise-grade AI chatbot powered by NVIDIA NIM + Llama 3.1 (8B)

Python FastAPI Streamlit Docker


🧠 Overview

An enterprise-ready Retrieval-Augmented Generation (RAG) chatbot that allows you to:

  • Upload documents 📄
  • Ask intelligent questions 🤖
  • Get context-aware answers 💡

Built using LangChain + NVIDIA NIM (Llama 3.1 8B) with a secure and scalable architecture.


✨ Key Features

🔥 Smart Document QA Upload PDFs & DOCX → get AI-powered answers instantly

🔐 Secure Authentication Email OTP login system using SMTP

🛡️ Content Moderation Filters harmful or inappropriate prompts

High Performance Backend Powered by FastAPI + FAISS vector search

🐳 Docker Ready One-command deployment


🏗️ Tech Stack

🔙 Backend

  • FastAPI
  • LangChain
  • FAISS
  • SentenceTransformers
  • Uvicorn

🎨 Frontend

  • Streamlit
  • HTTPX / Requests

🔐 Security

  • JWT Authentication
  • Email OTP (SMTP)
  • better-profanity

⚙️ Infrastructure

  • Docker
  • Docker Compose

📦 Installation Guide

✅ Prerequisites

Make sure you have:

  • Python 3.11+
  • Git
  • (Optional) Docker Desktop

Also required:

  • NVIDIA NIM API Key
  • Email App Password

⚡ Quick Start

1️⃣ Clone the Repo

git clone https://github.com/Sujay-Kathi/Enterprise-Chatbot.git
cd Enterprise-Chatbot

2️⃣ Setup Environment Variables

cp .env.example .env

Update .env:

NVIDIA_API_KEY=nvapi-xxxx
JWT_SECRET_KEY=your_secret_key

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_app_password

EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
NIM_MODEL=meta/llama-3.1-8b-instruct

▶️ Run the App

🧑‍💻 Option A: Local Development

Terminal 1 – Backend

python -m venv .venv
.venv\Scripts\activate   # Windows

pip install -r backend/requirements.txt
python backend/main.py

Backend → http://localhost:8000


Terminal 2 – Frontend

.venv\Scripts\activate

pip install -r frontend/requirements.txt
streamlit run frontend/app.py

Frontend → http://localhost:8501


🐳 Option B: Docker (Recommended 🚀)

docker-compose up --build

☁️ Option C: Cloud Deployment

  1. Frontend: Deploy the frontend/ folder to Streamlit Cloud.
  2. Backend: Deploy the root directory to Railway or Render.
    • The Procfile and runtime.txt are already included for convenience.
  3. Environment Variables:
    • Set BACKEND_URL in Streamlit Cloud to your deployed backend URL.
    • Set all .env variables in your backend hosting provider.

  1. Open → http://localhost:8501
  2. Login using Email OTP
  3. Upload documents 📂
  4. Ask questions 💬
  5. Get AI answers 🤖

📁 Project Structure

Enterprise-Chatbot/
│
├── backend/        # FastAPI + RAG logic
├── frontend/       # Streamlit UI
├── data/           # Vector DB & uploads
├── docker-compose.yml
└── .env

🤝 Contributing

We love contributions ❤️

# Fork the repo
# Create a new branch
git checkout -b feature/AmazingFeature

# Commit changes
git commit -m "Add AmazingFeature"

# Push
git push origin feature/AmazingFeature

Then open a Pull Request 🚀


⭐ Final Touch

If you like this project:

👉 Star the repo 👉 Share with others 👉 Build something cool


Contributors

Languages