An AI-powered PDF Question Answering application built using Retrieval-Augmented Generation (RAG). Upload one or multiple PDF documents, ask questions in natural language, and receive context-aware answers powered by Google Gemini, LangChain, and FAISS.
๐ Live Demo: https://ai-pdf-chatbot-2639.streamlit.app/
- ๐ Upload and chat with multiple PDF documents
- ๐ค AI-powered question answering using Google Gemini
- ๐ Semantic search with FAISS vector database
- ๐ง Retrieval-Augmented Generation (RAG) pipeline
- ๐ฌ Supports follow-up questions with conversational query rewriting
- ๐ Displays the source pages used to generate answers
- โก Fast document retrieval using LangChain
- ๐จ Clean and responsive Streamlit interface
- ๐ Secure API key management using Streamlit Secrets
| Category | Technology |
|---|---|
| Language | Python |
| Frontend | Streamlit |
| LLM | Google Gemini |
| Framework | LangChain |
| Vector Database | FAISS |
| PDF Parsing | PyMuPDF |
| Embeddings | Google Gemini Embeddings |
| Environment | python-dotenv |
AI_PDF_Chatbot/
โ
โโโ app.py
โโโ requirements.txt
โโโ .gitignore
โโโ README.md
โ
โโโ assets/
โ โโโ home.png
โ โโโ upload.png
โ โโโ chat.png
โ โโโ sources.png
โ
โโโ utils/
โโโ chatbot.py
โโโ embeddings.py
โโโ pdf_reader.py
โโโ renderer.py
โโโ retriever.py
โโโ text_splitter.py
โโโ vector_store.py
PDF Upload
โ
โผ
Extract Text (PyMuPDF)
โ
โผ
Text Chunking
โ
โผ
Gemini Embeddings
โ
โผ
FAISS Vector Store
โ
โผ
Similarity Search
โ
โผ
Relevant Chunks Retrieved
โ
โผ
Google Gemini
โ
โผ
AI Answer + Source References
git clone https://github.com/Vansh2639/AI_PDF_Chatbot.git
cd AI_PDF_Chatbotpip install -r requirements.txtGOOGLE_API_KEY=YOUR_API_KEYstreamlit run app.pyThe application will open at:
http://localhost:8501
This project is deployed using Streamlit Community Cloud.
https://ai-pdf-chatbot-2639.streamlit.app/
To deploy your own version:
- Fork this repository.
- Connect it to Streamlit Community Cloud.
- Add your API key under App Settings โ Secrets:
GOOGLE_API_KEY = "YOUR_API_KEY"- Deploy.
Try asking:
- What is Object Destructuring?
- Explain Object Destructuring in detail.
- Give me an example of Object Destructuring.
- Summarize this document.
- What are the key points discussed?
- Explain this topic like I'm a beginner.
- What is the difference between dot notation and bracket notation?
- List the important concepts in this chapter.
- OCR support for scanned PDFs
- Highlight answer text inside PDFs
- Export chat history
- Multi-model support
- Citation highlighting
- Dark/Light theme toggle
- Voice input
- Streaming token generation
- Document summarization
- PDF comparison
Some of the major libraries used:
- streamlit
- langchain
- faiss-cpu
- pymupdf
- google-genai
- python-dotenv
Install everything with:
pip install -r requirements.txtVansh Garg
Computer Science Student | AI/ML Enthusiast
GitHub: https://github.com/Vansh2639
LinkedIn: https://www.linkedin.com/in/vansh-garg-2850b332a/
If you found this project useful:
- โญ Star the repository
- ๐ด Fork it
- ๐ Report issues
- ๐ก Suggest new features
Contributions are always welcome!
This project is licensed under the MIT License.



