How rajumukkell/rag-llm-hdfcmf works
This repository is a facts-only HDFC Mutual Fund FAQ RAG chatbot. The user workflow runs through either the Streamlit UI or CLI: guardrails block PII, advice, and performance queries before retrieval; allowed questions retrieve relevant corpus chunks and produce a cited, length-limited answer. Its knowledge pipeline loads scheme snapshots (or optionally fetches live pages), chunks and embeds them, and persists vectors for retrieval. The README documents the CLI and optional Groq phrasing fallback; source excerpts show Streamlit wiring and retrieval, but not CLI wiring, so that edge is documented. Other relationships are limited to calls visible in excerpts; unsampled ingestion wiring is omitted.
Main entry points: app.py Streamlit UI · index_bootstrap.py Index bootstrap · answer_generator.py Answer generation · retriever.py Semantic retrieval
Components 15
User interfaces
- Streamlit UI
app.py - CLI chat
scripts/run_chat.py
Corpus pipeline
- Scheme loader
src/loader.py - Scheme snapshots
data/raw/text - Public source pages
- Chunking
src/chunker.py - Index bootstrap
src/index_bootstrap.py
Retrieval and answers
- Text embeddings
src/embedder.py - Vector store
src/vector_store.py - Semantic retrieval
src/retriever.py - Answer generation
src/answer_generator.py
Safety controls
- Query guardrails
src/guardrails.py - Product configuration
config.py
Other components
- Questioner
- Groq API
Connections 21
- Questioner → Streamlit UI: asks in
README.md - Questioner → CLI chat: asks in
README.md - Streamlit UI → Query guardrails: checks query
app.py - Query guardrails → Product configuration: uses policy links
src/guardrails.py - Streamlit UI → Semantic retrieval: retrieves via
app.py - Streamlit UI → Answer generation: generates answer
app.py - Streamlit UI → Index bootstrap: ensures index
app.py - Index bootstrap → Scheme loader: loads corpus
src/index_bootstrap.py - Scheme loader → Scheme snapshots: reads snapshots
src/loader.py - Scheme loader → Public source pages: fetches optionally
src/loader.py - Index bootstrap → Chunking: chunks corpus
src/index_bootstrap.py - Index bootstrap → Text embeddings: embeds chunks
src/index_bootstrap.py - Index bootstrap → Vector store: rebuilds index
src/index_bootstrap.py - Semantic retrieval → Text embeddings: embeds query
src/retriever.py - Semantic retrieval → Vector store: queries vectors
src/retriever.py - Answer generation → Chunking: splits sentences
src/answer_generator.py - Answer generation → Groq API: requests phrasing
README.md - Answer generation → Product configuration: uses limits
src/answer_generator.py - Streamlit UI → Product configuration: renders disclaimers
app.py - CLI chat → Query guardrails: checks before retrieval
README.md - CLI chat → Semantic retrieval: retrieves and answers
README.md