Skip to content
QwryAI
Documentation
Pages

Widgets

Widgets Overview

Build interactive UI that your AI agent shows inline in conversations: forms, cards, tables, charts and more.

What are Widgets?

Widgets are interactive UI components that your AI agent shows inside a conversation. Instead of answering in plain text, the agent displays a card, a form, a table, a chart or a set of buttons right in the chat.

With a Widget, your agent can collect structured details, present data clearly and let visitors act, without leaving the conversation.

You'll find your Widgets under Build › Widgets.

Build › Widgets lists every Widget in the agent.

What You Can Do with Widgets

Key Concepts

These are the parts every Widget is made of.

ConceptDescription
CodeThe Widget's layout, written with the built-in components.
SchemaThe data fields the Widget expects, and their types.
DefaultThe values every field starts with when the Widget first shows.
ExamplesSaved sets of data for previewing other scenarios in the builder.
FunctionsWhat happens when a visitor clicks a button, submits a form or changes a field.
StatesNamed groups of elements that show or hide based on the Widget's current values.

Connecting Widgets to Actions

A Widget appears in a conversation through an Action. Build the Widget under Build › Widgets, then attach it to a Custom Action. When you create the Custom Action, choose Call API + show widget or Show widget as the action type.

This type has no API URL. The Widget gets its data straight from the details the AI agent collects.

Choose what the agent collects before it shows the Widget:

  • All widget variables: the agent collects every field in the Widget's schema.
  • Only the variables I choose: the agent collects only the variables you list. Anything else keeps the Widget's default value.

Best suited for:

  • Forms that collect details from visitors
  • Information cards and menus
  • Interactive elements that don't need outside data

Data Flow for Call API Actions

  1. The AI agent runs the Action

    The agent decides to run the Action and gathers the inputs it needs.

  2. The Action calls your API

    The Action sends a request to your API URL with those inputs.

  3. Your API responds

    Your server handles the request and returns a JSON response.

  4. The response is merged with the Action's inputs

    The API response is combined with the inputs. When both have the same field, the API response wins.

  5. The Widget shows the combined data

    The Widget receives the merged data and renders it in the chat.

Where Widget Data Comes From

A Widget's data can come from several places. Higher-priority sources override lower ones.

PrioritySourceDescription
1 (lowest)DefaultThe Widget's default values from the builder.
2Action inputThe details the AI agent collected for the Action.
3 (highest)API responseThe data your API returned (Call API actions only).

File Uploads

Widgets can take files from the visitor and send them straight to an endpoint you control, then show or reuse the uploaded file's URL. Add an Upload file function to a button. See File Uploads.

Import and Export

Share Widgets between agents, teams or projects as .widget files.

Exporting a Widget
  1. Open the Widget in the builder.
  2. Click the ⋯ menu in the top-right corner.
  3. Select Download to save the Widget as a .widget file.

The file holds the Widget's code, schema, default values, examples, functions and states.

Importing a Widget
  1. Go to Build › Widgets and open the Create Widgets tab.
  2. Click Upload Widget.
  3. Choose a .widget file of up to 1 MB.

The Widget opens in the builder. Click Create to save it, then attach it to any Action.

Download and Upload are in the Widget options menu.
Upload Widget installs a .widget file.

Next steps

Explore the documentation