The Universal Hybrid Declarative Web Agent
by Arvind Ji ยท Jigar Corporation Pvt Ltd
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.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| 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. |
| 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) |
- Python 3.13+
- Node.js 20+
- A Google Gemini API Key (free tier works!)
# 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 installTerminal 1 โ Backend:
start_backend.bat
# Or manually:
# venv\Scripts\uvicorn backend.main:app --port 8000Terminal 2 โ Frontend:
cd frontend
npm run devOpen your browser to http://localhost:5173 ๐
- โ๏ธ Click Settings โ Add your Gemini API Key
- โ Click Add New Site โ Enter a domain (e.g.,
amazon.in) - โจ Click Auto Setup with AI โ The AI automatically generates workflows
โถ๏ธ Click Run Now โ Watch the cached workflow execute with zero API tokens!- ๐ค Switch to Live Copilot โ Type natural language commands to control a live browser
Note: The live demo shows the frontend interface only. To execute workflows, you must run the backend on your local machine.
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
| 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 |
MIT License โ see LICENSE for details.
Built with โค๏ธ by Arvind Ji ยท Jigar Corporation Pvt Ltd
Powered by Gemini 3.5 Flash ยท Playwright ยท FastAPI ยท React
