Skip to content

onkernel/replays-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ•΅οΈ AI-Powered E-commerce QA Demo

Watch AI agents autonomously test your e-commerce site and generate reviewable browser replays

An intelligent quality assurance system that uses AI agents to automatically test e-commerce websites, powered by Kernel and Browser Use.

Demo Python License

Kernel Replays Youtube Video Screenshot


πŸ’‘ Why This Matters

Traditional QA testing is manual, time-consuming, and error-prone. This demo shows how AI agents can:

  • βœ… Automate visual testing - Agents "see" and evaluate product images like a human QA tester would
  • πŸ”„ Execute complex workflows - Navigate multi-step user journeys autonomously
  • πŸ“Ή Provide reviewable evidence - Every action is recorded as a browser replay
  • 🎯 Scale effortlessly - Test hundreds of products in the time it takes to test one manually

This is the future of QA: AI agents that think, see, and validate like your best QA engineer.

🎯 What This Demo Does

This application showcases dual-phase AI-powered QA testing on e-commerce sites:

Phase 1: Product Page Intelligence πŸ›οΈ

  • Navigate to product URLs autonomously
  • Evaluate if product images accurately match title descriptions
  • Interact with the page to add items to cart
  • Report PASS/FAIL verdict with detailed assessment

Phase 2: Cart Page Validation πŸ›’

  • Navigate to cart using the site's natural UI flow
  • Search for promotional banners and special offers
  • Validate specific promotion text (e.g., "$20 off when you spend $100")
  • Report PASS/FAIL verdict with findings

Phase 3: Replay Generation πŸŽ₯

Each testing phase is automatically recorded as a browser replay, allowing you to:

  • See exactly what the AI agent saw
  • Review the agent's decision-making process
  • Debug failures by watching agent interactions
  • Share results with your team

✨ Key Features

Feature Description
πŸ€– Autonomous AI Agents Claude-powered agents that understand context and make intelligent decisions
🎬 Browser Replays Every test generates a reviewable recording via Kernel's replay system
πŸ” Visual Understanding AI agents can "see" and evaluate images, layouts, and visual elements
πŸ“Š Structured Results Clean PASS/FAIL verdicts with detailed assessment narratives
πŸ” Secure Credentials Built-in sensitive data handling for store passwords and API keys
⚑ Async Execution Non-blocking API calls with polling for efficient testing workflows
🎯 Multi-Phase Testing Sequential test phases with independent replay recordings

🚨 Important: This is a Template

⚠️ This is a demonstration template, not a plug-and-play solution.

This repository showcases the approach and architecture for building AI-powered QA systems. To adapt it for your use case, you'll need to:

What You'll Need to Provide

  • βœ… Kernel Platform Access - Active account with API access (sign up)
  • βœ… Anthropic API Key - For Claude AI functionality (get key)
  • βœ… Your Test Environment - E-commerce site or web application to test
  • βœ… Custom Agent Tasks - Modify the AI instructions for your specific QA scenarios

What You'll Need to Customize

  • πŸ”§ Agent Task Instructions - Current tasks are specific to our demo store
  • πŸ”§ Product URLs - Update to match your test environment
  • πŸ”§ Validation Logic - Adapt pass/fail criteria to your requirements
  • πŸ”§ Expected Behaviors - Modify based on what you're testing

Think of this as a blueprint, not a finished product. The value is in seeing how AI agents, browser automation, and replay recording work together to create autonomous QA workflows.

πŸ“‹ Prerequisites

Before you can run this demo, ensure you have:

  1. Python 3.11+ installed
  2. Kernel CLI installed and configured (installation guide)
  3. Anthropic API key with Claude access
  4. Development Shopify store (or similar e-commerce platform)
  5. UV package manager (recommended) or pip

πŸš€ Setup Instructions

1. Clone and Install Dependencies

git clone <this-repository>
cd replays-demo
uv install  # or pip install -r requirements.txt

2. Configure Environment Variables

Create a .env file in the project root:

# For running the demo client
KERNEL_API_KEY=your_kernel_api_key_here

# For deployment (can also be set via -e flag)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
STORE_PASSWORD=your_shopify_store_password

3. Customize for Your Store

⚠️ Critical Step: Update the following in main.py and demo-qa-agent.py:

  • Replace kernel-test-store-1.myshopify.com with your store URL
  • Modify product URLs in the demo script
  • Customize agent task instructions for your specific QA scenarios
  • Update expected promotional text and validation criteria

4. Deploy to Kernel

