Skip to content

official-Arvind/uni-web-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

UNI WEB AGENT

๐Ÿค– UNI WEB AGENT

The Universal Hybrid Declarative Web Agent
by Arvind Ji ยท Jigar Corporation Pvt Ltd


๐Ÿš€ What is UNI WEB AGENT?

A production-grade Hybrid Declarative Web Agent that uses AI (Gemini 3.5 Flash) only once to map a website's interactive workflow and generate a deterministic JSON config. All subsequent runs execute via pure Playwright code with zero API tokens consumed.

If the website's UI changes and breaks a selector, the agent auto-heals itself โ€” it detects the failure, calls the AI to find the new selector, updates the config, and resumes seamlessly. No human intervention required.

๐Ÿง  Architecture Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   UNI WEB AGENT                         โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  AI Mapper   โ”‚โ”€โ”€โ–ถโ”‚  JSON Config โ”‚โ”€โ”€โ–ถโ”‚  Executor  โ”‚  โ”‚
โ”‚  โ”‚ (One-Time)   โ”‚   โ”‚  (Cached)    โ”‚   โ”‚ (Zero-Tok) โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                              โ”‚         โ”‚
โ”‚                                        โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚                                        โ”‚Auto-Healer โ”‚  โ”‚
โ”‚                                        โ”‚ (On-Error) โ”‚  โ”‚
โ”‚                                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚            Live AI Copilot (Real-time)           โ”‚   โ”‚
โ”‚  โ”‚  Natural language โ†’ Browser actions via WebSocketโ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚                                                         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โœจ Key Features

Feature Description
โšก Zero-Token Execution AI maps the workflow once โ†’ cached JSON โ†’ pure Playwright execution. Drastically cuts API costs.
๐Ÿฉน 3-Tier Auto-Healing Primary CSS โ†’ XPath fallback โ†’ AI re-mapping. Broken selectors are automatically repaired.
๐Ÿค– Live AI Copilot Natural language instructions โ†’ real-time browser automation via WebSocket streaming.
๐Ÿ”ฎ Auto Setup with AI Point the agent at a domain and it will automatically deduce and generate all logical workflows.
๐Ÿ•ต๏ธ Ultimate Stealth Powered by Playwright-Stealth to bypass advanced anti-bot protections (Cloudflare, DataDome, etc).
๐ŸŽจ Brutal Modern UI Dark mode, glassmorphism, neon accents, micro-animations, and a cyber-deck terminal interface.

๐Ÿ—๏ธ Tech Stack

Layer Technology
Backend Python 3.13, FastAPI, Pydantic V2, Uvicorn
AI Google Gemini 3.5 Flash (Structured Output)
Browser Playwright + Stealth + Crawl4AI
Frontend React 19, Vite 8 (Rolldown), Vanilla CSS
Realtime WebSocket (FastAPI native)

๐Ÿ“ฆ Getting Started

Prerequisites

1. Clone & Install

# Clone the repository
git clone https://github.com/official-Arvind/uni-web-agent.git
cd uni-web-agent

# Set up Python Backend
python -m venv venv
venv\Scripts\activate        # Windows
# source venv/bin/activate   # macOS/Linux

pip install -r requirements.txt

# Install browser drivers
playwright install
crawl4ai-setup

# Set up React Frontend
cd frontend
npm install

2. Run the Agent

Terminal 1 โ€” Backend:

start_backend.bat
# Or manually:
# venv\Scripts\uvicorn backend.main:app --port 8000

Terminal 2 โ€” Frontend:

cd frontend
npm run dev

Open your browser to http://localhost:5173 ๐Ÿš€

3. Quick Start Guide

  1. โš™๏ธ Click Settings โ†’ Add your Gemini API Key
  2. โž• Click Add New Site โ†’ Enter a domain (e.g., amazon.in)
  3. โœจ Click Auto Setup with AI โ†’ The AI automatically generates workflows
  4. โ–ถ๏ธ Click Run Now โ†’ Watch the cached workflow execute with zero API tokens!
  5. ๐Ÿค– Switch to Live Copilot โ†’ Type natural language commands to control a live browser

๐Ÿ–ฅ๏ธ Live Demo

Try the Frontend UI โ†’

Note: The live demo shows the frontend interface only. To execute workflows, you must run the backend on your local machine.


๐Ÿ“ Project Structure

uni-web-agent/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ api/            # FastAPI routes & WebSocket handlers
โ”‚   โ”œโ”€โ”€ core/           # AI Mapper, Auto-Healer, Execution Engine, Live Agent
โ”‚   โ”œโ”€โ”€ models/         # Pydantic V2 data schemas
โ”‚   โ”œโ”€โ”€ utils/          # File manager & helpers
โ”‚   โ”œโ”€โ”€ config.py       # Environment configuration
โ”‚   โ””โ”€โ”€ main.py         # FastAPI application entry point
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/ # React components (Dashboard, LiveCopilot, Modals...)
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx     # Root application component
โ”‚   โ”‚   โ””โ”€โ”€ index.css   # Brutal design system
โ”‚   โ””โ”€โ”€ public/         # Static assets
โ”œโ”€โ”€ sites/              # Generated workflow configs (per-domain)
โ”œโ”€โ”€ start_backend.bat   # Windows backend launcher with port management
โ”œโ”€โ”€ requirements.txt    # Python dependencies
โ””โ”€โ”€ RELEASE_NOTES.md    # Changelog

๐Ÿ”‘ Environment Variables

Variable Default Description
GEMINI_API_KEY "" Your Google Gemini API key
GEMINI_MODEL gemini-3.5-flash AI model to use
SITES_DIR ./sites Directory to store workflow configs
HOST 0.0.0.0 Server host
PORT 8000 Server port
HEADLESS true Run browser in headless mode

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


Built with โค๏ธ by Arvind Ji ยท Jigar Corporation Pvt Ltd
Powered by Gemini 3.5 Flash ยท Playwright ยท FastAPI ยท React

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors