Multi-Agent E-commerce System in Node.js: Web Scraping with MySQL Integration
Build Multi-Agent E-commerce System with OpenKBS and Claude Code
Prerequisites
1. Install Required Tools
npm i -g @anthropic-ai/claude-code
npm i -g openkbs
2. Setup Local MySQL
mysql -u root -p
CREATE DATABASE demo;
CREATE USER 'demo'@'localhost' IDENTIFIED BY 'demo';
GRANT ALL PRIVILEGES ON demo.* TO 'demo'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 1: Product Search Agent
openkbs create brand-discovery
cd brand-discovery
claude
First, create a brand-discovery agent that starts locally, takes a category as input (e.g., "electronics"), researches the top 3 most popular brands in that category, and when receive the response stores them in my local MySQL (localhost, DB_NAME: demo) with the brand name, description, logo/image, and category association.
Then, create a product-research agent that, for each brand, researches and finds five products, and stores them with the name, price, description, image, and association to the brand.
The flow: Input "electronics" → agent finds brands (e.g., TechCorp, ElectroMax, FutureTech) → stores brands and runs → product agents run simultaneously for all brands → rapidly populates products for the entire category.
What Claude Creates
• Related product-research agent - in
related-agents/
folder• Complete database schemas - with brands and products tables
• Orchestration scripts - that coordinate both agents
• README.md file - with YOUR EXACT setup instructions
Login with CLI:
openkbs login
Follow README.md to setup and start the agents:
open README.md
• Configuring MySQL credentials - Setting up database connection
• Deploying agents - Using
openkbs push
to deploy to cloud• Configuring API Keys - Initializing access between local scripts and cloud agents
• Starting the orchestrator - Running your multi-agent system
When configuring API keys, you'll be prompted with URLs. For each agent:

Monitor Agent Execution in Real-Time

What to Expect: Multi-Agent System in Action
✓ Connected to MySQL database
✓ Running brand discovery agent...
✓ Found 3 brands: TechCorp, ElectroMax, FutureTech
✓ Running product research agents (parallel)
✓ Stored 5 products for TechCorp
✓ Stored 5 products for ElectroMax
✓ Stored 5 products for FutureTech
Complete! Stored 3 brands and 15 products
Note: The exact command and parameters will be in your README.md file.
Understanding the Hierarchical Agent Architecture
┌─────────────────────────────────────┐ │ Orchestration Script (Local) │ │ - Manages database connections │ │ - Coordinates agent execution │ └──────────────┬──────────────────────┘ │ ▼ ┌─────────────────────────────────────┐ │ Brand Discovery Agent (Cloud) │ │ - Searches for top 3 brands │ │ - Extracts brand information │ │ - Returns structured JSON │ └──────────────┬──────────────────────┘ │ ▼ (Parallel Execution) ┌────────┴────────┬────────────┐ ▼ ▼ ▼ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │Product Agent │ │Product Agent │ │Product Agent │ │ (TechCorp) │ │ (ElectroMax) │ │ (FutureTech) │ └──────────────┘ └──────────────┘ └──────────────┘
• Orchestration Script - Local coordinator managing database connections and agent execution
• Brand Discovery Agent - Cloud-based agent that discovers and extracts brand information
• Product Agents - Multiple parallel agents (one per brand) for efficient data collection
• Parallel Execution - All product agents run simultaneously for maximum throughput
• Cloud Jobs - Each agent creates a separate job in the OpenKBS cloud infrastructure
Try It Yourself!
Create a simple ecommerce website using this database
Result: Full E-commerce Website
npm start

