Skip to content

A high-performance AI knowledge base that uses DeepSeek-V3 and Hybrid Search to turn your PDFs and docs into an interactive, real-time chat expert. Built with a FastAPI backend and a premium Glassmorphism UI.

Notifications You must be signed in to change notification settings

Ismail-2001/RAG-Chatbot

Repository files navigation

🧠 DeepSeek RAG Intelligence

Python FastAPI Streamlit LangChain

A high-performance AI knowledge base that uses DeepSeek-V3 and Hybrid Search (Semantic + Keyword) to turn your PDFs and docs into an interactive, real-time chat expert. Built with a decoupled FastAPI backend and a premium Glassmorphism UI.

✨ Unique Features

  • 💎 Premium UI/UX: High-end dark theme with glassmorphism, word-by-word streaming, and fluid animations.
  • 🏗️ Decoupled Architecture: High-performance FastAPI backend to serve any client.
  • 🔍 Hybrid Intelligence: Combines FAISS Semantic Search with BM25 Keyword Search for pinpoint precision.
  • ☁️ Cloud-Native Embeddings: Uses Hugging Face Inference API for lightweight, lightning-fast vectorization.
  • 📄 Full Lifecycle Support: Seamless ingestion of PDF, DOCX, and TXT with robust error handling.

🎯 How It Works

graph TD
    A[Upload Docs 📄] --> B[FastAPI Engine 🏗️]
    B --> C[Hybrid Indexing 🔍]
    C --> D[FAISS + BM25 💾]
    E[User Query ❓] --> F[Cognitive Search 🧠]
    F --> G[DeepSeek LLM 🤖]
    G --> H[Streaming Answer ✨]
Loading

🛠️ Tech Stack

  • Frontend: Streamlit (with custom CSS/HTML injection)
  • Orchestration: LangChain Core / Community
  • LLM: DeepSeek-V3 (via OpenAI-compatible API)
  • Vector Database: FAISS (CPU)
  • Embeddings: Hugging Face Inference API (sentence-transformers/all-MiniLM-L6-v2)
  • Document Processing: PyPDF, python-docx

🚀 Quick Start

1. Prerequisites

2. Installation

# Clone the repository
git clone https://github.com/yourusername/rag-chatbot.git
cd rag-chatbot

# Create a virtual environment
python -m venv .rag_env
.\.rag_env\Scripts\Activate.ps1

# Install dependencies
pip install -r requirements.txt

3. Configuration

Create a .env file in the root directory:

# Required
DEEPSEEK_API_KEY=your_sk_key_here

# Optional: Avoid Hugging Face rate limits
HF_TOKEN=your_hf_token_here

# Optional: Tuning
MAX_CHUNK_SIZE=1000
CHUNK_OVERLAP=200
TEMPERATURE=0.7

4. Run the Application

streamlit run app.py

📂 Project Structure

RAG Chatbot/
├── app.py              # Main UI & Streamlit Logic
├── chatbot.py          # Core RAG Pipeline (The Brain)
├── config/
│   └── settings.py     # Config & Env Var Management
├── utils/
│   ├── document_loader.py  # File Parsing (PDF/DOCX/TXT)
│   ├── text_processor.py   # Recursive Chunking
│   └── embeddings.py       # Cloud API Integration
├── data/
│   └── uploaded_docs/      # Temporary storage for assets
└── chroma_db/              # Local FAISS index persistence

💡 Troubleshooting

  • WinError 1114 (DLL Error): This project is specifically designed to avoid this error by using Cloud Embeddings. Ensure you are not manually trying to load sentence-transformers locally.
  • Rate Limits: If you experience "Model is taking too long" errors, add a free HF_TOKEN from Hugging Face to your .env file.
  • Python Version: This project has been tested and verified on Python 3.14 and Python 3.12.

📜 License

Distributed under the MIT License. See LICENSE for more information.


Built with ❤️ for the AI Community. Enjoy your high-precision RAG system!

About

A high-performance AI knowledge base that uses DeepSeek-V3 and Hybrid Search to turn your PDFs and docs into an interactive, real-time chat expert. Built with a FastAPI backend and a premium Glassmorphism UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages