Building forms with AI
Building forms with AI
Section titled “Building forms with AI”The AI builder is the heart of AmazingForms. This guide explains how to get the best out of it.
Writing a good prompt
Section titled “Writing a good prompt”The AI builder understands plain English. You do not need special syntax. But better prompts produce better forms.
Include:
- What the form is for (the business context)
- Who fills it in
- What fields you need (or a general description of what data you want)
- What should happen after submission
Example — vague prompt:
A contact formExample — good prompt:
A quote request form for my roofing business. Collect the customer's name,email, phone number, home address, and photos of the problem area.After submission: score how urgent the job looks, text me if it scores above 70,and send the customer an email promising a callback within 24 hours.The second prompt produces a 5-field form with a file upload, a workflow that calls an AI scoring step, a conditional SMS alert, and a personalised email reply.
What happens under the hood
Section titled “What happens under the hood”AmazingForms uses a NL to readable DSL to validated schema pipeline. This is not an LLM writing raw PHP — it is safer and far more reliable.
- Natural language in — your prompt goes to a small reasoning model
- DSL generated — the model writes a readable intermediate language (structured YAML-like instructions)
- Validated — the DSL is checked against a schema of whitelisted primitives; invalid instructions are rejected, not executed
- Schema out — the form schema and workflow definition are written to the database
This means:
- The AI cannot execute arbitrary code
- Errors are caught before they reach your site
- You can inspect and edit the output in the visual editor
The agentic workflow layer
Section titled “The agentic workflow layer”After your form is built, every submission triggers an AI agent. The agent:
- Reads the submission data
- Reasons about it (qualification, urgency, sentiment, completeness)
- Executes the actions you described: replies, alerts, CRM updates, integrations
The agent uses hierarchical tool-calling: it first decides what kind of action to take, then fetches the configuration for that action. This keeps inference costs low — it never loads the entire plugin surface into context for a simple reply.
Example agent trace
Section titled “Example agent trace”For the roofing quote form:
Agent: Read submission — John Smith, 14 Oak Lane, roof photos attachedAgent: Score urgency — photos show active leak, date mentioned "this week" — 91/100Agent: Route — Hot (score above 70)Agent: Send SMS to owner — "Hot lead: John Smith, 14 Oak Lane, 91/100 urgency"Agent: Generate reply — personalised callback promise in owner's toneAgent: Send reply to John SmithAgent: Create CRM contact — tagged roofing, hot-lead, pipeline stage: NewAll of this runs automatically, within seconds of submission.
BYOK vs managed credits
Section titled “BYOK vs managed credits”AmazingForms supports two AI modes:
| Mode | How it works | Best for |
|---|---|---|
| Managed credits | AmazingForms proxies calls to a small, cheap model | Most freelancers — lowest friction |
| BYOK | You supply your own API key (OpenAI, Anthropic, etc.) | High volume, frontier models, data privacy |
You can set per-form and per-workflow-step model preferences. Per-step routing means a lead qualification step can use a cheap fast model, while a nuanced reply generation step can use a stronger one.
Setting your API key
Section titled “Setting your API key”In AmazingForms → Settings → AI:
- Select BYOK
- Enter your API key
- Select default provider and model
- Save
Your key is stored encrypted in wp_options and is never transmitted to AmazingForms servers.
Editing AI output
Section titled “Editing AI output”After the AI builds a form, you land in the visual editor. Everything is editable:
- Rename, reorder, delete fields
- Change field types (text to textarea, select to radio)
- Edit validation rules
- Add or remove workflow steps
- Change the AI reply template
The visual editor writes back to the same schema format — the AI and the editor speak the same language.
Tips and limits
Section titled “Tips and limits”- Prompt length: up to ~2,000 characters. Longer is fine but rarely helps.
- Photos / files: always use the phrase “upload” or “attach” — the AI will add a file field.
- Conditional logic: say “only show X if Y is answered” — the AI handles it.
- Multi-step: say “split this into 3 steps” or “make it a wizard” — it will paginate the form.
- Reply tone: paste 2-3 sentences of your own writing and say “reply in this tone” for better personalisation.