Skip to content

leungt30/HALT

Repository files navigation

🛑 HALT

AI-Powered A/B Testing & Store Optimization Platform

Devpost Live Demo UofTHacks 13

Transforming E-Commerce Optimization with Autonomous AI Agents

Try Live DemoView on DevpostReport Bug


📖 Table of Contents


🎯 Overview

HALT is an innovative AI-powered platform that revolutionizes e-commerce A/B testing by creating realistic customer simulations. Instead of waiting weeks for real user data, businesses can now test store layouts and optimizations in minutes using autonomous AI agents that mimic diverse customer behaviors and preferences.

🔗 View Full Project on Devpost


💡 Inspiration

Companies spend $1.5 billion annually on A/B testing in the United States alone. Industry leaders like Shopify and Amplitude constantly optimize e-commerce platforms, knowing that even a 0.1% boost in engagement can generate hundreds of thousands of dollars in additional revenue.

Our team aims to revolutionize this process by leveraging AI to:

  • Accelerate testing cycles from weeks to hours
  • Reduce costs associated with traditional A/B testing
  • Enable data-driven decisions before production deployment
  • Simulate diverse customer personas with realistic behaviors

✨ Features

🤖 Autonomous AI Agents

  • Store Manager Agent: Analyzes analytics and optimizes store layouts automatically
  • Customer Agents: Simulate realistic shoppers with diverse personalities, goals, and behaviors
  • 10 Unique Personas: From budget-conscious browsers to tech-savvy comparison shoppers

📊 Real-Time Analytics

  • Track customer interactions, browsing patterns, and purchase behaviors
  • MongoDB integration for comprehensive event logging
  • Visual feedback dashboard for store optimization results

🎨 Dynamic Store Layouts

  • AI-powered category organization
  • Responsive React-based storefront
  • Real-time layout updates based on customer feedback

🔄 Continuous Optimization Loop

  • Store Manager reviews analytics → proposes layout changes
  • Customer agents test new layout → provide detailed feedback
  • System iterates automatically to find optimal configurations

🏗️ Architecture

graph TB
    subgraph "Frontend Layer"
        A[React + Vite Storefront]
        A1[Event Tracking System]
    end
    
    subgraph "Backend Layer"
        B[Express + TypeScript API]
        C[(MongoDB Database)]
    end
    
    subgraph "AI Agent Layer"
        D[Store Manager AI<br/>Gemini Flash]
        E[Customer AI Agents<br/>Gemini Flash + Browser Use]
    end
    
    subgraph "Feedback System"
        F[FastAPI Feedback Server]
        G[Real-time Display Dashboard]
    end
    
    A -->|User Events| A1
    A1 -->|Analytics| B
    B <-->|Store/Retrieve Data| C
    D -->|Fetch Analytics| B
    D -->|Update Layout| B
    D -->|Trigger Tests| E
    E -->|Browse Store| A
    E -->|Submit Feedback| F
    F -->|Display Results| G
    D -->|Review Feedback| F
    
    style A fill:#61DAFB,stroke:#333,stroke-width:2px
    style B fill:#68A063,stroke:#333,stroke-width:2px
    style C fill:#13AA52,stroke:#333,stroke-width:2px
    style D fill:#4285F4,stroke:#333,stroke-width:2px
    style E fill:#DB4437,stroke:#333,stroke-width:2px
    style F fill:#00A67E,stroke:#333,stroke-width:2px
Loading

System Components

Component Technology Purpose
Frontend React + TypeScript + Vite Customer-facing e-commerce storefront with event tracking
Backend Express + TypeScript + MongoDB RESTful API for layout management and analytics storage
Store Manager AI Python + Gemini Flash Autonomous agent that optimizes store layouts based on data
Customer AI Agent Python + Gemini Flash + Browser Use Simulates diverse customer behaviors and provides feedback

🛠️ Tech Stack

Frontend

React TypeScript Vite

Backend

Node.js MongoDB TypeScript

AI Agents

Python Google Gemini FastAPI Browser Use

Deployment

Vercel .tech


🚀 Getting Started

Prerequisites

Before running HALT locally, ensure you have:

  • Node.js (v18 or higher) and npm
  • Python (3.9 or higher)
  • MongoDB instance (local or cloud)
  • Google Gemini API key (Get one here)
  • Playwright browsers installed

Installation

  1. Clone the repository

    git clone https://github.com/leungt30/HALT.git
    cd HALT
  2. Set up Python virtual environment

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    pip install -r requirements.txt
  3. Install Playwright browsers

    playwright install
  4. Install frontend dependencies

    cd frontend
    npm install
    cd ..
  5. Install backend dependencies

    cd backend
    npm install
    cd ..
  6. Configure environment variables

    Create .env files in the following directories:

    backend/.env

    MONGODB_URI=your_mongodb_connection_string
    PORT=3000

    store-manager-ai/.env

    GEMINI_API_KEY=your_gemini_api_key
    BACKEND_URL=http://localhost:3000
    FRONTEND_URL=http://localhost:5173

    customer-ai-agent/.env

    GEMINI_API_KEY=your_gemini_api_key
    FRONTEND_URL=http://localhost:5173

🖥️ Running Locally

HALT consists of 4 independent services that work together. You can run them individually or use the optimization loop script.

Option 1: Run All Services Individually

1️⃣ Start the Backend API

cd backend
npm run dev
  • Runs on: http://localhost:3000
  • Provides: RESTful API for layout management and analytics

2️⃣ Start the Frontend Storefront

cd frontend
npm run dev
  • Runs on: http://localhost:5173
  • Provides: Customer-facing e-commerce interface

3️⃣ Start the Customer AI Agent Service

cd customer-ai-agent
source ../.venv/bin/activate
uvicorn server:app --host 0.0.0.0 --port 8000
  • Runs on: http://localhost:8000
  • Provides: API endpoint to spawn customer simulations

4️⃣ Run the Store Manager AI

cd store-manager-ai
source ../.venv/bin/activate
python agent.py
  • Autonomous agent that:
    • Fetches analytics from backend
    • Proposes layout optimizations
    • Triggers customer simulations
    • Reviews feedback and iterates

Option 2: Run Optimization Loop (Automated)

For a complete demonstration, use the included orchestration script:

chmod +x run_optimization_loop.sh
./run_optimization_loop.sh

This script will:

  1. ✅ Start the Feedback Display Server (http://localhost:8001)
  2. ✅ Open a Chrome window showing real-time feedback
  3. ✅ Launch the Customer AI Agent Service
  4. ✅ Start the Store Manager AI optimization loop

Note: The script uses Vercel production endpoints for frontend/backend by default. To use local instances, modify the environment variables in the script.


🔄 How It Works

The Optimization Cycle

  1. Store Manager Analyzes

    • Fetches customer event data from MongoDB
    • Reviews metrics like bounce rates, category engagement, scroll depth
    • Identifies optimization opportunities
  2. Layout Proposal

    • AI generates a new store layout hypothesis
    • Reorganizes categories, products, and promotional content
    • Updates layout via backend API
  3. Customer Simulation

    • Spawns 10 AI customer agents with diverse personas
    • Each agent navigates the store with specific goals:
      • Quick purchase vs. browsing
      • Budget-conscious vs. feature-focused
      • Tech-savvy vs. low technical skill
    • Agents use Browser Use to interact naturally with the UI
  4. Feedback Collection

    • Each customer agent provides structured feedback:
      • Shopping experience rating
      • Ease of finding products
      • Layout intuitiveness
      • Visual appeal
    • Feedback aggregated and displayed in real-time
  5. Iteration

    • Store Manager reviews feedback
    • Proposes refined layout based on insights
    • Cycle repeats until optimal performance achieved

🚧 Challenges

One of our main challenges was creating a reliable workflow between multiple autonomous agents and establishing robust data flows throughout the system.

Key difficulties:

  • Agentic Architecture: With multiple autonomous agents making decisions based on user behavior, determining how events should be collected, stored, and retrieved required careful design
  • Meaningful Data Collection: Ensuring the storefront tracked metrics that were actionable for the Store Manager LLM
  • LLM Integration: Our lack of prior experience with agentic architecture led to many early iterations where the manager lacked sufficient data for meaningful changes
  • System Synchronization: Coordinating the Store Manager calling the backend → triggering customer agents → agents browsing the site → events generated → feedback collected → manager reviews

Integrating LLMs with decision-making into a traditional web stack required significant experimentation and exploration, ultimately making us stronger engineers.


🏆 Accomplishments

We're proud of:

Successfully integrating agentic LLMs into a live web environment, demonstrating their potential beyond traditional chatbot interfaces

Designing and deploying a robust full-stack pipeline with clear data flows between 4 independent services

Creating realistic customer simulations with 10 diverse personas that accurately mimic human shopping behaviors

Delivering real-world impact potential for e-commerce operations and user shopping experiences


📚 What We Learned

We gained deeper insights into:

  • System Design: The importance of planning interactions between autonomous components before implementation
  • Agentic Workflows: Managing complex state machines where agents operate independently yet collaboratively
  • Data Flow Architecture: Designing event systems that capture meaningful, actionable insights
  • LLM Prompt Engineering: Crafting effective prompts for autonomous decision-making vs. conversational AI
  • Iterative Development: Embracing design overhauls as learning opportunities rather than setbacks

A large portion of our time was spent planning how our system would interact with itself—these discussions led to invaluable lessons about distributed AI systems.


🔮 Future Roadmap

Planned enhancements include:

Phase 1: Enhanced Personalization

  • Recommendation System: Offer complementary goods based on user actions within shopping sessions
  • Granular Event Tracking: More detailed customer interaction metrics
  • Session-based Learning: Adapt recommendations dynamically during browsing

Phase 2: Advanced Store Management

  • Sales & Promotions: Allow Store Manager to create and test promotional campaigns
  • Trend Research: Enable agents to research current trends online and adjust inventory
  • A/B Test Comparison: Side-by-side testing of multiple layouts simultaneously

Phase 3: Enterprise Features

  • Custom Persona Creation: Allow businesses to define their own customer archetypes
  • Multi-store Management: Support for testing across multiple storefronts
  • Integration APIs: Connect with Shopify, WooCommerce, and other platforms

👥 Team

HALT was built by our passionate team at UofTHacks 13:

Timothy Leung
Timothy Leung

CS @ Mac
Loic Wedji
Loic Wedji

CS @ Brock
Hilary He
Hilary He

DevOps @ RBC | CS @ Mac
Alaqmar Gandhi
Alaqmar Gandhi

DevOps @ RBC | CS @ BrockU

📄 License

This project was created for UofTHacks 13. See the repository for license details.


⬆ Back to Top

Made at UofTHacks 13

Devpost

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors