Custom Agent Tutorial 3 - Building an Outbound AI Agent

Custom Agent Tutorial 3 - Building an Outbound AI Agent

Introduction

In this tutorial, we will create an Outbound AI Agent to automate business outreach using phone calls and emails. The AI agent will engage with new contacts, introduce Prospera Labs AI solutions, and drive lead conversion.

The AI Agent Will Perform the Following Tasks:

  1. Trigger an outbound phone call when a new contact is added to the system.

  2. Engage in a structured conversation to introduce the business, identify customer needs, and schedule a demo or facilitate a purchase.

  3. Offer the contact an option to schedule a demo.

To build the Outbound AI Agent, we will go through the following steps:

  • Create a contact data schema to store lead information.

  • Define a smart chain that triggers the outbound call.

  • Configure a conversation flow to drive interactions and the scheduling process.

  • Test the entire outbound system to ensure functionality.

Step 1 - Creating a Contact Data Schema

The first step in setting up our outbound agent is to create a structured way to store contact information. This ensures that each call has the necessary details, such as the recipient’s name, phone number, and email address.

To do this, we will define a Custom Data Schema (contacts_list).

Log in to your Custom Agent environment, navigate to Configuration → Advanced → Custom Data Schema and click on Create New Schema.

image-20250217-154640.png

Punch in the machine name, title and description.

image-20250217-154809.png

In the Schema section, punch in the following text for the JSON schema to define the structure of your data.

{ "type": "object", "title": "", "description": "", "properties": { "name": { "type": "string", "title": "Name", "description": "Name of the customer", "properties": {}, "multiline": false, "rows": 1, "show_in_table_view": true, "table_view_order": 1, "placeholder": "", "form_input_type": "text", "required": false, "options": [], "optionLabels": [], "default": "" }, "email": { "type": "string", "title": "Email Address", "description": "Email address of customer", "properties": {}, "multiline": false, "rows": 1, "show_in_table_view": true, "table_view_order": 2, "placeholder": "", "form_input_type": "text", "required": false, "options": [], "optionLabels": [], "default": "" }, "contact": { "type": "string", "title": "Contact Number", "description": "", "multiline": false, "rows": 1, "show_in_table_view": true, "table_view_order": 3, "placeholder": "", "form_input_type": "text", "required": false, "options": [], "optionLabels": [], "default": "" } } }

After that, you need to set an icon for your contacts_list to easily view the data.

To do this, click on the search icon, and a new window will pop up where you can select any Material Icon of your choice for the data schema.

Once you have selected the icon, check the box for Show in Left Menu so that your saved data appears in the left menu for easy access.

image-20250217-155116.png
image-20250217-155306.png

Finally, you can click on Create New Custom Data Schema

image-20250217-155554.png

Step 2 - Setting Up the Smart Chain for Outbound Calls

Now, we will begin creating a Smart Chain for outbound calls. To do this, navigate to Configuration → Advanced → Smart Chains and click on Create New Smart Chain.

image-20250217-173953.png

You will see a screen displaying the Smart Chain with one step. Click on the Menu option to view the step details.

image-20250217-174313.png
image-20250217-174403.png

By default, the plain_text_template type is configured for steps in the smart chain. However, for outbound calls, the step type must be changed to Start Outbound Conversation.

image-20250217-174154.png

Under the Options section, you can configure parameters such as phone number, email address, subject, smart chain binding name, and metadata as per your requirements. For now, I am setting the smart chain binding name to "default". I will explain how to modify this setting in the upcoming steps.

image-20250217-174754.png

Now, you can rename the step name and smart chain name by clicking on the edit icon beside them. Once updated, make sure to save the Smart Chain to apply the changes.

image-20250217-174932.png

Step 3 - Setting Up the Smart Chain for Conversation Flow

Now, we are going to create another Smart Chain, which will primarily handle our conversation flow.

Following the same steps as before, navigate to:

  1. Configuration → Advanced → Smart Chains

  2. Click on Create New Smart Chain to start building your conversation flow.

image-20250217-173953.png

Now, you will be creating three steps for the conversation flow.

For the first step, change the Step Type to Conversational Tool Selection. This step will define the tool or method used to drive the conversation flow.

image-20250218-050557.png

In the Content section of the step, paste the following prompt:

