🤖 AI RAG Chatbot (PDF + Conversational UI)
A full-stack Retrieval-Augmented Generation (RAG) Chatbot with an interactive Streamlit user interface, allowing users to upload PDF documents and ask context-aware questions in a chat-style experience.
- PDF-based Question Answering (RAG)
- Context-aware responses using chat history
- Semantic search with vector embeddings
- Accurate answers using retrieved document context
- 💬 Chat-style UI (like ChatGPT)
- 📄 Upload PDF directly from browser
- ⏳ Real-time processing indicator (spinner)
- ⌨️ Typing animation effect for responses
- 🧹 Clear chat button
⚠️ Upload validation (prevents asking before upload)
- FastAPI REST API
- Modular RAG pipeline using LangChain
- Clean answer post-processing
| Layer | Technology |
|---|---|
| Frontend | Streamlit |
| Backend | FastAPI |
| AI Model | OpenAI (gpt-4o-mini) |
| Framework | LangChain |
| Vector DB | FAISS |
| Embeddings | OpenAI Embeddings |
Main Features:
- Upload PDF → Ask Questions → Get AI Answers
- Chat history maintained during session
AI-RAG-Chatbot/
│
├── api/
│ └── main.py # FastAPI backend
│
├── dashboard/
│ └── app.py # Streamlit UI (chat interface)
│
├── rag/
│ └── rag_pipline.py # RAG logic (LangChain)
│
├── data/ # Uploaded PDFs
├── .env
├── requirements.txt
└── README.md
git clone https://github.com/your-username/AI-RAG-Chatbot.git
cd AI-RAG-Chatbot
pip install -r requirements.txt
Create .env file:
OPENAI_API_KEY=your_api_key_here
uvicorn api.main:app --reload
streamlit run dashboard/app.py
POST /upload
POST /ask
- User uploads PDF via Streamlit UI
- Backend processes document → splits into chunks
- Embeddings created using OpenAI
- Stored in FAISS vector database
- User asks question via chat UI
- Relevant chunks retrieved
- LLM generates final answer
1. User interacts with Streamlit UI
2. Streamlit sends request to FastAPI backend
3. FastAPI processes PDF + embeddings
4. Response returned to Streamlit UI
⚠️ FastAPI server must be running first
- End-to-end AI application development
- RAG (Retrieval-Augmented Generation) implementation
- Frontend + Backend integration
- Real-world AI use case (Document QA system)
- API deployment (Render)
- Backend API: (https://ai-rag-chatbot-fastapi.onrender.com)
- User Interface: https://ai-rag-chatbot-streamlit.onrender.com
⚠️ Important: Please run the FastAPI backend first before using the Streamlit app.
Otherwise, the app will not return any responses.
- Multi-PDF support
- Persistent vector DB (Chroma / Pinecone)
- User login system
- Chat history database
- Drag & drop UI
- Open-source LLM support



