A Streamlit-based chatbot that allows you to upload PDF documents and ask questions about their content using Google's Gemini AI.
Try the live app here: NoteBot on Streamlit Cloud
- 📄 Upload and process PDF documents
- 🤖 Ask questions about your PDF content
- 🔍 Semantic search using FAISS vector database
- ✨ Powered by Google Gemini AI
- 💬 Intelligent context-aware responses
- Python 3.8+
- Google AI API Key (Gemini)
- Clone the repository:
git clone https://github.com/ArnavM21git/CHATBOT.git
cd CHATBOT- Create and activate a virtual environment (recommended):
python -m venv venv
# On Windows PowerShell:
.\venv\Scripts\Activate.ps1
# On Windows CMD:
.\venv\Scripts\activate.bat
# On Linux/Mac:
source venv/bin/activate- Install required packages from requirements.txt:
pip install -r requirements.txt- Set up your environment variables:
- Create a
.envfile in the project root - Add your Google AI API key:
GEMINI_API_KEY=your_api_key_here
- Create a
- Run the Streamlit app:
streamlit run ChatBot.py-
Upload a PDF file using the sidebar
-
Ask questions about the PDF content in the text input
-
Get AI-powered answers based on the document context
- PDF Processing: Extracts text from uploaded PDF files
- Text Chunking: Splits text into manageable chunks for processing
- Embedding: Converts text chunks into vector embeddings
- Vector Storage: Stores embeddings in FAISS vector database
- Similarity Search: Finds relevant chunks based on user questions
- Answer Generation: Uses Gemini AI to generate contextual answers
- Chunk Size: 250 characters (adjustable in code)
- Chunk Overlap: 50 characters
- Model: Gemini 2.5 Flash
- Max Output Tokens: 300
- Embedding Model: models/embedding-001
- Vector Database: FAISS
This app is deployed on Streamlit Cloud. To deploy your own version:
- Fork this repository
- Go to share.streamlit.io
- Connect your GitHub account
- Select your forked repository
- Add your
GEMINI_API_KEYin the Secrets section (Settings → Secrets):GEMINI_API_KEY = "your-api-key-here"
- Click Deploy!
Feel free to submit issues and enhancement requests!
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 ArnavM21git
Made with ❤️ using Streamlit and Google Gemini AI