How sushmitha-2007/pdf-chat-assistant works
This is a Streamlit PDF chat assistant. A user uploads a PDF, which the app loads, splits, and indexes in Chroma; the resulting retriever supplies context for a prompted Mistral answer to a user question. The app also tracks chat and document state and supports clearing the indexed document. The excerpt documents the MMR configuration and model names, but omits some setup code, so uncertain setup details are not expanded into extra components.
Main entry points: app.py Streamlit app
Components 13
User interface
- Streamlit app
pythoncode/app.py - Chat and document state
pythoncode/app.py - Displayed answer
pythoncode/app.py
PDF ingestion
- PDF loader
pythoncode/app.py - Text splitter
pythoncode/app.py - Chroma vector store
pythoncode/app.py - HuggingFace embeddings
pythoncode/app.py
Retrieval and answers
- MMR retriever
pythoncode/app.py - Chat prompt
pythoncode/app.py - Mistral chat model
pythoncode/app.py
Other components
- User
- Sentence Transformers model
- Mistral service
Connections 18
- User → Streamlit app: uploads PDF
- User → Streamlit app: asks question
- Streamlit app → Chat and document state: updates state
- Streamlit app → PDF loader: loads PDF
- PDF loader → Streamlit app: returns pages
- Streamlit app → Text splitter: splits pages
- Text splitter → Streamlit app: returns chunks
- Streamlit app → Chroma vector store: indexes chunks
- Chroma vector store → HuggingFace embeddings: requests vectors
- HuggingFace embeddings → Sentence Transformers model: uses model
- Streamlit app → MMR retriever: configures MMR
- MMR retriever → Chroma vector store: queries vectors
- Streamlit app → MMR retriever: retrieves context
- Streamlit app → Chat prompt: formats context
- Streamlit app → Mistral chat model: requests answer
- Mistral chat model → Mistral service: calls model
- Mistral chat model → Streamlit app: returns response
- Streamlit app → Displayed answer: renders answer