🚀 A comprehensive multi-agent AI system designed to help scale e-commerce businesses through intelligent automation and insights.
This system uses a multi-agent architecture with 4 specialized agents orchestrated through n8n workflows:
📊 Analytics Agent → ⚙️ Operations Agent → 📢 Marketing Agent → 🎯 Strategy Agent
-
📊 Analytics Agent
- Sales trend analysis
- Customer behavior insights
- Inventory alerts
- Performance metrics
-
⚙️ Operations Agent
- Inventory optimization
- Pricing strategies
- Supplier management
- Operational efficiency
-
📢 Marketing Agent
- Campaign creation & optimization
- Content generation
- Social media strategies
- SEO optimization
-
🎯 Strategy Agent
- Growth opportunities analysis
- Market expansion strategies
- Competitive intelligence
- Long-term planning
- Python 3.8+
- Node.js 16+
- npm or yarn
# Install Python dependencies
pip install -r requirements.txt
# Install n8n globally (already done if you followed setup)
npm install -g n8n# Copy environment template
cp .env.example .env
# Edit .env file with your API keys
nano .env./start_n8n.sh- Open browser to:
http://localhost:5678 - Import workflow from:
n8n_workflows/ecommerce-agents-workflow-template.json
./start_api.sh- API available at:
http://localhost:8000 - API docs at:
http://localhost:8000/docs
🕒 Cron Trigger (9 AM Daily)
↓
📊 Analytics Agent (Sales Analysis)
↓
⚙️ Operations Agent (Inventory Check)
↓
📢 Marketing Agent (Campaign Performance)
↓
🎯 Strategy Agent (Growth Recommendations)
↓
📧 Email Report
🌐 Shopify Webhook (New Order)
↓
📊 Analytics Agent (Customer Analysis)
↓
📢 Marketing Agent (Upsell Recommendations)
↓
⚙️ Operations Agent (Inventory Update)
POST /agents/analytics- Analytics processingPOST /agents/operations- Operations optimizationPOST /agents/marketing- Marketing campaignsPOST /agents/strategy- Strategy planning
GET /agents/status- Check agent statusGET /reports/comprehensive- Full business reportGET /health- Health check
curl -X POST "http://localhost:8000/agents/analytics" \
-H "Content-Type: application/json" \
-d '{"action": "daily_analysis", "data": {}}'ecommerce-ai-agents/
├── agents/ # Individual agent implementations
├── config/ # Configuration files
│ └── settings.py # App settings
├── tools/ # Shared tools and utilities
├── workflows/ # Workflow definitions
├── n8n_workflows/ # n8n workflow templates
├── data/ # Data storage
├── tests/ # Test files
├── api_server.py # FastAPI backend server
├── start_n8n.sh # n8n startup script
├── start_api.sh # API server startup script
├── requirements.txt # Python dependencies
├── .env.example # Environment template
└── README.md # This file
- Access n8n: Open
http://localhost:5678in your browser - Import Workflow:
- Click "+" → Import from File
- Select
n8n_workflows/ecommerce-agents-workflow-template.json
- Customize Workflow:
- Add triggers (webhooks, cron jobs)
- Modify agent parameters
- Add integrations (Slack, email, databases)
- Execute Workflow:
- Test with manual triggers
- Enable for production use
Triggers Available:
- ⏰ Cron Scheduler - Daily/weekly analysis
- 🌐 Webhooks - Real-time data from Shopify, etc.
- 📧 Email Triggers - Process email requests
- 📊 HTTP Requests - External system integration
Actions Available:
- 📧 Send Emails - Reports and notifications
- 💬 Slack Messages - Team updates
- 📊 Google Sheets - Data logging
- 🗄️ Database Updates - Store insights
- Shopify: Product data, orders, customers
- WooCommerce: WordPress integration
- Amazon: Marketplace data
- BigCommerce: Enterprise features
- Facebook Ads: Campaign optimization
- Google Ads: Keyword and bid management
- Mailchimp: Email marketing
- HubSpot: CRM integration
- Google Analytics: Website traffic
- Mixpanel: User behavior
- Amplitude: Product analytics
- Create new endpoint in
api_server.py - Add agent to n8n workflow
- Define agent logic and integrations
- Update workflow connections
- Design workflow in n8n visual editor
- Connect to agent endpoints
- Add custom triggers and actions
- Test and deploy
- Daily business summary
- Agent performance metrics
- Workflow execution logs
- Integration status
- Connect to BI tools (Tableau, PowerBI)
- Export data to Google Sheets
- Real-time Slack notifications
pytest tests/black .
flake8 .pip install new-package
pip freeze > requirements.txt- Set production environment variables
- Configure database connections
- Set up monitoring and logging
- Deploy API server with Docker
- Use managed n8n hosting
- Implement load balancing
- Add Redis for caching
- Test the System: Run both servers and test the workflow
- Add Real Integrations: Connect to your Shopify store, analytics
- Customize Agents: Modify agent logic for your business needs
- Expand Workflows: Create specialized workflows for different scenarios
- Add Monitoring: Implement logging and alerting
- Scale Up: Move to production infrastructure
- Check API documentation at
http://localhost:8000/docs - Review n8n workflow execution logs
- Monitor agent responses and errors
- Test individual endpoints before full workflow
Happy Scaling! 🚀
Your multi-agent e-commerce system is ready to help grow your business through intelligent automation and insights.