kernel deploy main.py --env-file .env

5. Run the Demo

uv run demo-qa-agent.py

πŸ—οΈ Architecture Overview

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      Demo Client Script                         β”‚
β”‚                    (demo-qa-agent.py)                           β”‚
β”‚                                                                 β”‚
β”‚  β€’ Invokes Kernel app via API                                   β”‚
β”‚  β€’ Polls for completion                                         β”‚
β”‚  β€’ Displays formatted results                                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         β”‚ API Call
                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Kernel Platform                             β”‚
β”‚                   (Managed Browser)                             β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚              Kernel App (main.py)                        β”‚   β”‚
β”‚  β”‚                                                          β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚  Phase 1: Product Page QA                          β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Start replay recording                          β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ AI Agent navigates to product URL               β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Evaluate image vs. title match                  β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Add item to cart                                β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Stop replay β†’ Generate replay link              β”‚  β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β”‚                         ↓                                β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚  Phase 2: Cart Page QA                             β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Start new replay recording                      β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ AI Agent navigates to cart                      β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Search for promotional banners                  β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Validate specific promotion text                β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Stop replay β†’ Generate replay link              β”‚  β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β”‚                         ↓                                β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚
β”‚  β”‚  β”‚  Return Results                                    β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Product assessment + replay link                β”‚  β”‚   β”‚
β”‚  β”‚  β”‚  β€’ Cart assessment + replay link                   β”‚  β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Core Components

Component Purpose Key Technology
main.py Kernel app orchestrating the dual-agent QA workflow Browser Use SDK, Claude Sonnet 4
session.py Custom browser session with viewport handling for CDP connections Browser Use + Playwright
demo-qa-agent.py Client script that invokes the app and displays results Kernel API, async polling

Technology Stack

  • AI Engine: Claude Sonnet 4 (claude-sonnet-4-20250514)
  • Browser Automation: Browser Use SDK (~0.5.3)
  • Orchestration: Kernel Platform (>=0.8.1)
  • Browser Control: Playwright (via Browser Use)
  • Language: Python 3.11+

πŸ› οΈ Customization Guide

Adapting Agent Tasks

The current agents are configured for specific scenarios. To customize:

  1. Update Product Assessment (main.py:72-84):

    • Modify the product evaluation criteria
    • Change expected product types or attributes
    • Adjust cart addition logic
  2. Update Cart Assessment (main.py:112-124):

    • Replace promotional text with your offers
    • Modify banner detection logic
    • Add additional cart validation steps
  3. Add New Assessment Phases:

    • Create additional agent instances
    • Add new replay recording phases
    • Update the QAResult structure

πŸ“Ί Example Output

When you run uv run demo-qa-agent.py, you'll see formatted results like this:

============================================================
πŸ•΅οΈ E-commerce QA Agent Demo
============================================================

πŸš€ Starting AI-powered quality assurance testing...
πŸ“ Testing URL: https://kernel-test-store-1.myshopify.com/products/short-sleeved-red-t-shirt

⏳ Invoking QA agents... (this may take 2-3 minutes)
⏳ Invocation started (ID: inv_abc123)... polling for completion

============================================================
πŸ“Š QA Results
============================================================
⏱️  Completed in 127.3 seconds
πŸ• Timestamp: 2025-09-30 14:23:45

πŸ“‹ Product Page Assessment
----------------------------------------
βœ… VERDICT: PASS - The product image clearly shows a red short-sleeved
t-shirt which accurately matches the product title description. The item
was successfully added to the cart.

πŸ“‹ Cart Page Assessment
----------------------------------------
❌ VERDICT: FAIL - The cart page displays a '$15 off when you spend $75'
promotional banner instead of the expected '$20 off when you spend $100'
promotion.

πŸ“‹ Browser Replay Links
----------------------------------------
Review the AI agent's actions by clicking these replay links:

🎬 Product Page Inspection:
   https://replays.onkernel.com/replay/rpl_xyz789

🎬 Cart Page Inspection:
   https://replays.onkernel.com/replay/rpl_abc456

============================================================
✨ Demo Complete! πŸŽ‰
============================================================
πŸ’‘ Key Features Demonstrated:
   β€’ AI agents can autonomously navigate websites
   β€’ Automated quality assurance testing
   β€’ Visual replay links for review and debugging
   β€’ Structured assessment reporting

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

Built with:


Ready to build autonomous QA agents? Start by exploring the code in main.py to see how the dual-phase agent workflow is structured. πŸš€

About

Replays demo repo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages