How saksham20189575/rag-milestone2 works
The product is a facts-only HDFC mutual-fund FAQ assistant. Its main workflow is a user chat request through the web UI and API into classification, scheme/section-aware retrieval, answer generation and validation, then a cited response. A separate offline ingestion workflow refreshes the Groww corpus and Chroma index. Edges are grounded in the shown excerpts, SOURCE INDEX references, or README; some internal wiring and the frontend-to-API boundary are not fully shown.
Main entry points: chat.py Chat endpoints · pipeline.py RAG orchestrator · retriever.py Scheme retriever · groq_client.py Groq client
Components 30
Chat experience
- Chat app
frontend/src/App.tsx - Chat components
frontend/src/components - Chat API client
frontend/src/api/chat.ts
API service
- Chat endpoints
src/api/routes/chat.py - API application
src/api/main.py - Pipeline dependencies
src/api/deps.py - Input sanitization
src/api/sanitize.py - Request rate limit
src/api/rate_limit.py
Answer pipeline
- RAG orchestrator
src/generation/pipeline.py - Intent classifier
src/generation/classifier.py - Answer generator
src/generation/generator.py - Answer validator
src/generation/validator.py - Refusal responses
src/generation/refusal.py - Groq client
src/generation/groq_client.py - Groq rate limiter
src/generation/rate_limiter.py
Corpus ingestion
- Groww fetcher
src/ingestion/fetcher.py - Page parser
src/ingestion/parser.py - Section chunker
src/ingestion/chunker.py - Index builder
src/ingestion/indexer.py - Runtime settings
src/config/settings.py
Retrieval and index
- Text embedder
src/retrieval/embedder.py - Scheme retriever
src/retrieval/retriever.py - Scheme resolver
src/retrieval/scheme_resolver.py - Section router
src/retrieval/section_router.py - Chroma access
src/retrieval/vector_store.py
Other components
- Questioner
- Groq service
- Groww pages
- Chroma index
- Processed corpus
Connections 35
- Questioner → Chat app: asks
frontend/src/App.tsx - Chat app → Chat components: renders
frontend/src/App.tsx - Chat app → Chat API client: sends message
frontend/src/App.tsx - Chat API client → Chat endpoints: posts chat
- API application → Chat endpoints: registers routes
src/api/main.py - Chat endpoints → Request rate limit: checks limit
src/api/routes/chat.py - Chat endpoints → Pipeline dependencies: gets pipeline
src/api/routes/chat.py - Chat endpoints → Input sanitization: sanitizes input
src/api/routes/chat.py - Chat endpoints → RAG orchestrator: answers query
src/api/routes/chat.py - Chat endpoints → Runtime settings: lists schemes
src/api/routes/chat.py - Pipeline dependencies → RAG orchestrator: provides
src/api/deps.py - Chat endpoints → Questioner: returns response
src/api/routes/chat.py - RAG orchestrator → Intent classifier: classifies
src/generation/pipeline.py - RAG orchestrator → Scheme retriever: retrieves facts
src/generation/pipeline.py - RAG orchestrator → Answer generator: generates answer
src/generation/pipeline.py - RAG orchestrator → Answer validator: validates answer
src/generation/pipeline.py - RAG orchestrator → Refusal responses: builds refusal
src/generation/pipeline.py - Intent classifier → Groq client: optional classification
src/generation/classifier.py - Answer generator → Groq client: requests completion
src/generation/generator.py - Groq client → Groq service: calls model
src/generation/groq_client.py - Groq client → Groq rate limiter: checks capacity
src/generation/groq_client.py - Groww fetcher → Groww pages: downloads pages
src/ingestion/fetcher.py - Groww fetcher → Page parser: passes HTML
src/ingestion/parser.py - Page parser → Processed corpus: writes parsed text
src/ingestion/parser.py - Processed corpus → Section chunker: supplies text
- Section chunker → Index builder: provides chunks
src/ingestion/indexer.py - Index builder → Text embedder: embeds chunks
src/ingestion/indexer.py - Index builder → Chroma access: upserts vectors
src/ingestion/indexer.py - Chroma access → Chroma index: opens index
src/retrieval/vector_store.py - Scheme retriever → Scheme resolver: resolves scheme
src/retrieval/retriever.py - Scheme retriever → Section router: routes section
src/retrieval/retriever.py - Scheme retriever → Text embedder: embeds query
src/retrieval/retriever.py - Scheme retriever → Chroma access: gets collection
src/retrieval/retriever.py - Scheme retriever → Chroma index: queries vectors
src/retrieval/retriever.py - Runtime settings → Groq client: configures model
src/generation/groq_client.py