Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browser-Automation-Agent

Overview

An AI-powered browser automation agent that automates product return workflows across e-commerce platforms like Amazon and Flipkart.

Built with Stagehand (Browserbase's AI browser automation SDK), the agent uses natural language instructions instead of brittle CSS selectors, making it more resilient to UI changes and easier to maintain.


Architecture

                +----------------------+
                |   Returns_Tasks.xlsx |
                +----------+-----------+
                           |
                           ▼
                  Agent Orchestrator
                           |
          +----------------+----------------+
          |                                 |
          ▼                                 ▼
   Amazon Adapter                  Flipkart Adapter
          |                                 |
          +----------------+----------------+
                           |
                           ▼
                  Stagehand Client
                           |
                           ▼
                  Browserbase Session
                           |
                           ▼
                  Live Website Actions
                           |
                           ▼
                  Structured Result
                           |
                           ▼
                Update Excel Task Sheet

Workflow

Read Pending Tasks
        ↓
Group Items by Order
        ↓
Launch Browser Session
        ↓
Detect Platform Flow
        ↓
Perform Return Workflow
        ↓
Extract Return Details
        ↓
Update Task Sheet
        ↓
Close Session

Project Structure

returns_agent/
├── agent.py
├── config.py
├── excel_io.py
├── stagehand_client.py
├── platforms/
├── tools/
├── tasks/
└── logs/

Setup

1. Install dependencies

pip install -r requirements.txt

2. Configure environment variables

export BROWSERBASE_API_KEY=your_browserbase_api_key
export BROWSERBASE_PROJECT_ID=your_browserbase_project_id
export MODEL_API_KEY=your_openrouter_api_key

3. Run the agent

python agent.py

Key Features

  • AI-powered browser automation using Stagehand
  • Natural language actions instead of CSS selectors
  • Supports multiple e-commerce platforms through adapters
  • Automatic workflow detection
  • Structured data extraction
  • Per-item fault tolerance
  • Automatic task tracking in Excel
  • Modular and extensible architecture

About

Browser e-commerce return automation agent

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages