Retail Insights Assistant is a production-ready GenAI chatbot that enables business users to ask natural language questions about Amazon sales data and receive data-driven insights instantly.
π Live Streamlit App: https://assignmentgenaiweek4.streamlit.app/
The system combines:
- Python + Pandas for analytics
- Google Gemini Pro API for natural language understanding
- Streamlit for an interactive UI
- A scalable architecture design capable of handling 100GB+ datasets
-
Build a GenAI chatbot for business analytics
-
Answer questions like:
- Which region performed best?
- What are top-selling categories?
- What is the cancellation rate?
-
Generate summaries and reports
-
Propose a scalable architecture for large datasets
β Natural-language business queries β Automated sales summaries β Revenue & performance analytics β Interactive Streamlit UI β Gemini AI integration β Scalable design for big data (100GB+)
week4/
β
βββ app.py
βββ streamlit_app.py # Main application
βββ Cleaned_Amazon_Sale_Report.csv
βββ sales_report.json # Precomputed analytics summary
βββ requirements.txt
βββ README.md
βββ Assignment.txt
βββ Scalability Architecture for 100GB.md
β
βββ 1.png # Chat Interface
βββ 2.png # Example AI Answer
βββ 3.png # Sales Summary Output
βββ 4.png # Data Insights Visualization
βββ 5.png # Architecture / Scalability Diagram
| Layer | Technology |
|---|---|
| Language | Python |
| AI Model | Google Gemini Pro |
| UI | Streamlit |
| Analytics | Pandas |
| Visualization | Streamlit charts |
| Big Data (Design) | Spark, BigQuery |
| Deployment (Design) | Kubernetes |
PS> & "C:\Users\SaisrisatyaPadala\Desktop\All Stars Training\week4\week4\Scripts\Activate.ps1"pip install -r requirements.txtCreate a .env file or set environment variable:
GEMINI_API_KEY=AIzaSy*****streamlit run streamlit_app.pyApp opens at: π http://localhost:8501
File: Cleaned_Amazon_Sale_Report.csv
Key Columns:
- Order ID
- Date
- Status
- Category
- Amount
- Quantity
- City, State
- Fulfilled By
- Promotion IDs
- B2B Flag
The dataset is cleaned, normalized, and analysis-ready.
- Which state generated the highest revenue?
- What is the total revenue for April 2022?
- Which category sold the most?
- What is the cancellation rate?
- Compare B2B vs B2C sales
- Show monthly revenue trends
Chat Interface
Shows the main Streamlit UI where:
- User enters business questions
- AI chatbot interaction happens
- Clean and intuitive design
Demonstrates:
- Gemini AI answering a business question
- Clear, structured, business-friendly response
- Metrics-based explanation
Displays:
- Total revenue
- Total orders
- Cancelled orders
- Top states and categories
This summary is generated programmatically and fed to the AI.
Shows:
- Aggregated insights
- Tabular or chart-based analysis
- Useful for decision-makers
Data Insights
Illustrates:
- Cloud-based data ingestion
- Spark processing
- BigQuery storage
- AI query pipeline
- Caching & retrieval layers
When the dataset grows to 100GB or more, a local CSV + Pandas approach is no longer feasible. The system is redesigned using cloud-native big data and AI retrieval patterns.
-
Store raw files in cloud object storage (Google Cloud Storage / AWS S3)
-
Use Apache Spark for distributed preprocessing:
- Data cleaning & validation
- Partitioning by
Year,Month,Region - Aggregation of daily and monthly metrics
-
Save processed data in Parquet / Delta format for efficient reads
-
Load processed data into BigQuery / Snowflake
-
Use:
- Partitioned tables (by date)
- Clustered columns (state, category)
-
Create:
- Aggregated fact tables (revenue, orders, cancellations)
- Dimensional tables (product, geography)
-
Use SQL-based aggregation for structured queries
-
Use LangChain + Retrieval-Augmented Generation (RAG):
- Convert summaries into embeddings
- Store embeddings in FAISS / Pinecone
-
Retrieval Flow:
User Query β Intent Detection
β SQL / Vector Search
β Relevant Summary
β Gemini AI Response
| Layer | Tools |
|---|---|
| Storage | GCS / S3 |
| Processing | Apache Spark / Databricks |
| Analytics | BigQuery / Snowflake |
| AI | Gemini Pro |
| Search | FAISS / Pinecone |
| Orchestration | Airflow |
| Deployment | Docker + Kubernetes |
| Caching | Redis |
- Scales horizontally to 100GB+
- Fast query response times
- Cost-efficient storage
- AI answers remain accurate and grounded
- Production-ready architecture
- Memory limits
- Slow queries
- Not production-ready
Data Ingestion
- Cloud Storage (GCS / S3)
- Batch ingestion
Processing
- Apache Spark / Databricks
- Daily & monthly aggregations
Storage
- BigQuery / Snowflake
- Partitioned tables
AI Query Flow
User Question
β
Intent Detection
β
SQL / Aggregation Query
β
Summary Data
β
Gemini AI
β
Final Answer
Caching
- Redis for frequent queries
Deployment
- Docker + Kubernetes
- Horizontal Pod Autoscaling
β Clean architecture β Clear separation of AI & analytics β Prompt-engineering included β Scales from CSV β Big Data β Real business use case β Fully explainable
β Working GenAI chatbot β Cleaned dataset β Screenshots (1β5) β Scalability architecture document β Complete README β Ready for evaluation
The Retail Insights Assistant demonstrates how Generative AI + Analytics can transform raw sales data into actionable business intelligence, while being scalable, maintainable, and production-ready.






