Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Conversation

Ask questions about a PDF and get answers grounded in its content.

A Streamlit app that lets you upload one or more PDFs and query them in natural language. Text is extracted, chunked, embedded, and indexed with FAISS; a retrieval-augmented chain answers questions using only the retrieved passages, with conversation memory across turns.

How it works

  1. Extract — text is pulled from every page of the uploaded PDFs (PyPDF2).
  2. Chunk — text is split into overlapping chunks for retrieval (RecursiveCharacterTextSplitter).
  3. Embed & index — chunks are embedded (HuggingFaceInstructEmbeddings) and stored in a FAISS vector store.
  4. Answer — a conversational retrieval chain (LangChain + Google PaLM) answers questions using the most relevant chunks, remembering prior turns in the session.

Setup

pip install -r requirements.txt

Create a .env file with your Google API key:

GOOGLE_API_KEY=your-api-key-here

Run

streamlit run multipdf.py

Stack

  • Streamlit
  • LangChain + Google PaLM (langchain_community.llms.GooglePalm)
  • FAISS (faiss-cpu)
  • PyPDF2
  • HuggingFace Instructor embeddings

License

MIT

About

Ask questions with PDF to find answers from that PDF file

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages