Meet Multi-PDF Chat AI App! 🚀
Chat seamlessly with multiple PDFs using LangChain, Google Gemini Pro, and FAISS Vector DB, deployed effortlessly with Streamlit. Get instant, accurate responses powered by the robust Google Gemini open-source language model. 📚💬
Transform your PDF experience today! 🔥✨
The Multi-PDF's Chat Agent is a Streamlit-based web application designed for interactive conversations with a chatbot. Upload multiple PDF documents, extract text information, train the chatbot with the extracted content, and engage in real-time conversations.
- PDF Loading: Extract text content from uploaded PDF documents.
- Text Chunking: Divide extracted text into manageable chunks for processing.
- Language Model Integration: Generate vector representations (embeddings) of text chunks using LLMs.
- Similarity Matching: Compare your question with text chunks to find the most relevant ones.
- Response Generation: Provide an accurate, contextually relevant response based on the identified chunks.
- Adaptive Chunking: Dynamically adjusts window size and position using sliding window techniques, optimizing data retrieval for fine and coarse contexts.
- Multi-Document QA: Supports single and multi-hop queries across multiple documents.
- File Compatibility: Handles both PDF and TXT files seamlessly.
- LLM Model Compatibility: Compatible with Google Gemini Pro, OpenAI GPT-3, Anthropic Claude, Llama2, and other open-source LLMs.
- Streamlit: Interactive Python web app framework.
- google-generativeai: Powers generative AI capabilities for chatbots.
- python-dotenv: For managing environment variables securely.
- LangChain: Tools for conversational retrieval, embeddings, and vector storage.
- PyPDF2: PDF extraction and manipulation.
- FAISS-CPU: Efficient similarity search for dense vectors.
- LangChain Google GENAI: LangChain integration with Google's generative AI SDK.
- Clone the repository:
git clone https://github.com/alimdsaif3/Multi-PDFs_ChatApp_AI-Agent.git
Install Required Python Packages Use the following command to install all the required dependencies:
pip install -r requirements.txt
Obtain your Google API key from MakerSuite. Create a .env file in the root directory of the project with the following contents:
GOOGLE_API_KEY=
Launch the application using the Streamlit CLI:
streamlit run app.py
Demo App on Streamlit Cloud Explore the app visually using this link:
To Run and Implement on Your System Ensure Prerequisites
Install all required dependencies. Add your Google API key to the .env file (this step is mandatory). Run the Application Execute the following command in your terminal:
streamlit run app.py
The app will open in your default web browser, showcasing the user interface.
Upload PDF Documents
Use the sidebar to upload one or more PDF files. Click on the "Upload your documents here and click on Process" button to process the files. Process and Submit
After uploading, click on the Submit & Process button to begin processing. Ask Questions
Use the chat interface to ask questions in natural language about the uploaded PDFs. Press Enter or click the "Ask" button to submit your queries. Receive Responses
The app will utilize conversational AI to generate accurate, context-based responses. View the chatbot's responses directly in the chat interface.
Distributed under the MIT License. For details, refer to the LICENSE file.
If you like this project, give it a ⭐ on GitHub!