SmartPDF QueryBot is a simple AI web app that lets you upload PDF files and ask questions about their content.
It uses Google Gemini (Generative AI) and LangChain to read, understand, and reply based on your PDFs.
- Upload one or more PDFs
- Ask questions in normal language
- AI answers come directly from the document
- Built with Streamlit (easy to use in the browser)
- Uses FAISS for fast search and LangChain for processing
python -m venv venvCreate a requirements.txt file and add:
streamlit
PyPDF2
faiss-cpu
chromadb
python-dotenv
langchain
langchain-text-splitters
langchain-google-genai==2.0.0
google-generativeai==0.7.2
Then install everything:
pip install -r requirements.txtCreate a .env file in your project folder and paste your key:
GOOGLE_API_KEY="your_api_key_here"
Get your key from: https://aistudio.google.com/app/apikey
streamlit run app.py- You upload your PDF files.
- The app reads all the text using PyPDF2.
- The text is split into small parts for easy processing.
- Each part is converted into embeddings (numerical meaning).
- These embeddings are stored in FAISS (a vector database).
- You ask a question → the app searches for relevant parts in your PDF.
- It sends the best parts and your question to Google Gemini AI.
- Gemini generates a clear, context-based answer.
- You see the result instantly in the Streamlit interface.
Upload PDF → Extract Text → Split → Create Embeddings
→ Store in FAISS → Ask Question → Gemini Gives Answer
If you upload a file named Report.pdf and ask:
“What is the summary of this document?”
The bot searches the file and replies with a short summary — taken directly from your PDF content.
SmartPDF QueryBot makes reading PDFs easy and smart.
It turns your documents into a chatbot using Google Gemini, LangChain, and Streamlit.
Just upload, ask, and get your answers instantly.