How anujsoni9450/ai-pdf-assistant-llama3 works
This is a Streamlit PDF question-answering app. A user uploads a PDF, the app saves it and indexes its text as embedded chunks in a local Chroma database. For questions, the app builds a retriever-backed RAG chain, which supplies relevant chunks to a Groq language model and displays the answer. The excerpts show the main calls and storage configuration; some framework-internal retrieval and service behavior is not shown.
Main entry points: app.py Streamlit app · generator.py RAG chain · ingestion.py PDF loader · retrieval.py Retriever
Components 11
User interface
- Streamlit app
app.py
PDF indexing
- PDF loader
src/ingestion.py - Text chunking
src/ingestion.py - Embeddings
src/ingestion.py - Chroma store
src/ingestion.py
Question answering
- Retriever
src/retrieval.py - RAG chain
src/generator.py - Answer prompt
src/generator.py - Groq LLM
src/generator.py
Other components
- User
- Groq service
Connections 14
- User → Streamlit app: uploads PDF, asks
app.py - Streamlit app → PDF loader: indexes PDF
app.py - PDF loader → Text chunking: loads documents for
src/ingestion.py - Text chunking → Embeddings: embeds chunks for
src/ingestion.py - Embeddings → Chroma store: stores vectors in
src/ingestion.py - Streamlit app → Retriever: gets retriever
app.py - Retriever → Chroma store: opens persistent store
src/retrieval.py - Streamlit app → RAG chain: creates chain with retriever
app.py - RAG chain → Answer prompt: creates document-answer chain
src/generator.py - RAG chain → Groq LLM: configures chain with
src/generator.py - Groq LLM → Groq service: calls model
- Streamlit app → RAG chain: invokes with question
app.py - RAG chain → Streamlit app: returns answer
app.py - Streamlit app → User: displays answer
app.py