Skip to content

deepakSingh-dev/FormAgent

Repository files navigation

FormAgent

FormAgent is a Chrome Extension for AI-assisted form filling. It scans a live form, maps visible fields into structured metadata, drafts answers from a saved personal profile, lets the user review or edit those answers, and then fills the page with one click.

The current version is intentionally simple and fast to run:

  • no build step
  • no external dependencies
  • Manifest V3 Chrome extension
  • local profile storage in chrome.storage.local
  • built-in answer-generation pipeline with a clear upgrade path to a real LLM provider

Why FormAgent

Many forms repeat the same information:

  • contact details
  • links
  • work authorization
  • salary preferences
  • availability
  • long-form prompts like "Tell us about yourself" or "Why do you want to work here?"

FormAgent focuses on shortening that loop while keeping the user in control:

  • scan the form
  • generate draft answers
  • review and edit
  • fill the page

Features

  • Manifest V3 Chrome extension with popup, side panel, and options page
  • Form scanning for visible input, textarea, and select elements
  • Field metadata extraction:
    • label
    • question text
    • selector
    • required state
    • options
    • input type
  • Local profile storage using chrome.storage.local
  • Draft answer generation from profile data
  • Basic page-context tailoring for long-form answers
  • Reviewable answers before DOM fill
  • One-click filling for:
    • text inputs
    • email inputs
    • phone inputs
    • textareas
    • selects
    • radios
    • checkboxes
  • Local demo form for testing the extension end-to-end

Architecture

The extension is split into four main parts.

1. content.js

Runs on the current page and handles page-level work:

  • scans visible form controls
  • infers labels and questions
  • serializes fields into a structured payload
  • fills matching DOM elements using generated answers

Responsibilities:

  • DOM reading
  • field normalization
  • DOM writing

2. background.js

Acts as the orchestration layer:

  • initializes default profile/settings
  • opens the side panel
  • receives generation requests
  • calls the answer-generation pipeline

Responsibilities:

  • state bootstrapping
  • runtime messaging
  • provider orchestration

3. sidepanel.html + sidepanel.js

This is the main working UI for the user:

  • scan the active page
  • show detected fields
  • generate drafts
  • edit drafts
  • fill the form

Responsibilities:

  • workflow UI
  • answer review
  • user-triggered fill action

4. options.html + options.js

Stores reusable user context:

  • basic profile details
  • work preferences
  • narrative answers
  • generation settings

Responsibilities:

  • profile editing
  • settings persistence

Shared Logic: lib/form-agent.js

Contains shared schema and draft-generation logic:

  • default profile structure
  • profile merge helpers
  • answer generation
  • field-to-answer matching heuristics

Request Flow

The request flow works like this:

  1. User opens a webpage with a form.
  2. User opens FormAgent and launches the side panel.
  3. The side panel asks the content script to extract form fields.
  4. The content script returns normalized field data and page context.
  5. The side panel sends those fields to the background worker.
  6. The background worker loads the saved profile/settings and generates draft answers.
  7. The side panel renders those answers for review/edit.
  8. When the user clicks Fill Form, the side panel sends the final answer set back to the content script.
  9. The content script updates the page’s DOM and dispatches the relevant input/change events.

Project Structure

FormAgent/
├── manifest.json
├── background.js
├── content.js
├── popup.html
├── popup.js
├── sidepanel.html
├── sidepanel.js
├── options.html
├── options.js
├── styles.css
├── demo-form.html
├── README.md
└── lib/
    └── form-agent.js

Setup

Requirements

  • Google Chrome or another Chromium-based browser with Chrome Extension support
  • local filesystem access to this repo

No package installation is required for the current version.

Clone The Repo

git clone https://github.com/deepakSingh-dev/FormAgent.git
cd FormAgent

Load The Extension

  1. Open chrome://extensions
  2. Turn on Developer mode
  3. Click Load unpacked
  4. Select the repo folder
  5. Pin the extension if you want easier access during testing

Open The Demo Form

You can test the extension against the included local form:

  • local file: demo-form.html
  • file URL pattern: file:///absolute/path/to/FormAgent/demo-form.html

In Chrome, you may need to allow file URL access for the extension:

  1. Go to chrome://extensions
  2. Click Details on FormAgent
  3. Enable Allow access to file URLs

How To Use

  1. Open a page with a form, or open demo-form.html
  2. Click the FormAgent extension icon
  3. Open the side panel
  4. Open the profile/settings page and fill in your details
  5. Return to the form page
  6. Click Scan Form
  7. Click Generate Drafts
  8. Review or edit the proposed answers
  9. Click Fill Form

Data Model

The profile model has three sections.

basics

  • full name
  • email
  • phone
  • location
  • LinkedIn
  • GitHub
  • website

work

  • current title
  • years of experience
  • work authorization
  • sponsorship need
  • salary expectation
  • availability

narrative

  • summary
  • strengths
  • ideal role
  • why interested

Feature Notes

Form Detection

The current implementation scans visible:

  • input
  • textarea
  • select

It skips:

  • hidden inputs
  • disabled fields
  • elements not visible in layout

Answer Generation

The generator is currently a deterministic rules engine, not a live AI service.

It works by:

  • inspecting question text and field type
  • matching fields to saved profile properties
  • generating default review-required drafts for long-form prompts

This is deliberate because it keeps the extension runnable with zero setup.

Research Mode

The current "research" setting is a lightweight placeholder. It only uses page context such as the title or heading to slightly tailor long-form answers. It does not yet browse the web or call a research tool.

Limitations

  • side panel support depends on Chromium browser support
  • some highly custom component libraries may not fill reliably yet
  • contenteditable editors are not supported yet
  • grouped radio handling is basic
  • no validation against server-side form rules
  • no real LLM provider integration yet
  • no embeddings or answer memory yet
  • no encrypted storage or sync yet

Roadmap

Near Term

  • add a real LLM provider behind the generation interface
  • introduce structured JSON answer schemas
  • improve field grouping and selector robustness
  • add richer answer review metadata like confidence and source labels

Next Phase

  • add user-consented company and job research tools
  • support saved prior answers and reusable snippets
  • support resume and portfolio ingestion
  • improve handling for complex application forms

Later

  • team/shared profiles
  • secure sync
  • stronger privacy controls
  • file upload helpers
  • multi-step form memory

Development Notes

Because the project is buildless, iteration is simple:

  1. edit files
  2. reload the extension in chrome://extensions
  3. refresh the target page
  4. test again

Useful files:

  • manifest.json
  • background.js
  • content.js
  • sidepanel.js
  • options.js
  • lib/form-agent.js

Security And Privacy

FormAgent currently stores profile data locally in browser extension storage. That is enough for development, but not enough for a production release.

Before production, FormAgent should add:

  • clearer consent flows
  • encrypted storage strategy
  • provider-level data handling controls
  • explicit research permissions
  • sensitive-field redaction rules

Contributing

The codebase is intentionally organized so the next step can be either:

  • extension-only improvements
  • backend provider integration
  • LangChain-based orchestration

License

No license has been added yet. Add one before public distribution if you want others to reuse or contribute to the project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors