Skip to content

RohanDisa/agenticformfiller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧠 AutoFormFiller

Intelligent Web Form Automation with LLM Reasoning

📌 Overview

AutoFormFiller is a Python-based automation tool that uses Selenium for browser control and LLM-assisted reasoning (Gemma 9B via Groq) to complete web forms intelligently.

Unlike traditional rule-based form fillers, AutoFormFiller:

  • 🔍 Dynamically extracts form fields from the DOM
  • 🧠 Uses LLM reasoning to map fields to structured user data
  • 🎯 Makes intelligent decisions about which buttons/links to click ("Next", "Submit", etc.)
  • 👤 Falls back to human-in-the-loop when validation or edge cases occur

Initially designed for repetitive application forms, AutoFormFiller can be adapted to other structured forms with minimal configuration changes.

✨ Features

  • Dynamic field extraction (text inputs, dropdowns, radio buttons, checkboxes)
  • 🧠 LLM-powered reasoning for intelligent field mapping
  • 🎯 Smart navigation (automatically selects appropriate action buttons)
  • 👤 Human-in-the-loop fallback for validation errors or ambiguous cases
  • 📦 Simple, maintainable codebase (core functionality in just 2 files)
  • 🔧 Configurable user profiles using Pydantic models
  • 🌐 Cross-platform support (Windows, macOS, Linux)

🏗 Architecture

flowchart TD
    A[🚀 Start Browser] --> B[🔍 Scrape Form Fields via Selenium]
    B --> C[📦 Chunk Fields into Groups]
    C --> D[🧠 Agent 1: LLM Field Mapping]
    D --> E[✍️ Populate Fields in Browser]
    E --> F[🎯 Agent 2: LLM Button Selection]
    F --> G{✅ Validation?}
    G -->|Pass| H[➡️ Proceed to Next Page]
    G -->|Fail| I[👤 Escalate to Human Input]
    H --> B
    I --> J[🔄 Manual Correction]
    J --> F
Loading

Agent Roles

  • Agent 1 → Maps form input fields to structured user data using LLM reasoning
  • Agent 2 → Intelligently chooses the most appropriate button/action to continue
  • Human Operator → Only involved when validation fails or form logic is unclear

⚙️ Installation

Prerequisites

  • Python 3.9+
  • Chrome Browser (for Selenium WebDriver)
  • Groq API Key (free tier available)

Steps

  1. Clone the repository
git clone https://github.com/RohanDisa/autoformfiller.git
cd autoformfiller
  1. Install dependencies
pip install -r requirements.txt
  1. Configure API key In core.py, replace the placeholder with your actual Groq API key:
GroqProvider(api_key="your_groq_api_key_here")
  1. Set up ChromeDriver The tool uses Chrome WebDriver. Make sure you have Chrome browser installed. The WebDriver will be managed automatically by Selenium.

🚀 Usage

Basic Usage

Run the main script:

python main.py

What happens next:

  1. 🚀 Launches a Chrome browser instance
  2. 🌐 Navigates to the target form URL
  3. 🔍 Dynamically extracts all form inputs
  4. 🧠 Uses LLM to intelligently fill fields with your data
  5. 🎯 Automatically selects appropriate action buttons
  6. 🔄 Repeats until form completion or human intervention needed

Customization

Modify the StudentDetails model in core.py to match your specific use case and data structure.

🧩 User Profile Configuration

Your personal data is defined using a Pydantic model (StudentDetails). Here's the expected JSON schema:

{
  "first_name": "John",
  "middle_name": "Michael",
  "last_name": "Doe",
  "phone_number": "555-123-4567",
  "address": "123 Main Street",
  "citizenship": "United States",
  "sex": "Male",
  "gender": "Male", 
  "email": "john.doe@example.com",
  "confirmed_email": "john.doe@example.com",
  "password": "SecurePassword123!",
  "zipcode": "12345",
  "city": "New York",
  "state": "NY",
  "street": "123 Main Street",
  "birth_month": "01",
  "birth_day": "15",
  "birth_year": "1990",
  "degree": "Bachelor of Science",
  "major": "Computer Science",
  "ethnicity": "Other",
  "undergrad_college": "University of Example"
}

Supported Field Types

  • Text inputs (name, email, address, etc.)
  • Select dropdowns (state, country, degree type, etc.)
  • Radio buttons (gender, citizenship status, etc.)
  • Checkboxes (agreements, preferences, etc.)
  • Date fields (birth date, graduation date, etc.)

📂 Project Structure

autoformfiller/
├── 📄 core.py              # WebDriver setup, LLM configuration, Pydantic models
├── 📄 main.py              # Main orchestration logic, agent coordination
├── 📄 requirements.txt     # Python dependencies
├── 📄 README.md           # This file

🛠 Configuration Options

LLM Settings

  • Model: Gemma 9B (via Groq)
  • Temperature: Configurable for response creativity
  • Max Tokens: Adjustable based on form complexity

Browser Settings

  • Headless Mode: Can be enabled for server deployments
  • Window Size: Configurable for different screen sizes
  • Timeout Settings: Adjustable wait times for page loads

About

LLM-powered agent that understands, fills, and navigates college application portals seamlessly.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages