An intelligent Sales Bot powered by a Retrieval-Augmented Generation (RAG) pipeline. The project provides a scalable document ingestion framework, dynamic chunking, and an interactive chat interface to answer questions based on the uploaded company or product documents.
- Customizable Chunking Strategies: Choose from Recursive, Sentence, Token, Semantic, and Fixed chunking strategies, and tweak the chunk size and overlap to fit your needs.
- Asynchronous Processing: Documents are processed in the background with real-time progress tracking, allowing you to use the interface uninterrupted.
- Modern React Interface: A sleek, high-end React frontend (Vite) utilizing a modern "Soft UI" design and real-time response streaming via Server-Sent Events (SSE).
- Agentic Capabilities: Leverages Langchain and agent frameworks to route queries effectively, with full Opik observability.
- Advanced Hybrid Retrieval: Uses Qdrant's built-in hybrid search with Reciprocal Rank Fusion (RRF) for dense and sparse vectors, followed by FlashRank reranking for maximum accuracy.
- Frontend: React + Vite (with custom Neumorphic/Glassmorphism CSS)
- Backend: FastAPI (with SSE streaming)
- LLM & RAG Framework: LangChain, LangChain-Groq, Opik (Observability)
- Embeddings & Search:
sentence-transformers, Qdrant (RRF Hybrid Search), FastEmbed, FlashRank - Document Loading:
PyMuPDF
Rag_Chatbot\
├── frontend/ # Modern React/Vite Frontend application
├── app.py # Legacy Streamlit Frontend application
├── main.py # FastAPI Backend entry point (QA_Bot)
├── requirements.txt # Project dependencies
├── .env # Environment variables (OpenAI/Groq keys, etc.)
├── backend/ # FastAPI routers (upload, query, metrics)
├── llm/ # LLM clients and core agent interaction logic
├── rag_pipeline/ # Core RAG components (ingestion, embedding, retrieval)
├── vectordb/ # Vector database storage and operations
├── uploads/ # Temporary storage for uploaded user files
├── utils/ # Helper scripts and utilities
└── logs/ # System and agent execution logs
Ensure you are in the project root directory.
python -m venv venv
# Windows
venv\Scripts\activate
# Unix/MacOS
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory (if not exists) and add your API keys:
OPENAI_API_KEY=your_openai_api_key
GROQ_API_KEY=your_groq_api_key
# Add other necessary keys...To run the application locally, you will need to start both the FastAPI backend and the React frontend. Note: Ensure Qdrant is running locally (e.g., via Docker on port 6334).
Open a terminal, navigate to the project root, and run:
uvicorn main:app --reload --port 8000The API will be available at http://localhost:8000. You can test endpoints via http://localhost:8000/docs.
In a separate terminal, navigate to the frontend directory and run:
npm install
npm run devYour browser will automatically open the Sales Bot interface.
- Open the React web application in your browser.
- In the Upload Documents section, securely upload your data files.
- Select your preferred Chunking Strategy and adjust dimensions if necessary.
- Click Upload and watch the background process smoothly digest the data.
- Head to the Chat with Sales Bot section to start extracting insights and asking domain-specific questions!