Building IntentIQ: why static selectors break and how I decoupled intent from DOM paths
From a simple Playwright script to an autonomous workflow intelligence system.
The Trigger & Underlying Problem
The Trigger: I was tired of watching browser automation test suites shatter every time a frontend engineer changed a CSS utility class or renamed a button label.
The Core Problem: Traditional automation scripts rely on rigid CSS selectors or brittle XPaths. When a website redesigns or classes re-hash in production, the automation breaks completely even though the human intent of the task hasn't changed.
Why Standard Solutions Were Insufficient: I wanted to build an automation system that understands semantic goals rather than hardcoded DOM coordinates.
What It Solves in Practice
Enables workflows to survive frontend redesigns. IntentIQ stores what the user wants to accomplish, and if execution encounters an unexpected UI shift, an evaluation agent heals the path dynamically.
Anyone running high-volume web automation across third-party websites they do not control.
Automation engineers spent half their week rewriting broken XPath selectors.
Architecture & Key Engineering Decisions
A multi-component system: a Recorder captures user actions, a Blueprint Engine abstracts actions into semantic intents, Playwright executes deterministic paths, BrowserUse acts as an autonomous doctor when paths fail, and a Judge Engine scores execution quality.
- OpenAI API handles high-level intent reasoning, while headless Playwright handles deterministic, low-latency execution.
- Blueprint Engine stores semantic action goals (e.g. "submit login form with credentials") instead of DOM paths.
- Judge Engine scores state transitions against a strict rubric before marking an interaction as successful.
What Failed in Practice & How It Was Addressed
- Relying solely on LLMs for every interaction was prohibitively slow and expensive: a 5-step test took 45 seconds and cost $0.30.
- Knowing whether a step succeeded was much harder than executing it: green checkmarks were given even when a modal failed to open.
- Unexpected native OS popups and alert dialogs hung headless browser instances.
- Created a hybrid execution model: Playwright runs the deterministic blueprint at native speed (sub-second). The LLM is invoked only as a fallback doctor when Playwright throws a locator timeout.
- Built an Output Extraction and Judge Engine that extracts DOM state changes post-action and scores execution against expected semantic outcomes.
- Added native OS-level popup listeners and AppleScript handlers to dismiss system dialogs automatically.
Takeaways & Future Iterations
- Humans don't think in selectors; humans think in workflows. Decoupling intent from presentation is the key to resilient automation.
- Teaching software to survive in dynamic environments requires feedback loops, not just script replay.
Today, I would compile blueprint execution into lightweight WebAssembly modules for client-side replay and reduce token consumption further with fine-tuned local models.