How ryancjc/e-commerce-ai-ml-retention-platform works
This is an e-commerce customer-retention platform: users submit an individual customer for churn scoring, risk classification, SHAP attribution, risk-routed retrieval, and a structured recommendation; they can also inspect population analytics. The frontend calls the FastAPI service, which coordinates analysis and persistence. Major documented capabilities include vector-knowledge ingestion/retrieval and historical analytics. Some subsystem connections are supported by README descriptions or SOURCE INDEX references rather than complete implementation excerpts; uncertain internal details are not expanded.
Main entry points: llm_graph.py Risk-routed workflow · main.py FastAPI endpoints · App.tsx Web application · rag_pipeline.py Knowledge retrieval pipeline
Components 19
User experience
- Web application
frontend/src/App.tsx - Customer analysis
frontend/src/pages/CustomerAnalysis.tsx - Analytics dashboard
frontend/src/pages/GeneralDashboard.tsx - Customer API client
frontend/src/services/customer.ts - Analytics API client
frontend/src/services/analytics.ts
API and analytics
- FastAPI endpoints
api/main.py - Analytics assembly
analytics/service.py - Analytics queries
analytics/queries.py - Supabase database
Churn analysis
- Risk-routed workflow
llm/llm_graph.py - Churn prediction
src/inference/predictor.py - Recommendation schema
llm/schemas.py
Retention knowledge
- Retention query builder
rag/query_builder.py - Knowledge retrieval pipeline
rag/rag_pipeline.py - Vector search retriever
rag/supabase_retriever.py - Knowledge ingestion
rag/supabase_ingest.py - Retention documents
rag/documents
Other components
- Platform user
- Google Gemini
Connections 20
- Platform user → Web application: uses
README.md - Web application → Customer analysis: renders
frontend/src/App.tsx - Web application → Analytics dashboard: renders
frontend/src/App.tsx - Customer analysis → Customer API client: requests analysis
frontend/src/pages/CustomerAnalysis.tsx - Analytics dashboard → Analytics API client: loads analytics
frontend/src/pages/GeneralDashboard.tsx - Customer API client → FastAPI endpoints: calls API
- Analytics API client → FastAPI endpoints: calls API
- FastAPI endpoints → Risk-routed workflow: invokes analysis
api/main.py - FastAPI endpoints → Supabase database: reads and writes
api/main.py - FastAPI endpoints → Analytics assembly: requests dashboard data
api/main.py - Analytics assembly → Analytics queries: calls queries
analytics/service.py - Risk-routed workflow → Churn prediction: scores and explains
llm/llm_graph.py - Risk-routed workflow → Knowledge retrieval pipeline: retrieves by risk
llm/llm_graph.py - Knowledge retrieval pipeline → Retention query builder: builds query
rag/rag_pipeline.py - Knowledge retrieval pipeline → Vector search retriever: searches knowledge
rag/rag_pipeline.py - Vector search retriever → Supabase database: vector similarity search
rag/supabase_retriever.py - Knowledge ingestion → Retention documents: chunks and embeds
README.md - Knowledge ingestion → Supabase database: stores vectors
README.md - Risk-routed workflow → Google Gemini: generates recommendation
README.md - Risk-routed workflow → Recommendation schema: formats output
llm/llm_graph.py