Skip to content

Ismail-2001/E-commerce-Automation-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– AutoAgent

The AI-Powered E-commerce Operating System


React TypeScript Google Gemini Supabase Recharts Vite Netlify License: MIT


"It's not just a dashboard. It's a digital workforce that never sleeps."

AutoAgent is a next-generation e-commerce intelligence platform that deploys a fleet of specialized AI agents to autonomously manage inventory, recover abandoned revenue, process orders intelligently, and answer business questions through a conversational multimodal interface.

๐ŸŒ Live Demo ยท ๐Ÿš€ Features ยท ๐Ÿ—๏ธ Architecture ยท โšก Quick Start


๐Ÿ“Œ The Problem

Running an e-commerce operation means drowning in operational overhead:

  • Abandoned carts silently drain 70%+ of potential revenue โ€” and no one sends the right email at the right time
  • Dead stock ties up capital while low stock causes lost sales, both requiring constant manual monitoring
  • Order communications (VIP thank-yous, return risk outreach, shipping updates) are repetitive yet critical
  • Business questions ("What's my best-selling product this week?") require navigating 3 different tools to answer

AutoAgent collapses all of this into a single, AI-native command center.


๐Ÿš€ Key Features

๐Ÿ›’ Abandoned Cart Recovery Agent

The revenue rescue engine. AutoAgent continuously monitors cart activity and triggers intelligent recovery sequences:

  • Intelligent Detection: Automatically flags carts that have gone cold, ranked by recovery potential
  • Adaptive Strategy based on cart value:
    • High-Value Carts (> $100) โ†’ Generates a personalized, exclusive 15% discount code to overcome hesitation
    • Standard Carts โ†’ Crafts urgency-driven copy focused on product value and FOMO
  • One-Click Dispatch: Drafts a complete, personalized recovery email and sends it instantly โ€” no copy-paste needed
  • Recovery Tracking: Carts are tagged recovered once actioned, giving a clean pipeline view

๐Ÿ“ฆ Inventory Commander

Transforms passive inventory tables into an active intelligence layer:

  • Dead Stock Analysis: Flags products with declining velocity and automatically drafts Flash Sale campaigns to liquidate stock and free up cash flow
  • Low Stock Alerts: Detects SKUs approaching critical thresholds and generates ready-to-send vendor reorder requests with quantity recommendations
  • Visual Product Cards: Rich, interactive card UI replaces static tables โ€” each card shows stock level, status badge, last sold date, and available actions at a glance
  • Stock Status Classification: Products are continuously classified as In Stock / Low Stock / Out of Stock based on live inventory data

๐Ÿงพ Smart Order Processor

Turns order fulfillment into a relationship-building engine:

  • VIP Recognition: Detects high Lifetime Value (LTV) customers โ€” defined by multi-item, high-value orders โ€” and auto-drafts personalized "Thank You" notes to deepen loyalty
  • Return Risk Management: When a return is processed, AutoAgent proactively drafts a retention email designed to address the likely root cause and reduce churn
  • Fulfillment Updates: Automates shipping status communications for pending and in-transit orders, keeping customers informed without manual effort
  • Order Status Board: Full order panel with status filters (Pending, Shipped, Delivered, Returned) and one-click AI actions on each

๐Ÿ’ฌ AutoAgent Command Center

A multimodal AI chat interface that acts as your always-on business analyst:

  • Context-Aware Conversations: The AI has full awareness of your live inventory levels, order statuses, and sales trends โ€” ask it anything
  • Rich UI Widgets: Unlike generic chatbots, AutoAgent renders visual Product Cards, Order Summaries, and Action Buttons directly inside the chat thread โ€” results you can act on, not just read
  • Agentic Tool Calls: The AI can query inventory, flag orders for action, and surface recommendations all within a single conversation turn
  • Markdown Rendering: Responses support full GFM (tables, code blocks, lists) via react-markdown + remark-gfm

๐Ÿ“Š Executive Briefing Room

The command center home screen:

  • Weekly Revenue Chart: Recharts-powered bar graph showing daily revenue and units sold for the past 7 days
  • KPI Strip: Live counters for Total Revenue, Orders Processed, Active Alerts, and Recovery Rate
  • Alert Feed: Consolidated live feed of inventory warnings and cart recovery opportunities across the store

๐Ÿ› ๏ธ Tech Stack

