Back to Projects

Formea AI Form Automation

Multi-Agent Chrome Extension for Intelligent Form Filling

Overview

Architected multi-agent system with 3 specialized agents (Planner, Navigator, Validator) orchestrated by an Executor with self-validation loops. LangChain integration supporting 8 LLM providers with automatic structured output fallback via Zod schemas. Built VBON Form Explorer agent for autonomous government form reverse-engineering using stable IDs and deterministic DOM diffing.

Key Features

  • Multi-agent orchestration: Executor coordinates Planner, Navigator, and Validator agents
  • Self-validation loop: Validator verifies results before proceeding, feeds errors back for retry
  • 8 LLM providers (OpenAI, Claude, Gemini, Groq, DeepSeek, Cerebras, Ollama, X AI) via LangChain
  • Automatic structured output fallback: native withStructuredOutput() or manual JSON extraction + Zod validation
  • VBON Form Explorer: autonomous agent that builds form dependency graphs via deterministic DOM diffing
  • Human-in-the-loop checkpoints for risky interactions on government forms

Tech Stack

AI & Agents

LangChainZodNanoBrowserPuppeteer

LLM Providers

OpenAIAnthropicGoogleGroqDeepSeekOllama

Backend

Express.jsNode.jsMongoDBMongooseClerk Auth

Frontend

Plasmo MV3ReactHeroUIZustandFramer MotionTailwind CSS

Challenges & Solutions

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.

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.

Key Achievements

3 Agents
Multi-agent system with self-validation loops
8 Providers
LangChain multi-LLM with structured output fallback
VBON Explorer
Autonomous form reverse-engineering agent
Zod Schemas
Type-safe structured output across all agents