How babytaro14/myntra-rag-chatbot works
This is a Streamlit fashion-catalogue RAG chatbot. A shopper submits a question; the app passes it with conversation history and search settings to the RAG core, which interprets the question, retrieves catalogue products, applies relevance and answer-safety checks, and returns a grounded answer with product citations for display. The repository also documents data preparation and index rebuilding. The main stages are supported by the README and excerpts; some internal RAG call details and unsampled subsystems are documented but not directly shown in the excerpts.
Main entry points: index.py Index loading and verification · rag.py RAG answer flow · app.py Streamlit chat · prepare_data.py Catalogue cleaning and enrichment
Components 17
Chat interface
- Streamlit chat
app.py - Product citations and trace
app.py
Question answering
- RAG answer flow
src/rag.py - Question understanding
src/rag.py - Constraint and intent parsing
src/query.py - Hybrid retrieval and ranking
src/rag.py - Relevance and answer checks
src/rag.py
Catalogue and retrieval
- Text cleaning and tokenisation
src/textutil.py - Index loading and verification
src/index.py - Chroma vector index
chroma_db - Cleaned product catalogue
data/processed/products_clean.csv - Models and retrieval settings
src/config.py
Catalogue preparation
- Catalogue cleaning and enrichment
src/prepare_data.py - Index build
src/build_index.py
Other components
- Shopper
- Groq or OpenAI LLM
- Raw fashion catalogue
Connections 23
- Shopper → Streamlit chat: asks
README.md - Streamlit chat → Index loading and verification: loads index
app.py - Streamlit chat → RAG answer flow: submits question
app.py - RAG answer flow → Streamlit chat: returns answer and sources
README.md - Streamlit chat → Product citations and trace: renders citations
app.py - RAG answer flow → Question understanding: interprets question
README.md - Question understanding → Constraint and intent parsing: parses constraints
src/rag.py - RAG answer flow → Hybrid retrieval and ranking: retrieves products
README.md - Hybrid retrieval and ranking → Index loading and verification: searches catalogue
README.md - Hybrid retrieval and ranking → Chroma vector index: semantic search
README.md - Hybrid retrieval and ranking → Index loading and verification: uses BM25 index
src/rag.py - RAG answer flow → Relevance and answer checks: gates and validates
README.md - RAG answer flow → Groq or OpenAI LLM: rewrites or generates
README.md - Index loading and verification → Cleaned product catalogue: loads products
src/index.py - Index loading and verification → Chroma vector index: verifies or rebuilds
src/index.py - Catalogue cleaning and enrichment → Raw fashion catalogue: cleans
README.md - Catalogue cleaning and enrichment → Text cleaning and tokenisation: cleans and sanitises text
src/prepare_data.py - Catalogue cleaning and enrichment → Cleaned product catalogue: writes catalogue
README.md - Index build → Index loading and verification: builds index
src/build_index.py - Index build → Cleaned product catalogue: indexes products
src/build_index.py - Index build → Chroma vector index: writes vectors
README.md - Index loading and verification → Models and retrieval settings: reads settings
src/index.py - Constraint and intent parsing → Text cleaning and tokenisation: uses vocabulary and tokens
src/query.py