Category Technology Version Purpose
UI Framework React 19.2 Component-based UI with concurrent rendering
Language TypeScript 5.8 Full type safety across agents, services, and UI
AI Core Google Gemini (@google/genai) 1.30 LLM powering all agent reasoning and generation
Database Supabase (@supabase/supabase-js) 2.91 PostgreSQL backend for real-time data persistence
State Management Zustand 5.0 Lightweight global state for UI and data layers
Charts Recharts 3.5 Declarative, composable analytics visualizations
Date Utilities date-fns 4.1 Lightweight, tree-shakeable date handling
Icons Lucide React 0.555 Consistent, accessible SVG icon system
Markdown react-markdown + remark-gfm 10.x Rich text rendering in the chat interface
Build Tool Vite 6.2 Sub-second HMR dev server and optimized builds
Deployment Netlify โ€” Zero-config static site delivery with CDN

๐Ÿ—๏ธ Architecture

AutoAgent is built on a services-layer + component-layer separation. UI components never call the AI directly โ€” they delegate to purpose-built agent services that encapsulate all business logic and LLM prompting.

AutoAgent Application
โ”‚
โ”œโ”€โ”€ ๐Ÿงฉ UI Layer (components/)
โ”‚   โ”œโ”€โ”€ Layout.tsx           # App shell, sidebar navigation, view router
โ”‚   โ”œโ”€โ”€ Dashboard.tsx        # Executive Briefing Room โ€” KPIs, charts, alerts
โ”‚   โ”œโ”€โ”€ Inventory.tsx        # Inventory Commander โ€” product cards, stock alerts
โ”‚   โ”œโ”€โ”€ Orders.tsx           # Smart Order Processor โ€” order board, VIP actions
โ”‚   โ”œโ”€โ”€ RecoveryAgent.tsx    # Abandoned Cart Recovery โ€” cart pipeline, email drafts
โ”‚   โ””โ”€โ”€ ChatAgent.tsx        # AutoAgent Command Center โ€” multimodal AI chat, widgets
โ”‚
โ”œโ”€โ”€ ๐Ÿค– Agent Services Layer (services/)
โ”‚   โ”œโ”€โ”€ geminiService.ts     # Gemini API client โ€” base LLM call abstraction
โ”‚   โ”œโ”€โ”€ aiService.ts         # General AI service โ€” chat routing, context injection
โ”‚   โ”œโ”€โ”€ recoveryAgent.ts     # Cart recovery logic โ€” value segmentation, email generation
โ”‚   โ”œโ”€โ”€ inventoryAgent.ts    # Inventory intelligence โ€” dead stock, reorder drafting
โ”‚   โ””โ”€โ”€ orderAgent.ts        # Order intelligence โ€” VIP detection, retention emails
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ Shared Types (types.ts)
โ”‚   โ””โ”€โ”€ Product, Order, Cart, ChatMessage, SalesData, ViewState
โ”‚
โ””โ”€โ”€ ๐Ÿ“Š Mock Data (constants.ts)
    โ””โ”€โ”€ MOCK_PRODUCTS, MOCK_ORDERS, MOCK_CARTS, SALES_DATA

Data Flow

User Action (e.g., "Recover this cart")
        โ”‚
        โ–ผ
  UI Component (RecoveryAgent.tsx)
        โ”‚
        โ–ผ
  Agent Service (recoveryAgent.ts)
  โ”œโ”€โ”€ Segments cart by value (> $100 = VIP tier)
  โ”œโ”€โ”€ Builds context-rich prompt with cart data
  โ””โ”€โ”€ Calls Gemini API via geminiService.ts
        โ”‚
        โ–ผ
  Gemini LLM Response
        โ”‚
        โ–ผ
  Parsed & Typed Output โ†’ Rendered in UI
  (Email draft displayed, action button activated)

โšก Quick Start

Prerequisites

  • Node.js 18+ and npm 9+
  • A Google Gemini API Key (free tier available at ai.google.dev)
  • (Optional) A Supabase project for real data persistence

Installation

# 1. Clone the repository
git clone https://github.com/Ismail-2001/E-commerce-Automation-Agent.git
cd E-commerce-Automation-Agent

# 2. Install all dependencies
npm install

# 3. Configure environment variables
cp .env.example .env

Edit .env and add your credentials:

# Required โ€” Google Gemini AI Core
VITE_GEMINI_API_KEY=your_gemini_api_key_here

# Optional โ€” Supabase for real data persistence
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key_here
# 4. Start the development server
npm run dev

The app will be live at http://localhost:5173 ๐Ÿš€

Available Scripts

Script Command Description
Dev Server npm run dev Vite HMR dev server on port 5173
Production Build npm run build TypeScript compile + Vite bundle
Preview Build npm run preview Locally serves the production bundle

๐Ÿ“‚ Project Structure

