A zero-latency, cross-process UI automation system that bridges the gap between web browsers, native OS windows, and system dialogs β giving AI agents complete desktop control through a single Python API.
Quick Start β’ Why AUI? β’ Architecture β’ API Reference β’ Telemetry β’ Roadmap β’ Contributing
Modern AI agents (Copilot, Devin, custom LLM pipelines) can automate web browsers with tools like Playwright or Selenium β but they hit a wall the moment the OS takes over:
- A file upload dialog appears? Playwright can't see it.
- A system confirmation popup blocks execution? Selenium has no answer.
- Need to click a native Windows button outside the browser? You're writing fragile
pyautoguiscripts with hardcoded coordinates.
These tools operate in isolated sandboxes. The OS desktop is invisible to them.
AUI eliminates this blind spot. It continuously scans every visible window on the desktop using native Win32 APIs, builds a real-time coordinate map (shadow_dom.json), and resolves exact pixel locations for any UI element β browser or native. When your AI agent needs to click a file dialog's "Open" button, AUI knows exactly where it is.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your AI Agent β
β β
β from aui_controller import AUIController β
β aui = AUIController() β
β aui.click_element("Open", "Open") # Native OS! β
β β
βββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββΌββββββββββββ
β AUI Controller API β β Single entry point
βββββββββββββββββββββββββ€
β Browser β OS Desktop β β Unified control
β Engine β Controller β
βββββββββββ΄ββββββββββββββ€
β Shadow DOM Daemon β β Real-time Win32 scanner
β (shadow_dom.json) β 200ms refresh cycle
βββββββββββββββββββββββββ
- Windows 10/11 (Win32 APIs required for native window scanning)
- Python 3.10+
- Git
git clone https://github.com/axtontc/AUI.git
cd AUI
# Using uv (recommended)
uv venv && uv pip install -r requirements.txt
# Or using pip
python -m venv .venv && .venv\Scripts\activate
pip install -r requirements.txt
# Install Playwright browsers
playwright install chromiumIn a separate terminal, launch the background scanner:
.venv\Scripts\python shadow_dom_daemon.pyThis continuously scans all visible windows and writes their layout state to
shadow_dom.jsonevery 200ms.
import asyncio
from playwright.async_api import async_playwright
from aui_controller import AUIController
async def main():
aui = AUIController()
# === Web Automation (Playwright) ===
async with async_playwright() as p:
browser = await p.chromium.launch(headless=False)
page = await browser.new_page()
await page.goto("https://example.com/upload")
# === Native Dialog Handling (AUI magic) ===
# When the file chooser dialog pops up, AUI finds and fills it
success = await aui.handle_file_chooser(page, "#upload-btn", "report.pdf")
print(f"Native dialog handled: {success}") # True!
await browser.close()
asyncio.run(main())from aui_controller import AUIController
aui = AUIController()
# Find and click any element by window title + element name
aui.click_element("Notepad", "File") # Click File menu in Notepad
aui.click_element("Save As", "Save") # Click Save in a Save As dialog
# Get exact coordinates for any element
coords = aui.get_element_coords("Calculator", "Seven")
print(coords) # {"x": 523, "y": 412}
# Query by Win32 class name
edit_box = aui.get_element_by_class("Open", "Edit")
if edit_box:
aui.physical_click(edit_box["x"], edit_box["y"])
aui.physical_type("C:\\path\\to\\file.txt")AUI integrates four subsystems into a single cohesive runtime:
graph TD
A["π€ AI Agent / Script"] --> B{"AUIController API"}
B -->|Web Scope| C["π Browser Engine<br/>(Playwright)"]
B -->|OS Scope| D["π Coordinate Resolver"]
E["ποΈ Shadow DOM Daemon"] -->|"Win32 EnumWindows<br/>every 200ms"| F["π shadow_dom.json"]
D -->|Query Layout| F
D -->|Resolved Coordinates| G["π±οΈ Physical Controller<br/>(PyAutoGUI)"]
G -->|"Click / Type / Hotkey"| H["π₯οΈ Desktop"]
C -->|Native Dialog Trigger| I["π Modal Interceptor"]
I -->|Delegate| D
style A fill:#1a1a2e,stroke:#0969DA,color:#fff
style B fill:#16213e,stroke:#0969DA,color:#fff
style E fill:#0f3460,stroke:#2ea043,color:#fff
style F fill:#0f3460,stroke:#2ea043,color:#fff
style G fill:#1a1a2e,stroke:#F5A800,color:#fff
style H fill:#1a1a2e,stroke:#F5A800,color:#fff
| Subsystem | File | Responsibility |
|---|---|---|
| Browser Engine | aui_controller.py |
Runs Playwright web sessions, automates DOM interactions, intercepts native dialogs |
| Shadow DOM Daemon | shadow_dom_daemon.py |
Background process using Win32 EnumWindows + EnumChildWindows to continuously map every visible window, control, and coordinate boundary |
| Coordinate Resolver | aui_controller.py |
Parses shadow_dom.json, resolves absolute screen-center coordinates, and uses filelock to ensure cross-process read safety |
| Physical Controller | aui_controller.py |
Triggers low-level mouse clicks, keyboard input, and hotkey sequences at exact pixel coordinates via PyAutoGUI |
| Capability | Playwright | Selenium | PyAutoGUI | AUI |
|---|---|---|---|---|
| Web DOM automation | β | β | β | β |
| Native OS dialog handling | β | β | β Auto | |
| Real-time window tracking | β | β | β | β |
| Coordinate resolution | β | β | β Dynamic | |
| Cross-process file locking | β | β | β | β |
| OpenTelemetry tracing | β | β | β | β |
| AI agent integration | β Native |
AUI doesn't replace Playwright β it extends it. Playwright handles the browser. AUI handles everything Playwright can't see.
aui = AUIController(shadow_dom_path="shadow_dom.json")| Method | Description | Returns |
|---|---|---|
read_state() |
Read the current shadow DOM state (all tracked windows) | dict |
get_element_coords(window_title, element_name) |
Find element center coordinates by fuzzy name match | {"x": int, "y": int} or None |
get_element_by_class(window_title, class_name, name_query=None) |
Find element by Win32 class name | {"x": int, "y": int} or None |
click_element(window_title, element_name) |
Locate and physically click an element | bool |
physical_click(x, y, button='left', clicks=1) |
Click at exact screen coordinates | None |
physical_type(text) |
Type text with character intervals | None |
physical_hotkey(keys_str) |
Execute hotkey combo (e.g., "ctrl,a") |
None |
handle_file_chooser(page, click_target, file_path) |
Async β Handle native file dialog from Playwright | bool |
daemon = ShadowDOMDaemon(output_path="shadow_dom.json")
daemon.start() # Launch background scanner
daemon.stop() # Stop scanner and clean upAUI includes production-grade observability via OpenTelemetry. Every operation β state reads, element lookups, file lock acquisitions, click executions β is traced with span timing.
# Start AUI + Jaeger with a single command
docker-compose up --buildThen open http://localhost:16686 to see:
- Span execution latencies for every AUI operation
- File lock contention timing
- Element resolution success/failure rates
| Environment Variable | Default | Description |
|---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT |
(none) | OTLP gRPC endpoint (e.g., http://jaeger:4317) |
AUI_DEBUG_TELEMETRY |
(none) | Set to 1 to enable console span logging |
- Win32
EnumWindowsreal-time scanner - Cross-process
filelockstate management - Playwright file dialog interception
- OpenTelemetry instrumentation
- Docker + Jaeger compose stack
- UIAutomation v2 β Replace raw Win32 with
comtypesUIAutomation for richer element properties (AutomationId, ControlType) - Multi-monitor support β Coordinate resolution across multiple displays
- Linux/X11 backend β
xdotool+wmctrlequivalent daemon - Element screenshot caching β Visual matching fallback when text/class queries fail
- PyPI package β
pip install aui - WebSocket API β Remote AUI control over the network
| Component | Technology |
|---|---|
| Language | Python 3.10+ |
| Web Automation | Playwright |
| Desktop Input | PyAutoGUI |
| Window Scanning | Win32 API (ctypes) |
| Process Locking | filelock |
| Telemetry | OpenTelemetry + Jaeger |
| Linting | Ruff |
| Type Checking | mypy (strict) |
| Testing | pytest + pytest-asyncio |
| Containerization | Docker + Docker Compose |
Contributions are welcome! Whether it's fixing a bug, improving documentation, or proposing a new feature β we'd love your help.
Please read our Contributing Guide and Code of Conduct before getting started.
# Development setup
git clone https://github.com/axtontc/AUI.git
cd AUI
uv venv && uv pip install -r requirements.txt
uv pip install -e ".[test]"
# Run checks
ruff check .
mypy .
pytestAUI is part of a larger ecosystem of AI agent infrastructure:
| Project | Description |
|---|---|
| The-Nexus | Monolithic API server for Ollama β system mapping, task farming, and tool orchestration |
| The-Skillbrary | Enterprise MCP server indexing 6,000+ autonomous agent skills |
| Fractal-Swarm-v2 | State-machine framework for autonomous AI agent orchestration |
| AntiMem | Context-gated memory daemon with CRDT compaction |
| OmniMem | Hybrid memory engine for massive AI agent swarms |
This project is licensed under the PolyForm Noncommercial 1.0.0 license.
Note: This license permits personal, hobbyist, and academic use. Commercial use requires a separate license β open an issue to discuss commercial licensing.
β If AUI helps your AI agents see beyond the browser, consider giving it a star!
Built by Axton Carroll β "Nothing is impossible, we merely don't know how to do it yet."