Skip to Content
Docs are being rebuilt — start at Introduction → How it works.

Custom-UI form agent

You’ll build an agent fronted by a custom form. Users fill in a few fields, the agent produces a structured result, and it generates a downloadable document.

The plan

  1. Create the agent
  2. Build a custom form interface
  3. Return a structured result
  4. Generate a downloadable document

Step 1 — Create the agent

Create an agent in Agents. In System instructions, describe what to do with the form inputs and what the final document should contain.

Step 2 — Build the form

Open the Interfaces tab and use the form schema builder to define the fields users submit. This gives the agent clean, predictable input every time.

Step 3 — Return structured output

Enable Structured output so the result follows a fixed schema — useful if the output also feeds another system.

Step 4 — Produce a document

Turn on Artifacts in the Capabilities tab so the agent can generate a formatted document the user can open, edit, and download. For document layout that needs computation, also enable code execution. Test the full flow from the builder preview.

Where to go next