E-commerce-Automation-Agent/
โ”‚
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ Layout.tsx           # App shell, sidebar, navigation state
โ”‚   โ”œโ”€โ”€ Dashboard.tsx        # Home โ€” KPIs, Recharts revenue graph, alerts
โ”‚   โ”œโ”€โ”€ Inventory.tsx        # Product cards, stock status, AI actions
โ”‚   โ”œโ”€โ”€ Orders.tsx           # Order board with status filters and AI tools
โ”‚   โ”œโ”€โ”€ RecoveryAgent.tsx    # Cart recovery pipeline and email composer
โ”‚   โ””โ”€โ”€ ChatAgent.tsx        # Multimodal AI chat with rich widget rendering
โ”‚
โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ geminiService.ts     # Base Gemini API client and call abstraction
โ”‚   โ”œโ”€โ”€ aiService.ts         # Context-aware AI routing for the chat interface
โ”‚   โ”œโ”€โ”€ recoveryAgent.ts     # Cart segmentation + recovery email generation
โ”‚   โ”œโ”€โ”€ inventoryAgent.ts    # Dead stock detection + reorder request drafting
โ”‚   โ””โ”€โ”€ orderAgent.ts        # VIP detection + retention email generation
โ”‚
โ”œโ”€โ”€ App.tsx                  # Root component and view state management
โ”œโ”€โ”€ types.ts                 # Shared TypeScript interfaces (Product, Order, Cart...)
โ”œโ”€โ”€ constants.ts             # Mock seed data for development
โ”œโ”€โ”€ index.tsx                # React DOM entry point
โ”œโ”€โ”€ index.html               # HTML shell
โ”œโ”€โ”€ netlify.toml             # Netlify deployment configuration
โ”œโ”€โ”€ vite.config.ts           # Vite build and plugin configuration
โ””โ”€โ”€ package.json             # Dependencies and scripts

๐ŸŒ Deployment

Deploy to Netlify (Recommended)

The project ships with a pre-configured netlify.toml. Deployment is one command.

Via Netlify UI:

  1. Push to GitHub
  2. Go to Netlify โ†’ Add new site โ†’ Import from GitHub
  3. Select your fork โ€” Netlify auto-detects the build config:
    • Build Command: npm run build
    • Publish Directory: dist
  4. Add environment variables in Site Settings โ†’ Environment Variables
  5. Click Deploy โœ…

Via Netlify CLI:

npm install -g netlify-cli
netlify login
npm run build
netlify deploy --prod --dir=dist

๐Ÿ”ฎ Roadmap

โœ… Phase 1 โ€” Core Platform (Complete)

  • Agentic cart recovery with adaptive value-based strategy
  • Inventory dead stock detection and flash sale drafting
  • Low stock alerts with reorder request generation
  • VIP order recognition and personalized outreach
  • Return risk retention email automation
  • Multimodal AI chat with rich UI widgets
  • Recharts analytics dashboard with weekly revenue data
  • Netlify deployment with CI/CD

๐Ÿ”จ Phase 2 โ€” Live Data (Next)

  • Supabase Integration: Replace mock data with live PostgreSQL database
  • Real-time Subscriptions: Use Supabase Realtime for live inventory updates
  • Email Service: Connect Resend or SendGrid to actually send recovery emails
  • Auth: User authentication for multi-merchant workspaces

๐Ÿ“‹ Phase 3 โ€” Advanced Intelligence (Planned)

  • Voice Mode: Speak to your store using the Web Speech API
  • Product Image Analysis: Upload product photos for AI-powered listing suggestions
  • Demand Forecasting: Predict stock needs based on sales velocity trends
  • Shopify / WooCommerce Connector: Plug into real storefronts via API

๐Ÿ”ญ Phase 4 โ€” Multi-Agent Expansion (Vision)

  • Independent pricing agent for dynamic price optimization
  • Supplier management agent for automated vendor negotiations
  • Marketing agent for ad copy generation and campaign briefing
  • Cross-agent collaboration for end-to-end autonomous operations

๐Ÿค Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch:
    git checkout -b feature/your-feature-name
  3. Commit using Conventional Commits:
    git commit -m "feat: add shopify connector service"
  4. Push and open a Pull Request against main

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for details.


Built to make autonomous commerce the default, not the exception.

If AutoAgent changed how you think about e-commerce operations, consider starring โญ the repo.

GitHub Stars

Built with โค๏ธ by Ismail Sajid

About

AI-powered assistant using Google Gemini to automate inventory management, customer support, and order processing for online stores. Features chatbot support, real-time alerts, sales analytics, and product image analysis. Reduces manual work by 70%+ and handles customer inquiries automatically. Tech: Python, Flask, Google Gemini API, SQLite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors