This project is an AI-powered product search system designed for the Sri Lankan e-commerce landscape. It uses cutting-edge technologies to deliver personalized shopping experiences, intelligent logistics optimization, and seamless loyalty program integration. The system leverages a LangGraph-based multi-agent architecture enhanced with a Knowledge Graph, real-time web scraping, and intelligent personalization to provide optimal product discovery, smarter recommendations, and improved loyalty optimization.
- β 6-Node Langraph Pipeline with proper execution order
- β Knowledge Graph Enhancement for product discovery
- β Real-time Web Scraping from 3 major Sri Lankan stores
- β GPS-based Logistics Optimization with 27 store locations
- β AI-powered Loyalty Aggregation with LLM recommendations
- β Personalized User Profiles with dietary restrictions & preferences
π User Query β π Keyword Extraction β π Data Acquisition β π€ Personalization β π Logistics Filtering β π³ Loyalty Optimization β π° Budget Optimization β π Output Formatting
| Component | Technology | Purpose |
|---|---|---|
| Langraph Agent | Langraph + Groq LLaMA 3.3 70B | Multi-agent orchestration |
| Web Scraper | Crawl4AI + Requests | Real-time product data |
| Frontend | React/Vue.js | User interface |
| Knowledge Graph | NetworkX | Product relationship mapping |
Multi-Agent-AI-Shopping-Assistant/
βββ π€ Langraph_Agent/ # Main AI pipeline system
β βββ agents/ # Individual agent implementations
β βββ core/ # Core system components
β βββ data/ # Data storage and management
β βββ utils/ # Utility functions
β βββ main.py # Primary orchestrator
βββ π·οΈ Web_scraper/ # Web scraping system
β βββ scrapers/ # Store-specific scrapers
β βββ retrieval/ # Data retrieval logic
β βββ data/ # Scraped product data
βββ π¨ Frontend/ # User interface
βββ π Backend/ # API + server-side logic
- Python 3.10+
- Node.js 16+ (for frontend)
- Git
- Clone the repository
git clone https://github.com/Tech-Titans-AI/Multi-Agent-AI-Shopping-Assistant.git
cd Multi-Agent-AI-Shopping-Assistant- Set up the Langraph Agent
cd Langraph_Agent
pip install -r requirements.txt- Configure environment variables
cp .env.example .env
# Add your Groq API key to .env file
echo "GROQ_API_KEY=your_groq_api_key_here" >> .env- Run the system
python main.py# Test the pipeline
python test_pipeline.py- LLM-powered food item extraction from natural language
- Handles complex queries like "organic rice for diabetic cooking"
- Context-aware product categorization
- Semantic product relationship mapping
- Automatic query expansion (rice β basmati rice, samba rice)
- 15+ product nodes with relationship inference
- Supported Stores: Kapruka, Glowmark, Online Kade
- Dynamic price monitoring
- Automated data freshness validation
- Similarity-based product matching
- User Profiles: Dietary restrictions, budget limits, brand preferences
- Budget Optimization: Smart filtering within price constraints
- Allergy Management: Automatic exclusion of problematic ingredients
- Brand Intelligence: Preferred/disliked brand handling
- 27 Store Locations across Sri Lanka with real coordinates
- Haversine Distance Calculation for delivery optimization
- Location Parsing: Supports city names, addresses, GPS coordinates
- Distance Thresholds: Configurable delivery radius filtering
- 3 Loyalty Programs: Keells, Cargills, Arpico integration
- 4 Bank Partnerships: Commercial Bank, Sampath, HNB, BOC
- 5 Active Promotions: Real-time discount calculations
- LLM Recommendations: AI-powered savings strategies
- Framework: Langraph with StateGraph orchestration
- LLM: Groq LLaMA 3.3 70B Versatile
- Tools: Function calling with JSON mode
- State Management: Typed application state with validation
- Similarity Matching: Cosine similarity for product ranking
- Location Intelligence: Haversine formula for GPS calculations
- Budget Optimization: Multi-constraint filtering algorithms
- Loyalty Calculations: Complex discount optimization
- Pipeline Latency: ~3-5 seconds per query
- Data Freshness: Real-time scraping updates
- Accuracy: 95%+ product matching precision
- Coverage: 27 store locations, 3 major e-commerce platforms
# Full pipeline test
cd Langraph_Agent
python test_pipeline.py
# Web scraper test
cd Web_scraper
python test_migration.py
# Query system test
python test_query_system.py- β Keyword Extraction: Natural language β product items
- β Knowledge Graph: Query enhancement validation
- β Personalization: User profile application
- β Logistics: Distance-based filtering
- β Loyalty: Discount optimization accuracy
- β End-to-End: Complete pipeline execution
- Major Cities: Colombo, Galle, Kandy, Jaffna, Negombo
- GPS Coverage: Island-wide coordinate mapping
- Delivery Zones: Configurable radius-based filtering
- Kapruka.com - Comprehensive product range
- Glowmark.lk - Electronics and lifestyle
- OnlineKade.lk - Grocery and essentials
- Keells Super - Points-based rewards
- Cargills Food City - Membership benefits
- Arpico Supercenter - Tiered discounts
- Parallel Processing: Concurrent agent execution
- Caching: Knowledge graph and store location caching
- Lazy Loading: On-demand data acquisition
- Memory Management: Efficient state handling
- Modular Architecture: Independent agent scaling
- API Integration: RESTful service endpoints
- Database Ready: MongoDB support
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Python: PEP 8 compliance
- Documentation: Comprehensive docstrings
- Testing: Minimum 80% code coverage
- Type Hints: Full type annotation
- Sri Lanka AI Challenge 2025 organizing committee
- Groq for providing LLaMA 3.3 70B API access
- Langchain team for the Langraph framework
- Sri Lankan E-commerce partners for data access
- Open Source Community for inspiration and tools
Built with β€οΈ by Team Tensor Titans for SLAIC 2025
