Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions nova-act/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Nova Act enables developers to build intelligent agents that can interact with w
- **Integrate seamlessly** with Python code for testing, assertions, and debugging

The SDK works in conjunction with **Amazon Bedrock AgentCore Browser**, a secure, cloud-based browser environment that provides:

- Session isolation and security
- Built-in observability (live viewing, CloudTrail logging, session replay)
- Containerized ephemeral environments
Expand All @@ -38,12 +39,14 @@ Automate quality assurance testing for web applications using Nova Act and Agent
- **Integration with pytest** for comprehensive test reporting and CI/CD pipelines

**Key Benefits:**

- Reduce test maintenance overhead by 40-60%
- Execute comprehensive test suites in minutes instead of hours
- Eliminate false negatives from UI changes
- Scale testing across browsers, devices, and environments effortlessly

**What's Included:**

- Sample retail web application for testing
- 15 ready-to-use JSON test cases
- Pytest framework with parallel execution support
Expand All @@ -52,15 +55,44 @@ Automate quality assurance testing for web applications using Nova Act and Agent

[→ Explore the QA Testing Use Case](./usecases/qa-testing/)

### 💰 [Price Comparison](./usecases/price_comparison/)

Automate product price comparison across multiple retailers using Nova Act. This use case showcases:

- **Intelligent product search** that navigates retail websites and finds matching products
- **Concurrent execution** across multiple retailers for faster price discovery
- **Structured data extraction** using Pydantic schemas for reliable pricing information
- **Captcha handling** with user prompts for manual intervention when needed
- **CSV export** for easy analysis and comparison of results

**Key Benefits:**

- Compare prices across Amazon, Best Buy, Costco, Target, and more in minutes
- Reduce manual price checking effort by automating browser navigation
- Get structured output with product names, prices, and promotion details
- Easily customize product searches and retailer sources via CLI arguments

**What's Included:**

- Ready-to-run price comparison script
- Support for custom product SKUs and retailer sources
- Pydantic-based data validation for extracted pricing
- ThreadPoolExecutor for parallel retailer searches
- Complete setup and usage instructions

[→ Explore the Price Comparison Use Case](./usecases/price_comparison/)

## Why Agentic Workflows?

Traditional automation approaches face significant challenges:

- **High maintenance overhead**: Scripts break with UI changes, requiring constant updates
- **Limited scalability**: Manual testing is time-intensive and incomplete
- **Technical barriers**: Creating automation requires specialized programming knowledge
- **Brittleness**: Automation relies on specific selectors that fail when components change

Agentic AI with Nova Act addresses these challenges by:

- **Adapting dynamically** to interface changes without manual updates
- **Mimicking human interaction** patterns for realistic testing
- **Enabling non-technical users** to create tests through simple JSON definitions
Expand All @@ -81,6 +113,7 @@ This project is licensed under the MIT-0 License. See the [LICENSE](../LICENSE)
## Support

For questions, issues, or feature requests:

- Open an issue in this repository
- Refer to the [official Nova Act documentation](https://github.com/aws/nova-act)
- Contact AWS Support for enterprise assistance
Expand Down
162 changes: 162 additions & 0 deletions nova-act/usecases/price_comparison/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Price Comparison using Amazon Nova Act

This project demonstrates automated price comparison across multiple retailers using Amazon Nova Act. It showcases how AI-powered browser agents can intelligently search for products, navigate retail websites, and extract pricing information to help consumers find the best deals.

## Overview

This demonstration implements a concurrent price comparison workflow that searches for products across major retailers (e.g. Amazon, Best Buy, Costco, Target) and compiles results into a sortable comparison table.

### Key Benefits

- **Automated Price Discovery**: AI agents navigate retail sites and extract current pricing
- **Concurrent Execution**: Parallel searches across multiple retailers reduce total execution time
- **Structured Output**: Results exported to CSV for easy analysis and comparison
- **Flexible Configuration**: Customize product searches and retailer sources

## Architecture

The demo consists of two main components:

1. **Nova Act Browser Agents**: Automated browser sessions that navigate retail websites, handle captchas, and extract product information
2. **Concurrent Execution Engine**: ThreadPoolExecutor manages parallel searches across multiple retailers

## Prerequisites

Before running this demo, ensure you have:

### Development Environment

- **Python 3.11 or higher**
- **pip** (Python package manager)

### API Access

- **Amazon Nova Act API Key** - Visit [Nova Act home page](https://nova.amazon.com/act) to generate your API key

## Getting Started

Follow these steps to set up and run the price comparison tool:

### Step 1: Install Dependencies

```bash
# Navigate to the project directory
cd nova-act/usecases/price_comparison

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
```

### Step 2: Configure API Key

Set your Nova Act API key as an environment variable:

```bash
export NOVA_ACT_API_KEY="your-api-key-here"
```

### Step 3: Run Price Comparison

```bash
# Run with default product (iPad Pro 13-inch M4, 256GB Wi-Fi)
python main.py

# Run with custom product
python main.py --product_name "iPhone 15 Pro Max 256GB" --product_sku "MU793LL/A"

# Run with custom sources
python main.py --sources '[("Walmart", "https://www.walmart.com"), ("Amazon", "https://www.amazon.com")]'

# Run in non-headless mode (visible browser)
python main.py --headless=False
```

## Usage Examples

### Default Search

```bash
python main.py
```

Searches for "iPad Pro 13-inch (M4 chip), 256GB Wi-Fi" (SKU: MVX23LL/A) across Amazon, Best Buy, Costco, and Target.

### Custom Product Search

```bash
python main.py --product_name "MacBook Air 13-inch M3" --product_sku "MRXN3LL/A"
```

### Custom Retailer Sources

```bash
python main.py --sources '[("Walmart", "https://www.walmart.com"), ("Newegg", "https://www.newegg.com")]'
```

### Debug Mode (Visible Browser)

```bash
python main.py --headless=False
```

## Output

Results are saved to `price_comparison_results.csv` with the following columns:

| Column | Description |
| ----------------- | ---------------------------------------- |
| Source | Retailer name (Amazon, Best Buy, etc.) |
| Product Name | Matched product name from retailer |
| Product SKU | Search SKU used |
| Price | Current price (sorted lowest to highest) |
| Promotion Details | Any active promotions or discounts |

## Project Structure

```
price_comparison/
├── README.md # This file
├── main.py # Main application script
└── requirements.txt # Python dependencies
```

## How It Works

1. **Initialization**: Creates Nova Act browser sessions for each retailer
2. **Captcha Handling**: Detects captchas and prompts user to solve if needed
3. **Product Search**: Searches using the product SKU on each retailer site
4. **Result Extraction**: AI agent identifies the most relevant product and extracts pricing
5. **Data Compilation**: Results are aggregated, sorted by price, and exported to CSV

## Troubleshooting

### Common Issues

1. **Captcha Detected**

- The tool will pause and prompt you to solve the captcha manually
- Press Enter after solving to continue

2. **Product Not Found**

- Verify the SKU is valid for the target retailers
- Some products may not be available at all retailers

3. **Browser Session Errors**

- Ensure you have a stable internet connection
- Try running in non-headless mode to debug: `--headless=False`

4. **API Key Issues**
```bash
export NOVA_ACT_API_KEY="your-api-key-here"
```

## Additional Resources

- [Amazon Nova Act](https://nova.amazon.com/act)
- [Nova Act Documentation](https://docs.aws.amazon.com/nova/latest/userguide/what-is-nova.html)
Loading