This Streamlit application allows users to interact with PDF documents using conversational AI powered by Gemini and Google's generative AI.
- Upload PDF Files: Users can upload multiple PDF documents.
- Process PDFs: Extracts text from uploaded PDFs and creates text chunks for indexing.
- Search and Chat: Users can ask questions related to the PDF content and receive answers using a combination of FAISS vector search and generative AI.
- Python 3.7+
- Libraries specified in
requirements.txt
- Google API Key configured via environment variable
GOOGLE_API_KEY
-
Clone the repository:
git clone <repository_url> cd <repository_name>
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.env
file in the root directory and add your Google API Key:GOOGLE_API_KEY=<your_google_api_key>
-
Run the application:
streamlit run app.py
-
Interact with the application:
- Upload PDF files using the sidebar.
- Click "Submit & Process" to extract text from PDFs and create vector embeddings.
- Enter a question related to the PDF content in the text input field.
- Click "Ask" to get an answer generated by the Gemini conversational AI model.
This project demonstrates the integration of PDF processing, semantic search using FAISS, and conversational AI with Google's generative models through the Gemini API. It's designed to provide an intuitive interface for querying and retrieving information from uploaded PDF documents.
- Streamlit: Frontend framework for building interactive web applications.
- PyPDF2: Library for reading and manipulating PDF files in Python.
- langchain: Python library for natural language processing tasks.
- Google Generative AI: API used for generating AI responses based on context and questions.