An interactive Streamlit application that lets you upload a PDF, embed its contents using OllamaEmbeddings, and ask context-aware questions using a conversational AI powered by phi.
- π Upload and parse PDFs
- π Intelligent chunking of PDF content
- π§ Embedding with
OllamaEmbeddings(LLM:phi) - πΎ Persistent
Chromavector store for fast retrieval - π€ LLM-powered question answering using
RetrievalQA - π¬ Stateful conversation with memory
- πΌοΈ Chat UI with streaming responses and typing animation
- π§ Robust error handling and logging
- Python
- Streamlit
- LangChain
- Ollama (local LLM server)
- ChromaDB
- PyPDFLoader
# Clone the repository
git clone https://github.com/siddharth-coder8/PDF-CHAT-PROJECT
cd PDF-CHAT-PROJECT
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt- Python 3.8+
- Ollama running locally (tested with model
phi) - Required ports open (
http://localhost:11434for Ollama) - PDFs to test with
.
βββ files/ # Uploaded PDFs
βββ jj/ # Chroma vector store
βββ main.py # Main Streamlit app
βββ requirements.txt
βββ README.md-
Start the Ollama server:
ollama run phi
-
Run the app:
streamlit run main.py
-
Upload a PDF and start chatting!
-
If you see connection errors:
- Make sure Ollama is running at
http://localhost:11434 - Ensure the
phimodel is downloaded
- Make sure Ollama is running at
-
Logs are printed to the terminal via
logging