π Chat with Multiple PDFs
Chat with your PDFs using AI! A Streamlit-based chatbot that allows you to upload multiple PDF files and ask questions interactively. Built with LangChain, OpenAI embeddings, and FAISS vector store for efficient document retrieval.
π― Features
Upload multiple PDFs at once.
Extracts and processes text from PDFs automatically.
Splits text into chunks for better semantic search.
Conversational retrieval using OpenAI LLMs.
Memory keeps track of chat history for a natural conversation.
Clean, responsive interface with Streamlit.
π Installation
Clone the repository:
git clone https://github.com/Manaskhurana/Python-Multiple-PDF-Chat-Bot.git cd chat-with-pdfs
Create a virtual environment (recommended):
python -m venv venv
Activate the virtual environment:
Windows:
venv\Scripts\activate
Mac/Linux:
source venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Create a .env file in the project root and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
π Running the App
Start the Streamlit app:
streamlit run app.py
Open your browser at http://localhost:8501 .
Usage Steps:
- Upload one or more PDFs in the sidebar.
- Click "Process" to extract and embed text.
- Ask questions in the chat box and get instant AI responses.
- Continue the conversation; chat history is preserved.
π Project Structure chat-with-pdfs/ ββ app.py # Main Streamlit app ββ htmlTemplates.py # Custom HTML templates for chat messages ββ requirements.txt # Python dependencies ββ .env # OpenAI API key (ignored by Git) ββ venv/ # Virtual environment (ignored by Git) ββ README.md
β Dependencies
Python 3.13+
Streamlit
PyPDF2
LangChain
OpenAI
Install all dependencies via:
pip install -r requirements.txt
π Notes
.env
andvenv/
are included in.gitignore
to keep sensitive data and virtual environment out of Git.- Best run locally, but can also deploy on Streamlit Cloud or other hosting platforms.
π License
MIT License Β© 2025 Manas Khurana
β This README is professional, fully formatted, all commands and code blocks are ready for GitHub copy buttons, includes demo video section, screenshots, and step-by-step instructions.