How yash-anpat/ai-document-assistant works
This is a Streamlit PDF question-answering app. Users upload a PDF, which the RAG engine extracts, chunks, embeds, and indexes; questions are answered from retrieved passages using Groq-hosted GPT-OSS, with page references shown in the chat. Components are divided by interface, document indexing, and question answering. The README documents the major capabilities; the sampled source shows their implementation and call relationships.
Main entry points: rag_pipeline.py RAG engine · app.py Streamlit chat
Components 15
Chat interface
- Streamlit chat
app.py - Chat session
app.py - Source display
app.py
Document indexing
- RAG engine
rag_pipeline.py - PDF extraction
rag_pipeline.py - Text chunking
rag_pipeline.py - Semantic embeddings
rag_pipeline.py - Sentence Transformers
- Chunk metadata
rag_pipeline.py - FAISS index
rag_pipeline.py
Question answering
- Similarity retrieval
rag_pipeline.py - Grounded prompt
rag_pipeline.py - Groq inference
- Answer and sources
rag_pipeline.py
Other components
- User
Connections 20
- User → Streamlit chat: uploads or asks
app.py - Streamlit chat → Chat session: updates
app.py - Streamlit chat → RAG engine: builds index
app.py - RAG engine → PDF extraction: extracts pages
rag_pipeline.py - RAG engine → Text chunking: splits text
rag_pipeline.py - RAG engine → Semantic embeddings: encodes chunks
rag_pipeline.py - Semantic embeddings → Sentence Transformers: encodes text
rag_pipeline.py - RAG engine → Chunk metadata: stores chunks
rag_pipeline.py - RAG engine → FAISS index: adds embeddings
rag_pipeline.py - Streamlit chat → RAG engine: generates answer
app.py - RAG engine → Similarity retrieval: retrieves context
rag_pipeline.py - Similarity retrieval → Semantic embeddings: encodes query
rag_pipeline.py - Similarity retrieval → FAISS index: searches vectors
rag_pipeline.py - Similarity retrieval → Chunk metadata: reads chunks
rag_pipeline.py - RAG engine → Grounded prompt: builds prompt
rag_pipeline.py - Grounded prompt → Groq inference: sends context
rag_pipeline.py - RAG engine → Answer and sources: returns response
rag_pipeline.py - Answer and sources → Streamlit chat: displays answer
app.py - Answer and sources → Source display: provides citations
app.py - Source display → Chat session: renders history
app.py