Building an AI chatbot
This is the simplest AI-powered chatbot automation:

Each time someone enters a chat message, the trigger fires, the AI model generates a response, and the response is sent back to the chat widget.
Follow the instructions below to build the simplest possible AI chatbot.
Begin by adding a trigger and select System Utility:

Then choose Automation Chat Widget:

Then choose the "new chat message (instant)" trigger:

The widget settings appears, which allow customization of the widget's appearance.

The default settings result in a widget like this:

Here is an example of a customized widget:

To test edits made to the widget's appearance, save the automation and click its play icon from the dashboard:

The widget will load in a separate web page. Then you can make edits to the widget's appearance settings, save the automation, and reload the test page to view your edits.
Be sure to scroll all the way down the settings, where the widget's embed code appears:

Use the copy icon shown above to copy the widget embed code to place the widget in your web page.
The brain of the chatbot is the AI model that responds to the chat widget user's prompts. Start by adding an action and choose to add an app:

Select "OpenAI Agent". You will need an OpenAI API key from https://platform.openai.com/api-keys to connect to their API, if you have not connected already.

Select the "send agent a message" action:

The settings will appear:

Let's walk through all of these settings:
The AI model can utilize information found in files uploaded to a vector store. To do that, first go to your OpenAI dashboard and open the Vector Storage page at https://platform.openai.com/storage/vector_stores. Then create a new vector store and upload files into it. Once the vector store has been created, it will then be selectable from the dropdown.
The AI model can optionally be allowed to make web searches to help it generate responses.
OpenAI has many AI models with varied performance and intelligence. In general, faster models have worse intelligence. You can review their models at https://platform.openai.com/docs/models.
These inform the AI model on how to format its output. The default instructions are suitable for use with the chat widget, where all output is done as HTML.
This identifies the conversation thread with a single chat widget user. When the widget first loads in a web page, a random conversation uuid is generated. Then that uuid is sent with all subsequent chat messages the user sends. Map the conversation uuid to the same field output by the new chat message instant trigger.

This OpenAI action utilizes the Conversation UUID to keep the conversation history with the AI model. This results in the AI model knowing the back-and-forth conversation history with the chat widget user.
Provide instructions on how the model is to behave. This is where you define the conversational tone, the chatbot's purpose, and place guardrails on what the model should avoid doing.
This is the input message to the model. For the chatbot, map the message emitted from the new chat message instant trigger.

To send the AI model's response back to the chat widget, start by adding an action and select "system utility":

Then select Automation Chat Widget:

Finally, select the "send chat response" action:

As with the AI model action, map the Conversation UUID field to the output from the new chat message instant trigger. Then map the message field to the response from the AI model.

That's it! You now have an AI-powered chatbot widget you can place on your web page.

Continue reading the following sections to learn how to build tool and goal automations to extend the functionality of chatbots.