← back to Designer Wallcoverings
DW-Agents/dw-agents/agent-sku/README.md
60 lines
# Agent-SKU: Unified Product Search System
## Overview
Agent-SKU is the central product search and management system for Designer Wallcoverings. It provides unified access to all product data across 110+ vendors through a single PostgreSQL database.
## Features
- 🔍 **Unified Search**: Search products across all vendors
- 📊 **Real-time Data**: Direct PostgreSQL connection for live data
- 🏢 **Vendor Filtering**: Filter products by specific vendors
- 🆕 **Newest Products**: View recently added products
- 📈 **Statistics**: Live stats on vendors, products, and specifications
- 🔗 **API Endpoints**: RESTful API for product queries
## Port
- **Production**: 9877
- **Dashboard**: http://45.61.58.125:9877
## API Endpoints
### Vendors
- `GET /api/vendors` - List all vendors
- `GET /api/vendors/:vendorId/products` - Get products for specific vendor
### Products
- `GET /api/products/search?query=TERM&vendor=ID` - Search products
- `GET /api/products/newest?limit=20` - Get newest products
- `GET /api/stats` - Database statistics
### Health
- `GET /api/health` - Health check endpoint
## Example: Get 5 Newest Kravet Products
```bash
curl http://45.61.58.125:9877/api/vendors/kravet/products?newest=true&limit=5
```
## Database Connection
Connected to PostgreSQL database `dw_unified` with:
- 110+ vendors
- Product specifications
- Dynamic field mapping
- Real-time updates
## Integration with Other Agents
- **Marketing Agent**: Uses product data for campaigns
- **Executive Dashboards**: Shows product metrics
- **Accounting Agent**: Tracks product sales
- **Master Hub**: Central access point
## Recent Kravet Products (Example)
1. W4266.52.0 - Stacked Wp - Slate
2. W3453.13.0 - Kravet Design - W3453-13
3. W3996.135.0 - Kravet Design - W3996-135
4. W4175.330.0 - Kravet Design - W4175-330
5. W3571.335.0 - Niko Mod - Verde
## Maintenance
- Logs: `/root/DW-Agents/logs/agent-sku-*.log`
- Memory: `agent-sku/memory.json`
- PM2 Management: `pm2 restart dw-agent-sku`