How jimjyothish-dotcom/rag-transformer-qa works
This repository is a small RAG application for answering questions grounded in the Transformer paper. Users ask through either the Streamlit interface or the CLI; each builds a retrieval-and-generation chain that retrieves paper chunks, prompts Gemini, and returns an answer. Separate scripts load and chunk the PDF and persist embeddings in ChromaDB. The README documents the major stages; the sampled code confirms both query entry points and the indexing script. Some retrieval behavior is provided by LangChain and Chroma rather than repository-defined modules.
Main entry points: rag_query.py Top-3 retrieval · rag_app.py Streamlit chat · embed_and_store.py Indexing script · transformer_paper.pdf Transformer paper
Components 14
Question interfaces
- Streamlit chat
rag_app.py - CLI questions
rag_query.py - Grounded answer
Document indexing
- Indexing script
embed_and_store.py - PDF loading
embed_and_store.py - Text chunking
embed_and_store.py - Gemini embeddings
Retrieval and answering
- Top-3 retrieval
rag_query.py - Context prompt
rag_query.py - Gemini answer model
- Answer parser
rag_query.py
Persistent data
- Chroma vector store
Other components
- Question asker
- Transformer paper
transformer_paper.pdf
Connections 20
- Question asker → Streamlit chat: asks via
- Question asker → CLI questions: asks via
- Transformer paper → PDF loading: loads pages
- Indexing script → PDF loading: loads
- PDF loading → Text chunking: splits pages
- Indexing script → Gemini embeddings: embeds chunks
- Indexing script → Chroma vector store: writes vectors
- Gemini embeddings → Chroma vector store: provides vectors
- Streamlit chat → Transformer paper: loads at setup
- CLI questions → Transformer paper: loads at startup
- Streamlit chat → Top-3 retrieval: invokes chain
- CLI questions → Top-3 retrieval: invokes chain
- Top-3 retrieval → Chroma vector store: searches chunks
- Top-3 retrieval → Gemini embeddings: embeds question
- Top-3 retrieval → Context prompt: supplies context
- Context prompt → Gemini answer model: sends prompt
- Gemini answer model → Answer parser: returns response
- Answer parser → Grounded answer: extracts text
- Grounded answer → Streamlit chat: displays
- Grounded answer → CLI questions: prints