How chandana2556/chat-with-pdfs works
Chat with PDFs is a Streamlit application for indexing uploaded PDFs and answering questions with retrieved document context and page citations. The principal workflow runs from upload and page extraction through chunking, local embeddings, FAISS retrieval, and a configurable LLM response; session chat history and source citations are presented in the UI. The graph follows documented architecture and sampled call sites; provider selection is explicit in source, while vector-store persistence helpers are present but no app-level save/load invocation is shown.
Main entry points: rag_pipeline.py RAG pipeline · app.py Streamlit UI · llm.py Answer generation · vector_store.py FAISS vector store
Components 16
Chat interface
- Streamlit UI
app.py - Session chat
app.py - Uploaded PDFs
data/uploads
PDF indexing
- Page extraction
src/pdf_processor.py - Chunk splitting
src/text_splitter.py - Local embeddings
src/embeddings.py - FAISS vector store
src/vector_store.py
Search and generation
- RAG pipeline
src/rag_pipeline.py - Chunk retrieval
src/retriever.py - Answer generation
src/llm.py
Models and storage
- App configuration
src/config.py - Saved index
vectorstore - Anthropic API
- OpenAI API
- Gemini API
Other components
- PDF user
Connections 21
- PDF user → Streamlit UI: uploads, asks
- Streamlit UI → Uploaded PDFs: writes files
- Streamlit UI → RAG pipeline: processes PDFs
- Streamlit UI → RAG pipeline: submits question
- Streamlit UI → Session chat: updates history
- Session chat → Streamlit UI: supplies history
- RAG pipeline → Page extraction: extracts pages
- Page extraction → Chunk splitting: passes page text
- RAG pipeline → Chunk splitting: splits pages
- RAG pipeline → FAISS vector store: builds index
- FAISS vector store → Local embeddings: gets model
- RAG pipeline → Chunk retrieval: requests chunks
- Chunk retrieval → FAISS vector store: searches index
- RAG pipeline → Answer generation: generates answer
- Answer generation → Anthropic API: calls when selected
- Answer generation → OpenAI API: calls when selected
- Answer generation → Gemini API: calls when selected
- App configuration → Local embeddings: sets model
- App configuration → Answer generation: selects provider
- FAISS vector store → Saved index: saves or loads
- RAG pipeline → Streamlit UI: returns answer, citations