Multi-Agent GenAI System for Retail Analytics
A production-ready AI-powered analytics platform that enables natural language querying of retail sales data, automated insight generation, and scalable analytics.
- AI-Powered Q&A - Ask questions in natural language
- Multi-Source Analysis - Combines raw database results with uploaded business reports
- Interactive Analytics - Visual dashboards with Plotly charts
- Flexible Data Upload - Support for CSV, Excel (.xlsx), and JSON
- Report Summarization - Analyze text-based business reports (.txt)
- Architecture Visualization - In-app scalability architecture for 100GB+ scale
- Evaluation Metrics - Monitor AI quality and performance
- Multi-Agent System - 5 specialized AI agents with LangGraph
git clone https://github.com/deepak2233/retaisl_insights_agent.git
cd retaisl_insights_agent
# Create .env file
echo "GOOGLE_API_KEY=your-api-key" > .env
echo "GEMINI_MODEL=gemini-2.5-flash" >> .env
echo "LLM_PROVIDER=google" >> .env
# Run
docker-compose up --buildgit clone https://github.com/deepak2233/retaisl_insights_agent.git
cd retaisl_insights_agent
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Create .env file (same as above)
streamlit run app.pyGet a free Google AI API key at: Google AI Studio
User Question → Query Agent → Data Extraction → Validation → Response Generation → Answer
| Agent | Function |
|---|---|
| Router Agent | Classifies intent and routes to appropriate pipeline |
| Query Agent | Converts natural language to SQL |
| Extraction Agent | Executes SQL on DuckDB |
| Validation Agent | Validates data quality |
| Response Agent | Generates insights from data and reports |
├── app.py # Streamlit UI
├── agents/ # Multi-agent system
│ ├── orchestrator.py # LangGraph workflow
│ ├── query_agent.py # NL to SQL
│ ├── extraction_agent.py
│ ├── validation_agent.py
│ └── response_agent.py
├── utils/ # Utilities
│ ├── data_layer.py # DuckDB integration
│ ├── memory.py # Conversation memory
│ ├── evaluation.py # Quality metrics
│ └── edge_cases.py # Error handling
├── data/ # Data files
├── Dockerfile # Docker config
└── requirements.txt # Dependencies
| Metric | Description |
|---|---|
| Accuracy | SQL query correctness |
| Faithfulness | Response grounded in data |
| Relevance | Answer addresses question |
| Completeness | Full answer provided |
- LangChain + LangGraph - Agent orchestration
- Google Gemini - LLM provider
- DuckDB - Embedded analytics database
- Streamlit - Web UI
- Plotly - Interactive charts
Deepak Yadav
📧 dk.yadav125566@gmail.com
🔗 GitHub
MIT License