Back to Projects

Formea AI Form Automation

Multi-Agent Chrome Extension for Intelligent Form Filling

Overview

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

Express.jsNode.jsMongoDBMongooseClerk Auth

AI & Agents

LangChainZodNanoBrowserPuppeteer

LLM Providers

OpenAIAnthropicGoogleGroqDeepSeekOllama

Frontend

Plasmo MV3ReactHeroUIZustandFramer MotionTailwind CSS

Challenges & Solutions

Models Without Structured Output Support

Problem

Not all LLM providers (DeepSeek Reasoner, Llama) support native JSON schema output — agents need consistent Zod-validated responses regardless of provider.

Solution

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

Problem

Three agents need shared browser context, real-time UI updates from background worker, and graceful error handling across agent boundaries.

Solution

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)

Problem

Government forms (PrimeFaces/JSF) have 10K+ lines of HTML with repeated IDs, inline JavaScript handlers, and dynamic AJAX updates — traditional scraping approaches fail entirely.

Solution

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.

Key Achievements

Express + MongoDB
API for profiles, templates, and mappings
Clerk Auth
JWT verification across extension and API
Zod Validation
End-to-end schema validation for API and LLM
Railway Deploy
Dockerized backend deployment