AI is not just a buzzword at RevCent. We are all-in on AI, specifically OpenAI, and have built tools for our users to combine AI with their RevCent account. AI is becoming a core component of RevCent, bringing advanced capabilities and automation throughout many aspects of the ecosystem.
Below are the current ways to implement and use AI specific to your RevCent account.
The RevCent GPT is available in the OpenAI GPT Store. You can use the RevCent GPT to perform a select number of actions specific to your RevCent account. Add the RevCent GPT to your list of OpenAI GPT's in the OpenAI web, mobile or desktop app.
When first adding the RevCent GPT to your OpenAI list of GPT's you will need to grant OpenAI access to your RevCent account. OpenAI will forward you to the RevCent OAuth login page where you can grant access in a few clicks. Once you grant access, you can begin conducting select actions specific to your RevCent account.
At this time the RevCent GPT is limited in the number of actions that can be performed as well as the amount of data it can process. This is due to OpenAI's limits on all custom GPT's, not the RevCent GPT configuration. We recommend using a RevCent AI Assistant if you require more actions than are available in the RevCent GPT.
Below is a list of available actions you can perform within the RevCent GPT. As OpenAI expands its limits on custom GPT's, we will be able to add more actions.
Action | Prompt Example | Description |
---|---|---|
Chargeback: Create | Create a chargeback for the transaction you found. | Create a chargeback using an existing transaction. Recommended to first ask the AI to search for the transaction, verify its the correct transaction, then tell the AI to issue a chargeback on the transaction it found. |
Customer: Search | Find the customer George Washington. | Will search and find one or more customers using the search term. |
Customer: Disable | Disable the customer you found. | Will disable a specific customer. Recommended to first ask the AI to search for the customer, verify it is the correct customer, then ask it to disable the customer it found. |
Fraud Detection: Create | Create a fraud detection for the sale you found. | Create a fraud detection specific to a sale or transaction. Recommended to first ask the AI to search for the item, such as a sale, verify its the correct item, then tell the AI to create a fraud detection on what the item. |
Gateway Group: Add Gateway | Add My New Gateway to the Good Gateways group. | Will add a gateway to the gateway group you specify. |
Gateway Group: Remove Gateway | Remove the Bad Gateway from the Good Gateways group. | Will remove a gateway from the gateway group you specify. |
Key Value: Edit | Edit the key value Dynamic Profile to My New Profile. | Will change the the key value you specify to the new value. |
Product Sale: Refund | Refund the USB HDD product sale. | Will refund a specific product sale. Recommended to first ask the AI to search for the associated sale, verify its the correct sale, then tell the AI to refund a purchased product within the sale it found. |
Sale: Search | Search sales for George Washington. | Will search and find one or more customers using the search term. |
Sale: Void | Void the sale you found. | Will void a specific sale. Recommended to first ask the AI to search for a sale, verify its the correct sale, then tell the AI to void it. |
Sale: Query | What was the total profit per campaign last month? | Will conduct aggregations on sales data, similar to the user dashboard. |
Shipping: Search | Find the shipment for George Washington. | Will search and find one or more shipments using the search term. |
Shipping: Refund | Refund the shipment you found in full. | Will refund a specific shipment. Recommended to first ask the AI to search for the shipment, verify its the correct shipment, then tell the AI to refund it. |
Subscription: Search | Search for the AV 2017 subscription for George Washington | Will search and find one or more subscriptions using the search term. |
Subscription: Cancel | Cancel the subscription you found. | Will cancel a specific subscription. Recommended to first ask the AI to search for subscription, verify its the correct subscription, then tell the AI to cancel it. |
Transaction: Search | Search for the transaction with gateway ID 123456. | Will search and find one or more transactions using the search term. |
Transaction: Refund | Refund the transaction you found for $20. | Will refund a specific transaction. Recommended to first ask the AI to search for the transaction, verify its the correct transaction, then tell the AI to refund it. |
Transaction: Query | What was the approval percentage per gateway this month? | Will conduct aggregations on transaction data, similar to the user dashboard. |
Trial: Cancel | Cancel the 2 Bottle Free Trial. | Will cancel a specific trial. Recommended to first ask the AI to search for the associated sale, verify its the correct sale, then tell the AI to cancel the trial within the sale. |
Trial: Search | Find the trial for George Washington | Will search and find one or more trials using the search term. |
You have the ability to integrate AI within your RevCent account through the use of a RevCent AI Assistant. Add an OpenAI account to RevCent, create a RevCent AI Assistant and take advantage of AI via web chat or automation.
A RevCent AI Assistant combines your RevCent account with the capabilities of AI using OpenAI's technology. You can create multiple RevCent AI assistants, each performing different roles.
An AI Assistant can serve one of two purposes:
There are important concepts to understand when using a RevCent AI Assistant, especially as it related to performance and costs within your OpenAI account.
When creating or modifying the third party integration linked to the AI Assistant, you should always select the most advanced model OpenAI has available. Selecting an older model will cause problems such as: less context tokens allowed, limited capabilities and overall poor results.
When you want to change the model for an AI Assistant you must do the following:
RevCent does not charge extra for integrating AI or using a RevCent AI Assistant. However, OpenAI does cost money and can be expensive depending on model used and the models' price per token. RevCent is not responsible for charges you incur within your OpenAI account. However, RevCent does provide the ability to limit token usage via Usage Limits.
Each time a RevCent AI Assistant interacts with the AI, tokens are consumed. The price per token differs based on the OpenAI model chosen in your third party integration settings. RevCent gives a best effort to minimize the number of tokens consumed, but most interactions with the AI will consume numerous tokens given the nature of combining RevCent data with AI capabilities. For example, when asking the AI information on a sale, the AI must analyze the entire sale, which consumes on average 2700 tokens. Please take token usage into consideration when creating and using a RevCent AI Assistant.
When a new web chat is started, or an autonomous assistant is triggered, it generates a thread within OpenAI. A thread in OpenAI is a series of back and forth messages between the RevCent AI Assistant and the AI.
Examples:
Threads Are Stateless
At this time, an OpenAI thread is stateless, i.e. it does not “remember” previous messages in a thread. Due to AI's stateless nature, a thread can consume a high number of tokens. Every time a new message is sent by the user or assistant, the AI must first process all prior messages before responding to the new message. Hence the longer a thread is, the consumption of tokens becomes exponential based on the number and length of all messages. This can lead to high costs, so please keep thread length in mind. You have the ability to limit token usage at the thread level via Usage Limits.
The stateless nature of AI is it's achilles heal and well known throughout the industry, hence why even simple GPT chat length is an issue. It is the current technology within OpenAI, and not RevCent's implementation of OpenAI. Hopefully in the future OpenAI can optimize prior message token consumption, or give the AI the ability to “remember” prior messages without having to re-read them.
The reason to use a RevCent AI Assistant is not to just talk to the AI, but to also give the AI the ability to conduct actions specific to your RevCent account. You may want to have the AI create a note, find a sale, send an email, etc. The AI can intelligently read a message and take any available actions it determines are necessary.
There are two types of actions you can make available to the AI:
When setting up a RevCent AI Assistant, you specify the actions available to the AI. It is important to note that each action available to the AI consumes tokens by simply being made available. The AI must analyze all available actions on each user message to determine if there are any to use. RevCent attempts to minimize token use by the AI when analyzing actions by giving you the ability to enable only certain actions, including enabling certain actions at specific steps within an autonomous agent.
Actions are a powerful capability within a RevCent AI Assistant, but must taken into consideration when calculating OpenAI costs.
Below are the general settings that apply to a RevCent AI Assistant.
Select the third party integration you already created in RevCent for your OpenAI account. This should have been done as part of the Getting Started guide.
Important: You must provide the clear instructions for the AI. The AI needs to know what its purpose is, so it will read the initial instructions you set and act accordingly.
Below are example instructions based on assistant type, however please do not simply copy and paste. Write your own clear instructions based on your specific needs.
Example for a Web App Assistant:
You are a chat assistant, used internally within an ecommerce company called Acme Inc. You are meant to help customer service representatives find relevant information and take potential action.
Example for an Autonomous Assistant:
You are an automated assistant for an ecommerce company called Acme Inc. You are activated when a customer makes a purchase on the Acme Inc. online shopping cart.
Select the assistant type which determines how the AI Assistant will be utilized. Additional settings are available depending on the assistant type chosen.
Important: Limit the amount of tokens consumed by the AI Assistant to minimize OpenAI costs. It is highly recommended that you set at least one of these limits.
When an assistant is of type Web App, a user communicates directly with the AI Assistant using the AI chat box in the RevCent web app.
You are able to limit the use of the web assistant to specific users and specific system actions.
The chat box is available by clicking the AI Assistant button on the top navigation when logged into RevCent.
When an assistant is of type Autonomous, you do not communicate directly with the AI. Instead, the RevCent AI Assistant is activated based on trigger settings and runs autonomously in the background, communicating with the AI based on the design of your thread. Depending on the trigger, different options will be available to limit the assistant to only run on certain conditions and filters.
The autonomous assistant provides settings specific to what activates the assistant, i.e. the trigger.
Select the AI assistant trigger. This is what will activate the assistant, allowing it to run autonomously when the trigger occurs.
The period of time to wait until the assistant thread officially starts. Default minimum is 1 minute, maximum is 30 days.
Only available for Event and Flow trigger types. You have the option to only activate the assistant based on attributes of the item specific to the trigger. Before triggering the AI Assistant from a flow or an event, RevCent will check any filters to see if the item matches said filters. This enables you to only trigger the AI Assistant for items specific to a campaign, shop, metadata, etc.
Using the autonomous assistant provides additional tools.
System actions are built into the AI assistant and allow it to perform many different types of RevCent API calls on your behalf. Many of the methods listed on the API V2 Docs are also System Actions within an AI Assistant. System actions are performed by the AI Assistant automatically, without any coding necessary. The AI is intelligent enough to know what endpoint to call, fields that are required, etc.
System actions are opt-in only, meaning they must be explicitly made available to the AI. You make system actions available in a Web assistants' web settings, or within a step node in an Autonomous assistant thread. When a system action is made available, RevCent provides the AI with the system action description and schema so the AI is aware of its availability and settings. The AI will read each system actions' description and schema, then make the API call on your behalf either automatically or when you tell it to.
If you were to enable every system action, you would consume an enormous amount of tokens each time the AI Assistant interacts with OpenAI. The AI analyzes all available actions when processing requests, thus it will consume tokens as it reads the description and schema of each system action. By design, an AI Assistant must have systems actions enabled/made available in order to limit the amount of tokens you will consume. It is highly recommended to only make available the system actions an AI Assistant may/will need at the Web Settings or thread node level.
Below are system action examples for both the Web and Autonomous assistant type.
Web Assistant
With the web assistant, you can simply ask the AI to “Find the customer with the name George Washington”. The AI will review system actions you made available, find the Customers > Search system action, and perform the correct API call to find the customer. The details of the customer which matched the name George Washington will be provided when the search completes. All you did was ask it to find something and it took care of the rest. In this example, the following system actions should have been made available within the Web Settings tab of the AI Assistant: Customers: Search and Customers: Get A Customer.
Autonomous Assistant
With the autonomous assistant, you make system actions available within each step node in the thread. If a step node message is “Add the customer to the High LTV group”, the AI will get all customer groups, find the High LTV group, then add the customer to the group with the name High LTV Group. In this example, the following system actions should have been made available within the node: Customer Group: Get Customer Groups and Customers: Add Customer to Group.
Autonomous assistant type only. A custom action allows you to greatly expand the use of an autonomous assistant by providing the AI with additional capabilities that are customized by you.
Provide your custom action with a name. You will want to be able to identify the action that was run, so name it distinctively.
Important: Provide the action with a detailed description of what it is meant for. The AI will read the description when deciding whether to run the custom action. Be descriptive and tell the AI exactly what the action is for and when/whether to use it.
Letting the AI decide:
Only run this action if the order amount is greater than $500. This custom action will send a thank you email for high value orders.
Preventing the AI from deciding:
Only run this custom action when explicitly told to do so.
A custom action must have a target. Depending on the target, it can receive data related to the event and any data generated by the AI.
Custom arguments are one of the core components when using a custom action. Please read this section carefully to understand how and why you should use custom arguments.
Unlike normal chat GPT's, the RevCent AI Assistant does not use the AI's reply message as the input data for action targets. Instead, you use a more structured approach to receiving the AI response data you need.
For example, with a common chat GPT you would tell the AI to write a paragraph, and the AI's response message would be the paragraph it generates. However, with a RevCent AI Assistant you would instead tell the AI to write a paragraph, but to provide the paragraph it generates as a custom argument.
Why not just use the AI reply message?
You may want the AI to find or generate multiple items, and send the data to the action as easily accessible individual properties for each.
For example, you can send the AI the following message: “Generate customized email content for a purchase and set it as the “email_content” argument, and also find the source marketing channel the purchase came from and set as the “source_channel” argument”.
In the action you would create two custom arguments, one named “email_content”, and a second named “source_channel”. This way you are able to generate multiple outputs using one AI message, each being an input directly accessible at the action target, i.e. custom_arguments.email_content and custom_arguments.source_channel.
Below are examples of how you would use Custom Actions to find or generate data, then forward the data to the custom actions' target.
Example 1
You previously created a RevCent Function called Facebook Conversion Post which notifies Facebook of a conversion using the sale click ID. When a new sale is paid, you want the AI to attempt to find the “fbclid” and forward it to the Conversion Function as “facebook_click_id”. The Conversion Function code should be written to parse the AI data custom argument called facebook_click_id, then use the click ID to notify Facebook. Notice how we told the AI not to run the custom action if it can't find the click ID.
Assistant Trigger: Event > sale.created.success.paid
Action Target: Facebook Conversion Post
Argument Name: facebook_click_id
Argument Description: Find the metadata value where the metadata name is “fbclid”. If you cannot find the metadata value for fbclid, do not run this action.
Sent to target:
{
"ai_data": {
"custom_arguments": {
"facebook_click_id": "fb_sahSHFISAfxxx" // The AI will find the facebook click ID based on your argument description.
}
}
}
Access at target: ai_data.custom_arguments.facebook_click_id
Example 2
You previously created an Email Template called Additional Thanks Email. The email template has the shortcode {{ai_data.custom_arguments.thank_you_paragraph}} within the email content. When a successful sale triggers the AI Assistant, the AI will read the custom argument description and trigger the email template with a custom generated paragraph. The shortcode will output the thank_you_paragraph custom argument, with the contents being the paragraph the AI generated. The email recipient will receive an email with an AI generated paragraph thanking them for purchasing the product they paid for.
Assistant Trigger: Event > sale.created.success.paid
Action Target: Additional Thanks Email
Argument Name: thank_you_paragraph
Argument Description: Create a customized html paragraph thanking the specific customer for the purchase of the product. Make the product name in bold.
Sent to target:
{
"ai_data": {
"custom_arguments": {
"thank_you_paragraph": "<p>We would like to thank you George for purchasing the <strong>Laptop X400</strong>.</p>" // The AI will generate the HTML based on your argument description.
}
}
}
Access at target: ai_data.custom_arguments.thank_you_paragraph
Example 3
You previously created an Email Template called Daily Report Email and an Auto Query which points to the AI assistant. The email template should have the shortcode {{ai_data.custom_arguments.query_results_table}} within the email content. When the auto query triggers the AI Assistant, the AI will read the custom argument description, generate an HTML formatted table and trigger the email template with the table as the custom argument name. The email template shortcode will output the query_results_table custom argument, with the contents being the report results HTML table. The email recipient will receive an email with a human readable report result.
Assistant Trigger: Auto Query
Action Target: Daily Report Email
Argument Name: query_results_table
Argument Description: Create a html formatted table based on the query results.
Sent to target:
{
"ai_data": {
"custom_arguments": {
"query_results_table": "<table><tr><th>Product Name</th><th>Amount Gross</th></tr><tr><td>USB HDD</td><td>625.92</td></tr><tr><td>Laptop X400</td><td>452.07</td></tr></table>" // The AI will generate the HTML table based on your argument description.
}
}
}
Access at target: ai_data.custom_arguments.query_results_table
Autonomous assistant type only. Each time an autonomous assistant is triggered, it generates a unique thread within OpenAI. The thread builder is where you design how the RevCent AI Assistant thread will run, including steps, actions and branching.
The thread builder consists of nodes, which you connect in the order you want processed when the thread runs. Connect nodes to one another as a sequence of events in which the assistant interacts with the AI. Additional nodes are available to either wait a period of time or end the thread entirely.
The start thread node only occurs once when building a thread. It is the starting point for the thread, i.e. where the thread begins to run after the trigger has occurred.
A start thread node will begin with a message the AI. The message to the AI is pre-determined based on the event and item type that triggered the assistant. For example, if the assistant is triggered by a new sale, the start thread node will first ask the AI to retrieve the details on the specific sale. The AI will retrieve the sale details and keep the sale details in the thread message history. This gives the AI the initial context and information it needs for the remainder of the thread, i.e. reference the sale in future thread messages without needing to retrieve the sale details again.
The thread step node contains the message the AI will receive, as well as make available any actions the AI may need. A thread step has both system actions and custom actions you can make available for the specific step. The reason for actions being opt-in per step is to limit token consumption and prevent AI confusion. You only want the AI to know what it can do at each specific step within the thread.
The step message is sent to the AI instructing the AI what to do at the specific step in the thread. Write the message the same as you would for a human, being very clear and precise. The AI will read the message as well as system and custom actions. The AI will determine what, if anything, to do based on your message in combination with the actions available.
Select one or more custom actions you created to make available to the AI for the specific step. Only select the custom actions the AI may need for the specific step.
Select one or more system actions to make available to the AI for the specific step. Only select the system actions the AI may need for the specific step.
Below are some example thread steps, showing what is possible by simply messaging the AI as if it were a human.
Step Example 1
Step Example 2
The thread branch node gives you the ability to have the AI choose an output path to take. This allows you to split a thread based on one or more conditions. You write the message for each output path as an individual condition. When the thread runs and reaches a thread branch node, RevCent will first format your output messages into a single conditional statement and send it to the AI. The AI will know it is a conditional statement and that it must choose only one output. The choice the AI makes determines the path the thread will resume on.
The are four possible outputs the AI can decide to take, three of which you set the condition for using a message. The fourth output is reserved as a catch all in case the AI does not choose from one of the outputs you set. You do not need to use all three outputs available to you, but you must use at least one.
Each output message you write is an individual condition, where if true, the AI should choose the specific output.
Here is a basic example of splitting a thread using a branch node.
Let's say you want to split the thread based on what was purchased in a sale. If the customer purchased a USB you want to branch one way, if a Laptop another way, if neither USB or Laptop then another way.
You create the branch node with a different message for each output 1, 2 and 3:
RevCent will format your output messages (conditions) into a final statement meant for the AI. The AI will read the conditional statement RevCent created and determine the output result. For example, if a new sale is placed where the customer purchased a Laptop X400, the AI would determine that output 2 is the output result, thus splitting the thread at the branch nodes' output 2.
The time delay node allows you to pause the thread for up to 30 days, giving you time to wait for specific updates that may occur related to the item that triggered the event. Minimum is 1 minute, maximum is 30 days.
The end thread node allows you to end the thread. May be useful for identifying when you do not wish to continue within the thread builder. Any time a thread no longer has an additional node to continue to, it will self end.
When implementing AI in functions, flows or email templates, you will want to access the AI details. The AI details will be contained within the ai_data
object. Any custom arguments will be contained within the ai_data.custom_arguments
object.
Below is an example ai_data
object. The ai_data object contains details about the AI Assistant in RevCent as well as OpenAI. The specific item type, item id and related metadata are also included. Notice the thread messages object, which contains the messages from both the user and assistant in descending time order.
The most important information contained within the ai_data object is the ai_data.custom_arguments
object. The custom_arguments object will contain the argument name and AI output for each custom argument you added within a custom action.
{
"ai_data": {
"custom_arguments": {
"customer_card_id": "XKob65Bn8qfqmWggp99B",
"customer_card_type": "VISA"
},
"assistant": {
"id": "asst_304kIxIGvO6JcJ4X9u9smGOY",
"object": "assistant",
"name": "Trigger Assistant",
"model": "gpt-4-turbo",
"top_p": 1,
"temperature": 0.2,
"metadata": {
"revcent_ai_assistant": "yRdBXQMj82T9Vrn8RpBE"
}
},
"thread": {
"id": "thread_ntI40nT1mwLwMrhDCdH58uAj",
"object": "thread",
"created_at": 1714575558,
"metadata": {
"revcent_ai_assistant_id": "yRdBXQMj82T9Vrn8RpBE",
"revcent_ai_assistant_name": "Trigger Assistant",
"revcent_item_type": "sale",
"revcent_item_id": "1RoNP4nAr0f6vk22lAAq"
}
},
"thread_messages": [
{
"id": "msg_0xkrYried4JVnZL7eHnSIk8w",
"object": "thread.message",
"created_at": 1714575804,
"thread_id": "thread_ntI40nT1mwLwMrhDCdH58uAj",
"run_id": null,
"role": "user",
"content": [
{
"type": "text",
"text": {
"value": "If a laptop was purchased run the following action: Assistant Data Function.",
"annotations": []
}
}
]
},
{
"id": "msg_AU9rteTDjXGbZiPZZiz8YjK9",
"object": "thread.message",
"created_at": 1714575687,
"thread_id": "thread_ntI40nT1mwLwMrhDCdH58uAj",
"run_id": "run_efxbCfSQZ8Dy4YYPjVFVgvez",
"role": "assistant",
"content": [
{
"type": "text",
"text": {
"value": "The details for the sale with ID `1RoNP4nAr0f6vk22lAAq` are as follows:...",
"annotations": []
}
}
]
},
{
"id": "msg_AybC4hhICfWKJUAioXakZ0VY",
"object": "thread.message",
"created_at": 1714575558,
"thread_id": "thread_ntI40nT1mwLwMrhDCdH58uAj",
"run_id": null,
"role": "user",
"content": [
{
"type": "text",
"text": {
"value": "Get the details of the sale with ID: 1RoNP4nAr0f6vk22lAAq"
}
}
]
}
],
"thread_run": {
"id": "run_LKnxWPMnpNAvOUvkipshS8DG",
"object": "thread.run",
"created_at": 1714575805,
"assistant_id": "asst_304kIxIGvO6JcJ4X9u9smGOY",
"thread_id": "thread_ntI40nT1mwLwMrhDCdH58uAj",
"status": "requires_action",
"started_at": 1714575805,
"expires_at": 1714576405,
"required_action": {
"type": "submit_tool_outputs",
"submit_tool_outputs": {
"tool_calls": [
{
"id": "call_NeXFEOm6vANc1NoDUj1reK0V",
"type": "function",
"function": {
"name": "assistantDataFunction_Action",
"arguments": ""
}
}
]
}
},
"model": "gpt-4-turbo",
"tool_resources": {},
"metadata": {
"revcent_ai_request": "yRdWbvEzYVCVVbJW0mdJ",
"revcent_ai_assistant_id": "yRdBXQMj82T9Vrn8RpBE",
"revcent_ai_assistant_name": "Trigger Assistant",
"revcent_item_type": "sale",
"revcent_item_id": "1RoNP4nAr0f6vk22lAAq"
},
"temperature": 1,
"top_p": 1
}
}
}
When the AI Assistant action is a Function, the functions' event data will contain the item_details of the specific item being processed. If the AI assistant was triggered by an Auto Query, the query_results array will be present within the item_details object.
Notice the ai_data object is contained within the main data object, along with the item_details object. Access the AI details within the function code via event.data.ai_data
object. Access any custom arguments via the event.data.ai_data.custom_arguments
object.
{
"event": {
"data": {
"item_details": {
"id": "Q4nGRNpLgpS92QqGLwlX",
"first_name": "George",
"last_name": "Washington",
"query_results": [
{
"group_by_value": "Bundle Product",
"sale_sum_amount_gross": 625.92
},
{
"group_by_value": "Laptop X400",
"sale_sum_amount_gross": 452.07
}
]
},
"ai_data": {
...,
"custom_arguments": {
...
}
}
}
}
}
When the AI Assistant action is an email template, the templates' input data differs based on the AI Assistant's trigger. If the AI assistant was triggered by an Auto Query, the query_results array will be present.
Notice the ai_request object is contained as a property within the input data items' details. Access the AI details via ai_data
object. Access any custom arguments via the ai_data.custom_arguments
object.
{
"id": "Q4nGRNpLgpS92QqGLwlX",
"first_name": "George",
"last_name": "Washington",
"query_results": [
{
"group_by_value": "Bundle Product",
"sale_sum_amount_gross": 625.92
},
{
"group_by_value": "Laptop X400",
"sale_sum_amount_gross": 452.07
}
],
"ai_data": {
...,
"custom_arguments": {
...
}
}
}