How hemasree94/chat_with_multiple_pdfs works
This Streamlit app lets a user ask questions about Tesla, Uber, and Google annual-report PDFs. On each run, the app extracts PDF text, chunks it, builds a Chroma vector store, and creates a retrieval-and-answer chain; submitted questions are answered from retrieved context and displayed in the chat. Chat history is held in Streamlit session state. The graph reflects the single sampled source file; internal behavior of the LangChain retrieval components is not independently inspected.
Main entry points: sample.py Streamlit chat
Components 12
Chat interface
- Streamlit chat
sample.py - Chat history
sample.py
PDF ingestion
- Annual report PDFs
- PDF text extraction
sample.py - Text chunking
sample.py - Vector indexing
sample.py - Chroma vector store
sample.py - Hugging Face embeddings
sample.py
Retrieval and answers
- Retrieval chain setup
sample.py - Hugging Face model
- Answer extraction
sample.py
Other components
- User
Connections 14
- User → Streamlit chat: asks question
sample.py - Streamlit chat → Chat history: restores and updates
sample.py - Streamlit chat → PDF text extraction: loads PDFs
sample.py - PDF text extraction → Annual report PDFs: reads pages
sample.py - Streamlit chat → Text chunking: splits text
sample.py - Streamlit chat → Vector indexing: indexes chunks
sample.py - Vector indexing → Hugging Face embeddings: embeds chunks
sample.py - Vector indexing → Chroma vector store: creates store
sample.py - Streamlit chat → Retrieval chain setup: builds chain
sample.py - Retrieval chain setup → Chroma vector store: configures retriever
sample.py - Retrieval chain setup → Hugging Face model: configures model
sample.py - Streamlit chat → Retrieval chain setup: invokes for question
sample.py - Streamlit chat → Answer extraction: extracts response
sample.py - Streamlit chat → User: displays answer
sample.py