Formea AI Form Automation
Multi-Agent Chrome Extension for Intelligent Form Filling
Designed Express.js API with MongoDB (Mongoose) for user profiles, templates, and form mapping persistence. Zod validation throughout for API payloads and LLM structured outputs. Clerk JWT verification for auth, Docker deployment on Railway.
Key Features
- Express.js API with MongoDB (Mongoose) for profiles, templates, and form mappings
- Zod validation for API payloads and LLM structured output schemas
- Clerk JWT verification for secure authentication
- Template CRUD with dependency tracking and versioning
- LLM provider configuration and API key management
- Docker containerized deployment on Railway
Tech Stack
Backend
AI & Agents
LLM Providers
Frontend
Challenges & Solutions
Models Without Structured Output Support
Not all LLM providers (DeepSeek Reasoner, Llama) support native JSON schema output — agents need consistent Zod-validated responses regardless of provider.
Automatic fallback pattern: detect provider capability, use native withStructuredOutput() when available, fall back to manual JSON extraction + Zod validation for unsupported models. Provider-agnostic agent code.
Agent Coordination & State Management
Three agents need shared browser context, real-time UI updates from background worker, and graceful error handling across agent boundaries.
Shared AgentContext with BrowserContext, EventManager for real-time UI updates, and generic BaseAgent<T extends ZodType> enforcing type-safe structured outputs per agent.
Complex Government Forms (VBON)
Government forms (PrimeFaces/JSF) have 10K+ lines of HTML with repeated IDs, inline JavaScript handlers, and dynamic AJAX updates — traditional scraping approaches fail entirely.
Built VBON Form Explorer agent using stable hash-based IDs (XPath + role + label) that survive DOM changes, PrimeFaces AJAX completion detection, and deterministic DOM diffing to build field dependency graphs.