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.
- 💎 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.
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 ✨]
- 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
- Python 3.10 - 3.14
- DeepSeek API Key (Get it here)
# 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.txtCreate 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.7streamlit run app.pyRAG 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
- 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-transformerslocally. - Rate Limits: If you experience "Model is taking too long" errors, add a free
HF_TOKENfrom Hugging Face to your.envfile. - Python Version: This project has been tested and verified on Python 3.14 and Python 3.12.
Distributed under the MIT License. See LICENSE for more information.
Built with ❤️ for the AI Community. Enjoy your high-precision RAG system!