A comprehensive AI-powered supply chain risk analysis system featuring a complete 7-agent AI pipeline that combines PyTorch machine learning models with real-time external API integration and a modern React frontend.
- Complete AI Agent Pipeline: 7 specialized AI agents for comprehensive risk analysis
- Real-time External API Integration: Gemini AI, SERP API, Weather API, Google Maps
- TGN Model Integration: PyTorch-based risk prediction with fallback mechanisms
- Async Orchestration: Parallel execution of all AI agents for optimal performance
- Real-time Monitoring: Live tracking of supply chain disruptions and alerts
- Interactive Dashboard: Modern React-based interface with real-time updates
- Comprehensive Risk Analysis: Multi-factor risk assessment with actionable insights
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ React Frontend โ โ FastAPI Backend โ โ PyTorch TGN โ
โ (Port 5175) โโโโโบโ (Port 8007) โโโโโบโ (tgn_model.pth)โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ AI Agent โ
โ Orchestrator โ
โ (7 Agents) โ
โโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโผโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ
โ Gemini โ โ SERP API โ โ Weather โ
โ AI API โ โ โ โ API โ
โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ
The system features a complete 7-agent AI pipeline:
- ๐ Trade Agent โ Gemini AI trade flow analysis
- ๐ฐ News Agent โ SERP API โ Web scraping โ Gemini sentiment analysis
- ๐ค๏ธ Weather Agent โ Weather API โ Anomaly detection
- ๐๏ธ Political Agent โ Gemini geopolitical risk assessment
- ๐ GSCPI Agent โ Gemini global supply chain pressure analysis
- โ๏ธ Normalizer Agent โ Feature normalization and scaling
- ๐ค TGN Model โ Trained AI risk prediction
- ๐ Reporter Agent โ Gemini report generation and simplification
- Python 3.13+
- Node.js 16+
- npm or yarn
- API Keys for external services:
- Google Gemini API
- Google Maps API
- SERP API
- Weather API (OpenWeather or WeatherAPI)
git clone https://github.com/iareARiES/LAMDAAnalytics.git
cd LAMDAAnalytics# Install Python dependencies
cd backend
pip install -r requirements.txt
# Configure API keys
cp .env.example .env
# Edit .env with your API keys:
# GOOGLE_MAPS_API_KEY=your_key
# SERP_API_KEY=your_key
# WEATHER_API_KEY=your_key
# GEMINI_API_KEY=your_key
# Start the backend server
python -m uvicorn main:app --host 127.0.0.1 --port 8007The backend will be available at: http://127.0.0.1:8007
# Navigate to frontend directory
cd project2
# Install dependencies
npm install
# Start the development server
npm run devThe frontend will be available at: http://localhost:5175
# Start backend (in one terminal)
python start_backend.py
# Start frontend (in another terminal)
start_frontend.batPOST /analyze- Complete AI agent pipeline analysisGET /model/info- Get TGN model informationGET /health- Health check
GET /monitoring/alerts- Get real-time alertsGET /analytics/overview- Get analytics overview
- Open the Dashboard: Navigate to
http://localhost:5175/dashboard - Configure Analysis:
- Select component type (semiconductors, batteries, etc.)
- Enter seller location (e.g., "Hsinchu, Taiwan")
- Enter import location (e.g., "Los Angeles, USA")
- Enter seller name (e.g., "TSMC")
- Run Analysis: Click "Analyze Supply Chain Risk"
- View Results:
- Risk score and level (0-1 scale)
- Detailed risk factors with percentages
- AI-generated mitigation strategies
- Real-time monitoring data
The system integrates with your PyTorch TGN model (tgn_model.pth) which provides:
- Risk Prediction: Neural network-based risk scoring
- Feature Processing: 7 normalized input features
- Component Analysis: Individual risk factor contributions
- Fallback Mechanism: Weighted scoring when model unavailable
inventory_days: Inventory coverage analysispast_delay_days: Historical delay patternsnews_vol_7d: News volume in last 7 daysneg_tone_frac_3d: Negative sentiment fractionstrike_flag_7d: Labor unrest detectionweather_anomaly_7d: Weather anomaly detectionglobal_risk: Global supply chain pressure
- Real-time News Monitoring: SERP API integration for disruption detection
- Weather Risk Assessment: Climate-based anomaly detection
- Political Risk Evaluation: Geopolitical and sanctions monitoring
- Trade Flow Analysis: Gemini AI-powered trade pattern analysis
- Global Pressure Monitoring: GSCPI integration for macro trends
- Real-time Risk Scoring: Live risk assessment with confidence levels
- Interactive Route Visualization: Supply chain map with risk overlays
- Alert Management: Real-time disruption notifications
- Performance Metrics: Model accuracy and execution times
- Mitigation Strategies: AI-generated actionable recommendations
- Execution Time: ~26 seconds for complete analysis
- Parallel Processing: All 7 agents execute concurrently
- Caching: 15-minute TTL for news and weather data
- Error Handling: Graceful degradation with mock responses
- Scalability: Designed for high-throughput production use
# Test the full AI agent pipeline
python run_orchestrator_realtime.py
# Test individual API connections
python test_google_api.py
# Test with mock data
python test_simple_orchestrator.py# Test the complete analysis endpoint
curl -X POST http://127.0.0.1:8007/analyze \
-H "Content-Type: application/json" \
-d '{
"component_type": "Semiconductor",
"seller_location": "Hsinchu, Taiwan",
"import_location": "Los Angeles, USA",
"seller_name": "TSMC"
}'- Ensure Python dependencies are installed:
pip install -r backend/requirements.txt - Check if model file exists:
tgn_model.pth - Verify API keys are set in
backend/.env - Check if port 8007 is available
- Ensure Node.js dependencies are installed:
npm install - Check if port 5175 is available
- Verify backend is running on port 8007
- Verify all API keys are valid and have proper permissions
- Check API quotas and billing status
- Ensure internet connectivity for external API calls
- Model file should be in the backend directory
- Ensure PyTorch is properly installed
- Check model file integrity
LAMDAAnalytics/
โโโ backend/
โ โโโ main.py # FastAPI server
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # API keys configuration
โ โโโ tgn_model.pth # PyTorch TGN model
โ โโโ config/
โ โ โโโ settings.py # Configuration management
โ โโโ orchestrator/
โ โ โโโ orchestrator.py # Main orchestrator
โ โ โโโ agents/ # AI agent implementations
โ โ โโโ utils/ # Utility functions
โ โโโ models/
โ โโโ tgn_model.py # TGN model wrapper
โโโ project2/
โ โโโ src/
โ โ โโโ Dashboard.jsx # Main dashboard
โ โ โโโ SupplyChainMap.jsx # Route visualization
โ โ โโโ services/
โ โ โโโ api.js # API communication
โ โโโ package.json # Frontend dependencies
โโโ run_orchestrator_realtime.py # Pipeline test script
โโโ test_google_api.py # API testing script
โโโ README.md # This file
- Real-time Data Feeds: Integration with live supply chain data
- Advanced Visualization: 3D route mapping and risk heatmaps
- Machine Learning: Model retraining and improvement
- Multi-language Support: Internationalization
- Mobile App: React Native mobile application
- Blockchain Integration: Supply chain transparency
- IoT Integration: Real-time sensor data
This project is part of the LAMDA Analytics system for supply chain risk management.
- Devansh Behl: Full Stack Development
- Mayan Sharma: AI/ML Engineering
- Aditya Takuli: Data Engineering & Analytics
- Lay Gupta: Product & Business Model
For support or questions:
- API Documentation:
http://127.0.0.1:8007/docs(when backend is running) - GitHub Issues: Create an issue
- Email: mayan25sharma@gmail.com, devanshbhel@gmail.com, layguptamka@gmail.com
Status: โ
Fully Operational with Real API Integration
Last Updated: September 2025
Version: 2.0 - Complete AI Agent Pipeline