How aditya-raj52/insurance-rag works
This is a Streamlit insurance-policy Q&A app. Users upload a PDF for extraction, chunking, embedding, and local persistence; they then ask a question and receive a grounded answer with page citations. The graph separates the interface, document indexing, and retrieval/answering. Source excerpts show the principal calls and storage behavior; the README is empty, so no additional documented capabilities are available.
Main entry points: rag_engine.py Grounded answer · app.py PDF upload
Components 16
User interface
- PDF upload
app.py - Question input
app.py - Answer and citations
app.py
Document indexing
- PDF ingestion
rag_engine.py - Page extraction
rag_engine.py - Text chunking
rag_engine.py - Text embeddings
rag_engine.py - JSON vector store
rag_engine.py
Retrieval and answering
- Chunk retrieval
rag_engine.py - Cosine scoring
rag_engine.py - Relevance guardrail
rag_engine.py - Model selection
rag_engine.py - Grounded answer
rag_engine.py
Other components
- User
- FastEmbed model
- Groq API
Connections 19
- User → PDF upload: uploads PDF
app.py - PDF upload → PDF ingestion: starts ingestion
app.py - User → Question input: enters question
app.py - Question input → Grounded answer: asks
app.py - PDF ingestion → Page extraction: extracts pages
rag_engine.py - PDF ingestion → Text chunking: chunks text
rag_engine.py - PDF ingestion → Text embeddings: embeds chunks
rag_engine.py - Text embeddings → FastEmbed model: creates vectors
rag_engine.py - PDF ingestion → JSON vector store: saves records
rag_engine.py - Chunk retrieval → JSON vector store: reads records
rag_engine.py - Chunk retrieval → Text embeddings: embeds query
rag_engine.py - Chunk retrieval → Cosine scoring: scores chunks
rag_engine.py - Grounded answer → Chunk retrieval: retrieves context
rag_engine.py - Grounded answer → Relevance guardrail: checks relevance
rag_engine.py - Grounded answer → Model selection: selects model
rag_engine.py - Model selection → Groq API: lists models
rag_engine.py - Grounded answer → Groq API: requests completion
rag_engine.py - Grounded answer → Answer and citations: returns answer and sources
app.py - Answer and citations → User: shows citations
app.py