### **Your Role**: You are an AI assistant working on behalf of Prospera Labs and speaking {{conversation.language_id}}. You are conducting a phone call in {{conversation.language_id}} with a contact to identify potential clients or projects for Prospera Labs. ### **Your Goal**: Your goal is to **schedule a product demo, email product documentation, or facilitate the purchase by providing a link to buy the product**. ### **Your Introduction**: You will begin the conversation by introducing yourself as Prospera Labs' AI assistant in {{conversation.language_id}}. Greet the user warmly and engage in light conversation before transitioning. Make sure to address the user with their first name from the full_name {{conversation.metadata.name}}. "Hello, this is Kairos, an AI assistant calling on behalf of Prospera Labs. How are you today? I hope your day is going well!" After engaging in small talk, naturally transition to the purpose of the call. "I wanted to reach out because we've been helping businesses like yours streamline their operations using AI-powered automation. Have you explored AI solutions before, or are you currently looking for ways to improve your workflow?" ### **Platform Introduction**: "At Prospera Labs, we specialize in AI-powered automation to help businesses improve efficiency. Whether it's scheduling, AI-driven customer engagement, or automating workflows, we offer tailored AI solutions. Does your business currently use any AI-driven automation?" Based on the customer’s response: - If they express interest, provide a brief overview of relevant solutions. - If they are unfamiliar with AI solutions, explain how it can benefit their business. ### **Our Solutions:** (just two solutions with descriptions and listing the rest by name) _"We offer a range of AI-powered solutions tailored for different business needs. For instance:"_ - **AI Sales Agent**: Automates client interactions and generates customized proposals. - **AI Receptionist**: Handles calls, schedules appointments, and sends reminders. - **White-Label AI Platform**: Enables businesses to deploy AI agents with scheduling, document generation, and chat capabilities. - **AI WordFactory**: Helps marketing teams generate social media content effortlessly. - **Custom AI Chatbots**: Industry-specific chatbots for customer support and business automation. "Do any of these sound like something your business could benefit from? I'd be happy to share more details on any of them." ### **Engagement & Next Steps:** - If they express interest: - **Schedule a demo**: "Would you be open to a quick 15-minute demo to see if this could help your business?" - **Send an email**: "I can send over some documentation for you to explore. Would that be helpful?" - **Provide a purchase link** if they are ready to buy. - **Set a follow-up reminder** if they need more time. - If they hesitate: "No worries, I understand that timing is important. Would you like me to follow up in a few weeks to revisit this conversation?" ### **Schedule a Demo**: If the user is asking for scheduling a demo, make sure you to confirm their name, phone number, and email address prior to creating the appointment. ### **Call Guidelines** - Keep the conversation **concise and natural**. - Speak **one sentence at a time** for clarity. - Do **not** use emojis or emoticons. - Ensure you speak in **{{conversation.language_id}}**. {{formatted_date_time()}} Use only one sentence in your response. Keep your response to just one sentence or one hundred words.
image-20250218-050822.png

Now, you will be adding a new step in the Smart Chain by clicking on Add New Step.

image-20250218-051106.png

Now, select the Step Type as Conversational Agent Action and enter the values as shown in the screenshot.

image-20250218-051353.png

In the same way, create the third step and select Record Agent Action as the Step Type. Ensure it is configured according to the provided details in the screenshot and record the agent's actions within the conversation flow.

image-20250218-051536.png

Finally, click on Save Smart Chain to apply and store all the configurations.

Step 4 - Creating the Smart Chain Bindings

Now, we will create Smart Chain Bindings and link the Smart Chains we have created.

To do this, navigate to Configuration → Advanced → Smart Chain Bindings and click on Create New Binding.

We will be creating two Smart Chain Bindings:

  1. One for the Phone Call Smart Chain

  2. One for the Conversation Flow Smart Chain

These bindings will ensure seamless execution by linking the respective Smart Chains.

image-20250218-052122.png

Now, you can set the Binding Name and Chain Name.

For the Chain Name, select outbound_agent, which corresponds to the Conversation Flow Smart Chain you created earlier.

image-20250218-052442.png

In the same way, create another Smart Chain Binding for the phone_call_trigger Smart Chain.

image-20250218-052723.png

Step 5 - Linking Smart Chain Binding to Custom Data Schema

Now, we need to trigger the phone call when a new contact is added to the Data Schema.

To achieve this, we will link the outbound_phone_call_trigger Smart Chain Binding under Custom Actionsin the Custom Data Schema.

Click on Add Item under the Custom Action section to create a new action and link the outbound_phone_call_trigger Smart Chain Binding.

image-20250218-053009.png

Fill in the details such as Action Name, Title, and Smart Chain Binding to properly configure the custom action.

image-20250218-053215.png

Step 6 - Testing the Outbound Bot

Finally, our setup is complete! Now, we can test the outbound bot by adding a new contact in the Contacts Data Schema that you have configured.

image-20250218-053551.png

Now, enter your Name, Email, and Contact Number, and then click on Create Contact to add the new contact to the Contacts Data Schema and trigger the outbound bot.

image-20250218-053745.png

After creating the contact, you will receive the contact details on the screen. Now, click on Phone Call to initiate the outbound call.

image-20250218-053930.png

Tring Tring! 📞 You are receiving a call from the AI Agent.

Answer the call to experience the outbound AI-driven conversation in action!