--- title: AI PDF Q&A Chatbot emoji: 📄 colorFrom: blue colorTo: green sdk: gradio sdk_version: 5.31.0 app_file: app.py pinned: false --- # 📄 AI PDF Q&A Chatbot (RAG System) An AI-powered PDF Question Answering chatbot built using: - LangChain - FAISS - Hugging Face Transformers - FLAN-T5 - Gradio Upload PDF documents and ask questions from them using Retrieval-Augmented Generation (RAG). --- # 🚀 Features ✅ Extract and split document text ✅ Semantic search using embeddings ✅ Retrieval-Augmented Generation (RAG) ✅ Detailed educational answers ✅ Modern Gradio UI --- # 🧠 Model Used ## Text Generation - google/flan-t5-base ## Embeddings - sentence-transformers/all-MiniLM-L6-v2 --- # 📦 Technologies - Python - Gradio - LangChain - FAISS - Transformers - PyTorch --- # ▶️ Run Locally Install dependencies: ```bash pip install -r requirements.txt ``` Run app: ```bash python app.py ``` --- # 🌐 Deploy on Hugging Face Spaces 1. Create a new Space 2. Select: - SDK: Gradio 3. Upload: - app.py - requirements.txt - README.md The app will build automatically. --- # ⚠️ Important Notes - First startup may take time because models download automatically. - CPU Spaces are supported. - No API key required. - Recommended Space Hardware: - CPU Basic or higher --- # 📚 How It Works 1. Upload PDFs 2. Documents are split into chunks 3. Embeddings are generated 4. FAISS stores vectors 5. Relevant chunks are retrieved 6. FLAN-T5 generates detailed answers --- # 👩‍💻 Author Built using Hugging Face + Gradio + LangChain.