A powerful PDF document interaction tool that allows users to have conversations with their PDF documents using Google's Generative AI (Gemini). Built with Streamlit and LangChain, this application provides an intuitive interface for uploading PDFs and asking questions about their content.
- 📁 Multiple PDF file upload support
- 💬 Interactive chat interface
- 🔍 Intelligent text chunking and processing
- 🧠 Powered by Google's Gemini AI model
- 📊 Vector store implementation using FAISS
- 🎯 Accurate context-based responses
- Python 3.7+
- Google API key for Gemini
- Clone the repository:
git clone <repository-url>
cd pdf-chatbot- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install the required packages:
pip install -r requirements.txt- Create a
.envfile in the root directory and add your Google API key:
GOOGLE_API_KEY=your_api_key_here
streamlit
PyPDF2
langchain
faiss-cpu
google-generativeai
python-dotenv
- Start the application:
streamlit run app2.py-
Open your web browser and navigate to the provided local URL (typically
http://localhost:8501) -
Using the application:
- Upload one or more PDF files using the sidebar
- Click "Submit & Process" to process the documents
- Type your questions in the input field
- Get AI-powered responses based on the content of your PDFs
- PDF Processing: The application extracts text from uploaded PDF files
- Text Chunking: The extracted text is split into manageable chunks
- Vector Storage: Text chunks are converted into vectors using Google's embedding model
- Question Answering: User queries are processed using a conversational chain with Gemini
- Response Generation: The system provides detailed answers based on the PDF content
- Multiple PDF Support: Upload and process multiple PDF documents simultaneously
- Contextual Understanding: The system maintains context while answering questions
- User-Friendly Interface: Clean and intuitive Streamlit-based web interface
- Efficient Processing: Uses FAISS for fast and efficient similarity search
- Smart Chunking: Implements recursive character text splitting for optimal processing
Contributions are welcome! Please feel free to submit a Pull Request.
- Built with Streamlit
- Powered by Google's Generative AI
- Uses LangChain for LLM interactions
- FAISS for vector storage