How akarshvyas/genai-part2-rag-implementation works
This repository contains experiments and a command-line retrieval-augmented generation (RAG) workflow. The clearest end-to-end path is: build a Chroma index from a PDF, then accept a user question, retrieve relevant chunks, construct a context-grounded prompt, and generate an answer with Mistral. Other files indicate web loading and alternative retrieval experiments, but their wiring is not shown. The app module and several retrievers were not sampled, so their roles and relationships remain uncertain.
Main entry points: main.py RAG command loop · create_database.py Index builder · chroma_db Persistent Chroma index · deeplearning.pdf Deep-learning PDF
Components 20
Document indexing
- Deep-learning PDF
document loaders/deeplearning.pdf - Text chunking
create_database.py - OpenAI embeddings
create_database.py - Index builder
create_database.py - Persistent Chroma index
chroma_db
RAG answering
- RAG command loop
main.py - MMR retrieval
main.py - OpenAI embeddings
main.py - Context prompt
main.py - Mistral chat model
main.py - Generated answer
main.py - App module
app.py
Retrieval experiments
- Multi-query experiment
retrievers/multiquery.py - Arxiv retriever
retrievers/arixv.py - MMR experiment
retrievers/mmr.py - Vector-store demo
vector store/DB.py
Document loading
- Web page loader
document loaders/page.py - PDF loader module
document loaders/pdf.py - Apple product page
Other components
- Questioner
Connections 12
- Deep-learning PDF → Index builder: loads from
create_database.py - Index builder → Text chunking: splits documents
create_database.py - Index builder → OpenAI embeddings: embeds chunks
create_database.py - Index builder → Persistent Chroma index: writes index
create_database.py - Questioner → RAG command loop: enters question
main.py - RAG command loop → MMR retrieval: invokes retrieval
main.py - MMR retrieval → Persistent Chroma index: searches index
- RAG command loop → OpenAI embeddings: configures embeddings
main.py - RAG command loop → Context prompt: formats context
main.py - RAG command loop → Mistral chat model: invokes model
main.py - RAG command loop → Generated answer: prints response
main.py - Web page loader → Apple product page: loads page
document loaders/page.py