You can expand your AI Agent’s functionality by configuring Actions. Each Action consists of an API call that you can configure behind the scenes. Then, your AI Agent automatically determines when to use it and how to handle the response.
This feature may not be included with your organization’s subscription package. For more information, see Ada’s Pricing page, or contact your Ada team.
Actions have the following constraints.
Actions enable your AI Agent to retrieve real-time data and perform tasks on behalf of end users.
Actions allow you to configure API integrations that your AI Agent uses automatically during conversations.
Get an Action running in minutes with this streamlined setup.
To create a basic Action:
For detailed configuration options, see Create an Action.
Configure and manage Actions to extend your AI Agent’s capabilities.
Configure an API call that your AI Agent can use to retrieve external data and include it in responses to end users.
To create an Action:
On the Ada dashboard, go to Config > AI AGENT > Actions.
If the API call you’re configuring requires authentication, you can add an authentication token that Ada stores securely. For more information, see Authenticate your AI Agent’s API calls using tokens.
Then, you can reference that token in one or more Actions, without
the contents of the token being visible in the UI. To reference the
token in an Action, you can type @ and start typing the name of the
token to insert it.
Click New Action.
The New Action page opens.
Under Identify this Action, enter a Name and Description for the Action.
The Name and Description provide important context to your AI Agent about when it should make the API call. Imagine you’re explaining to a human agent when they should perform the API call and the information you want to provide to end users - your name and description should cover this information.
Under Set usage, the AI Agent only uses this Action within Processes or Playbooks check box is selected by default. This means that the Action is restricted to only being used when a Process or Playbook refers to it.
Clear the check box if you want your AI Agent to be able to run the action independently, rather than in a larger step-by-step Playbook or Process.
If required, you can restrict Actions to certain users, based on information your AI Agent collects about your users and saves in variables.
You can only use variables your AI Agent can collect through your browser, or that you collect in a block and allow to be available outside of the structured content the block is in. You can’t use variables your AI Agent collects using Actions.
To make the Action available to all users, select Everyone.
To restrict the Action to certain users, select Based on the following rules. A section expands where you can enter the logic your AI Agent uses to decide whether to run the Action.
Comparison operators are logic statements that tell your AI Agent to match end user information that’s captured in the variable you’re using. The available operators vary based on the variable type you’re using:
To add a new top-level condition, click Add
.
If you’re adding your first additional top-level condition, in the dropdown that appears, choose And or Or as the operator for all of your top-level conditions.
To create or add to a group of conditions, click the Add to group icon
beside a condition you want to include in the group.
If you’re creating a group, in the dropdown that appears, choose And or Or as the operator for all of the conditions in that group.
Under Get input from chat, you can tell the AI Agent to ask end users for information it needs to make the API call. If your API call doesn’t require any additional information from the end user, you can skip this step.
If you add inputs to your Action, you must also include them in your API call, or your AI Agent won’t save your Action.
email or order_id).You can click Add to add additional inputs as needed.
Under Connect to API, enter the structure of the API call, using any tokens or inputs you created, or pieces of information the browser collected as a metavariable. For more information on how it does this, see setMetaFields in the Chat SDK documentation.
@ to see a list of available tokens,
inputs, or metavariables that you can select as a placeholder to
include in the URL.You can click Add to continue adding additional headers as required.
Under This API uses, select one of the following options:
Under Test API Response, you can test the API response to test whether it’s properly configured. From there, you can target portions of that response for your AI Agent to use in its responses to end users.
If your call doesn’t have any custom inputs, click Test to make a test call.
If you created custom inputs, click Set test values.
The Set test values window opens. For each input, enter a value to temporarily use for your test API call. Then, click Save and test to make a test call using those values.
If your call was successful, a response appears. You can hover over a portion of the response to highlight it, then click Add output to automatically populate the path to that portion of the response as an output for the next step.
Under Use API outputs in chat (Optional), you can specify portions of the API response that your AI Agent should save to include in its responses. If you don’t specify any outputs, your AI Agent still makes the API call, but it won’t use any information from the response when generating replies to end users.
The Path field uses JMESPath, which is a syntax that allows you to target part of an API response. For instructions and examples you can use if you need to write your own, click to open this expander:
You can use JMESPath to save portions of the API response for your AI Agent to use with end users. Even if the API response you’re using is in XML format, your AI Agent converts it to JSON so you can write all of your paths the same way.
As an example, let’s use the Star Wars API, which returns information about
the Star Wars movies. If you use the /films endpoint, you get a long
list of films and attributes that looks something like this heavily
truncated version:
You can target particular attributes or arrays in the response, depending on how the response is structured and what you’re looking for. Consider using the JMESPath online evaluator with your API response to verify that your path is successfully targeting the attributes you need.
You can read the full documentation at the JMESPath website to learn about the full list of available operators, but to get started quickly, here are some important techniques you’re likely to use:
In general, write a statement that goes from the broadest level of the API response down to the specific attributes that you’re trying to target. Some responses only have one level, or maybe all you want is a top-level attribute, which means you don’t have to worry about nesting. If that’s the case, your path can just be the name of the attribute you want to target.
If your API response contains nested attributes, here are several ways to target them:
After the parent attribute, you can denote which items in the array you want to target:
Use empty brackets [] to return all child items in a single
list.
Put a number in the brackets, like [0], to return a specific
child item. Again, remember that JMESPath starts counting at 0,
not 1.
You can filter results based on criteria you put in the brackets.
Use . before the name of a child attribute. You can target several
levels of nested attributes if required.
If the name of an attribute contains a hyphen, you have to put it in
double quotation marks "" so JMESPath can recognize it.
Here are a few simple examples of how to target specific parts of the Star Wars API response:
null.null) when the Action runs.You can click Add, or click additional portions of the test response, to add additional outputs as needed.
At the top of the page, you can click Save changes to save your Action as a draft, or click Publish to test it and make it available to end users.
Click Test to ensure that your AI Agent triggers your Action and includes information from the API response as expected.
Make sure you test different ways of phrasing questions, and if you included different outputs, different ways of asking for that information. If you find that your AI Agent isn’t responding properly, use an API client like Postman to verify that your call is formatted correctly, or consider editing the description of your Action or output names so your AI Agent can understand them more clearly.
Because your AI Agent sends the relevant portion of the API response through an LLM, the wording in your AI Agent’s responses varies between tests. While testing, focus on the information your AI Agent sends back, rather than the exact wording the LLM generates.
You can modify or remove an Action at any time.
To edit or delete an Action:
On the Ada dashboard, go to Config > AI AGENT > Actions.
Click the Action you want to modify, then make the required changes.
If the Action is a draft and you want to save changes to the draft without making the Action available to end users, click Save changes.
If the Action is a draft and you want to make it active, click Publish. As soon as you publish it, it becomes available to end users.
If the Action is active and you want to remove it from being active without deleting it, click Convert to draft. As soon as it becomes a draft, end users stop being able to use it.
To delete the Action, click the More options button
and
click Delete Action. In the confirmation message that appears,
click Delete again.