Skip to main content

Forms

Introduction

Forms enable your Assistant Agent to gather data from conversations with users. If you need to collect contact emails, ratings, feedback on products, or other structured data, the agent will guide the conversation to obtain this information.

How to Use

In this example, we will use an existing agent to create a new Form and configure how data will be collected during the conversation. For guidance on creating an Assistant Agent, refer to this guide.

Create a Form

  1. Navigate to the Forms tab.

    Form Tab

  2. Click on the "Add Field" button.

    Add Field

  3. Select the data type you wish to collect. Different data types provide additional context for the agent to ensure the correct information is gathered.

    Select Data Type

  4. Define how the agent should collect that data. Include the name, specify if it is required for completing the form, and provide any additional instructions for the agent to collect and validate the information.

    Field Definition

  5. Specify when in the conversation the agent should ask the user for this information.

    • Conversation Start: The agent will attempt to gather all the information as soon as possible.
    • After a Few Messages: The agent will first engage in a normal conversation and later start asking questions regarding the form.
    • Custom: Define a custom instruction for the agent on how to gather the data.

    Instructions Selection

  6. Test the agent using the preview chat. Evaluate its performance and how it steers the conversation. Adjust your prompts, field descriptions, and instructions based on your expected behaviour. Once you are satisfied with the results, publish your agent and begin collecting data.

    Form Evaluation in Preview

Note: Form data retrieved in draft versions of the agent is not included in the final data collection.

Access Form Data

Once your agent is published and collecting form data, you can access it from the agent card by clicking the "Forms" button. On this page, you can view all the form data collected by the agent and export it to an Excel file.

Forms are versioned; each change to the form definition creates a new version linked to the version of the agent. If changes are made to the agent but not to the form definition, the form version remains the same when saving the changes. From the Form grid, you can filter collected data by version. By default, the form corresponding to the published agent is shown first.

Form Access from Agent List Form grid

Tips

  • Clear Instructions and Field Descriptions: Ensure consistency between agent behavior, custom form instructions, and field descriptions to promote predictable outcomes.
  • Data Validation: Specify any validation needed for the data, such as ensuring a valid email address is provided or that phone numbers include the country code.
  • Model Selection: Form behavior may vary between different LLM models and tool usage support. Choose models that demonstrate strong support or understanding of the required skills.
  • Real world implementation: For a practical example of using forms in a real-world scenario, check out our blog post on lead generation with forms, which provides a complete walkthrough of setting up forms for collecting customer leads.