Work / Project
PDF chat
Upload one or more PDFs and ask questions about them in plain English. The answers come from the documents themselves, and the chat remembers what you've already asked.
Condition: a language model asked about a document will happily make things up unless it's handed the right passages first.
- Engagement
- Personal project
- My part
- Solo
- Status
- Runs locally; code on GitHub
- Stack
- Python, Streamlit, LangChain, FAISS, sentence-transformers, Ollama or OpenAI, PyPDF2
- Code
- github.com/patrickAdegbesan/PDF_READER


Frames from my demo video, using my own resume as the document.
How it works
- PyPDF2 pulls the text out of each PDF, and it's split into overlapping chunks of about 1,000 characters.
- Each chunk is turned into an embedding with a small sentence-transformers model, which runs locally, and stored in a FAISS index.
- For each question, LangChain's conversational retrieval chain finds the closest chunks and passes them to the model with the conversation so far.
- The model is chosen by configuration: any Ollama model, local or hosted, by default, with OpenAI as an alternative. The embeddings always run locally.
What I'd change
Retrieval narrows what the model sees, but it doesn't make it infallible: in one demo run it mixed up two schools from the resume. Next I'd show the source passage under each answer, so a reader can check it, and build a small set of test questions to measure accuracy before changing the chunking or the model.