A Streamlit application that allows you to chat with your PDF documents using Langchain, OpenAI, and FAISS.
- Upload multiple PDF files.
- Extract text from PDFs.
- Chunk text for efficient processing.
- Create vector embeddings using Hugging Face Instructor models.
- Store embeddings in a FAISS vector store.
- Engage in a conversational chat interface powered by Langchain and OpenAI to ask questions about the PDF content.
All required Python packages are listed in requirements.txt.
pip install -r requirements.txt- Environment Variables:
- This project requires an OpenAI API key.
- Rename
.env.exampleto.env. - Add your OpenAI API key to the
.envfile:OPENAI_API_KEY=your_openai_api_key_here HUGGINGFACEHUB_API_TOKEN=your_huggingface_token_here - You will also need a Hugging Face Hub API token for downloading the embedding model. You can obtain one from the Hugging Face website.
-
Ensure you have installed the requirements and set up the
.envfile. -
Run the Streamlit application:
streamlit run app.py
-
Open your web browser and navigate to the local URL provided by Streamlit (usually
http://localhost:8501). -
Use the sidebar to upload your PDF files.
-
Click the "Process" button to index the documents.
-
Once processing is complete, ask questions about your documents in the chat input field.