ChatWithPDF is a Python application that enables AI-powered interactions with multiple PDF documents. Using LangChain for advanced text processing and Retrieval-Augmented Generation (RAG) for context-aware responses, this application provides intelligent answers based on the content of your PDFs.
- AI-Powered Chat:: Users can ask questions about the content of multiple uploaded PDF documents.
- Contextual Responses:: Delivers accurate answers based on the documents' text using LangChain and RAG.
- Efficient Document Processing:: Reads multiple PDFs, extracts text, and embeds it for seamless interactions.
- Text Chunking:: Divides text into manageable chunks for effective processing and retrieval.
- LangChain: Framework for linking the various components of the RAG system.
- Streamlit: For creating the interactive web interface.
- OpenAI API: For generating AI-driven responses.
- Hugging Face (hkunlp/instructor-xl): Embedding functions for accurate information retrieval and Text generation model.
To run this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/chatwithpdfs.git cd chatwithpdfs -
. Install dependencies:
pip install -r requirements.txt
-
Start the development server:
streamlit run app.py
Ensure you have the following environment variables set up:
OPENAI_API_KEYHUGGINGFACEHUB_API_TOKEN
You can set these environment variables in a .env file at the root of your project.
- Load multiple PDF documents into the app by following the provided instructions.
- Ask questions in natural language about the loaded PDFs using the chat interface.
