The most simple Customer Service Ai Agent on Relevance Ai

Rory Ridgers builds a customer support chatbot for an e-commerce hat brand using Relevance AI's chat widget. The agent looks up orders in Airtable, recommends products, sends modification requests by email, and escalates tough questions to a manager.
Chapters
So there's a relatively new feature on Relevance AI. I mean, I think it's new anyway, I've only just recently seen it. But basically what it allows you to do is deploy your agents in a different way and share them in a different way. Before it was kind of limited on how you could share these agents, how you could deploy them, but now they've released a bunch of new ways that you can share these agents. And one of these new ways you can share them is as a chat widget on a website. And that's really, really cool because I've wanted to embed loads of these agents before onto my website or onto someone else's website, but I haven't been able to because it hasn't been a feature on Relevance AI, but now it is. So in this video, I'm going to be making a customer support agent for a website. I've put together a fake e-commerce hat brand that we're going to be using in this video as an example. The agent will be able to look up details on a customer's order, be able to modify details on a customer's order, be able to recommend products for users, and then also be able to escalate some of the queries to a manager that it can't answer on its own. If you haven't seen me before, my name is Rory Ridgers and I'm an AI enthusiast, and I help business owners integrate AI into their business. So That's something you might be interested in, then I've left a link to my website in the description. You can go ahead and book in a free consultation with me. Also, I just wanna mention at the start of the video that everything that I make in this video, the templates will be available for completely free in the description. So if you wanna go ahead and grab those, there should be a little link that says something like free templates. But let's not waste any more time. Let's get into the video. So in this video, we're gonna be using Relevance AI to make the agent. We're gonna be using Airtable to store some of this customer information, and then we're also gonna be using a Make.com scenario. So in Relevance AI here, we've got 4 tools. We've got Escalate to Manager, Airtable Retrieval, Airtable Retrieval but Modifying Details, and then the Product Recommender tool. So first of all, I'm going to show you into the Escalate to Manager tool because it's probably the most simple out of all of them. As you can see here, the only inputs are customer name, customer email address, and then customer query. And basically what goes in here is when the agent on the website basically feels like it can't answer whatever it is that the user is asking, it will ask for their name and it will ask for their email address. It'll put that into these inputs. And then in the customer query, I've asked the agent to basically summarize whatever it was that it couldn't answer and put that into this input. So then after that, we just have an LLM step that basically looks at the customer query here and just drafts an email to the manager, the manager in this case being me, but obviously that would be whoever. So yeah, we've basically just prompted it to look at the query here, draft that into an email explaining what's wrong to a manager. We've given it the query, which is this, and we've given it the email address and then also the customer name, because I wanted the agent to include that in the email to the manager. And then just a simple send email tool where we're going to be sending it to myself in this case. And we put the email subjects as manager escalation and the email body as just the output of this step. So we're going to test this out quickly and I'll sort of show you how it works. So customer name, we can say something like John, email address john@gmail.com. And then in here, this would be a summary of the conversation that the agents had with the customer. So it'll be a little bit longer, but for this I'm just going to put a short input. So I'm going to say something like, uh, wants to know we're hiring. So let's say John has been talking to the agent on the website and he wants to know if we're hiring, and this is kind of outside of the scope of the customer support agent. So it'd use this tool. The LLM step here would draft an email body and then it would send it off to me. This is the email I received. Manager escalation. Hey, I wanted to bring to your attention a customer inquiry that requires your assistance. The customer John reached out and asked if we are currently hiring. Unfortunately, the AI agent chatbot was unable to provide a satisfactory response, so I'm escalating this matter to you for further handling. You can reach John at john@gmail.com for any follow-up. So perfect. Really, really simple. And then the manager would obviously pick it up from here. So now we can look at the Airtable e-commerce retrieval tool, and this is the tool that the agent is going to use when a customer wants some information about some of their orders. So the inputs here are going to be order number and customer query. And whenever the agent is going to use this tool, it will always ask for the customer's order number. So the customers say something to the agent like, um, I want to check what address my delivery is going to. So the AI agent would put That in the customer query wants to know what the address of their order is, and then the AI agent will ask for their order number and then put that into here. So the first step is going to be an API step where we're going to be connecting with this Make.com scenario, which I'll show you. It's really, really simple. For now, we're just going to worry about this path. We'll get into this path a bit later, but we have the webhook set up here, and then it goes to here, which is a search records node for Airtable. And this is the Airtable database that it's going to be searching. So we've just got column for name, order number, product status, email address, phone number, delivery address, product size, and carrier. This is all just demo information. This is kind of thing that might be in the database for an e-commerce company. So what happens there is this step will just return this entire table. So all of the different, uh, columns here, which is the variables So we've selected it, Base Table 1, and then the output fields, we've just selected all of them. So it's going to output all of the fields here. And then we've just set up a simple filter here so that if the order number is equal to the value that gets passed through the webhook, so that would be this, which is the order number. So we put the, this input here, this variable, we put that into the thing that we're sending over to the webhook scenario. So we make sure that the order number that's taken from here— you can see some of the previous outputs we've got— the order number, if that matches up with the value that's come through here, then, then all of the entries are in the same row as that get passed through the webhook. That might not make sense now, but I'll quickly test this out and show you what I mean. But before that, we have one more LLM step here, and basically what this does is it looks through the data that gets sent over. So it will be a name, order number, product status, email, phone number, address, product size, and carrier. And then it'll basically look at the customer's query and then just craft a response to try and help them out. If their query is, like I said, what was my address for my order, then it'll look through all the data that it gets, look at address, and say, oh, it was 123 Example Street. So it's quite a simple tool. I'll show you how this API step bit works here with the scenario. What I'm going to do is I'll take a random order number from the table and then I'll put that into this input. Let's say the customer query is, what size did I order my hat in? So, what size did I order my hat in? Make sure to run this scenario for this, and let me hit run tool. And if we come over to the Make scenario here, you can see this is the input that we got: hat56789, which is obviously the order number. And then the Airtable node it outputs just all of the fields in the table. So bundle 1, bundle 2, bundle 3, just all of the fields. And then we set up a filter here. So as you can see, only bundle 5 went through because bundle 5 was the only bundle where the order number obviously equaled hat56789 in this case. And then all the variables get sent over, so name, order number, product status, email, phone number, delivery address, product size, carrier. So basically All that's happening here is we're just filtering through all the results and just finding the bundle where the order number matches up with the one that we inputted. So we only get the row or the data that we want. So then it goes to an LLM, and you see, you ordered your hat in size large. So we can test it out. So hat 56789, Daniel Brown, scroll along to size, and it's large. So perfect, I got that correct, no worries. And this is what would be inputted back to the user when they ask the details on their order. So your hat was ordered in a size large. So quite a simple tool when I actually test it out. Sounds kind of complicated at the start, but it's really not too bad. So now we've got a similar tool here. This is Airtable eCommerce Retrieval, but modifying details. So this would be when a user wants to modify their delivery address, say, or they want to change the size or anything like that. So we have similar inputs. We have order number and then modification. So obviously order number It's going to be the same deal. The AI agent will ask for the order number when it's about to use this tool. And then the modification is kind of like the query input that we just had, but obviously this is just going to be the modification that they want to make. So I want to change the delivery address, I want to change the size, the color, that kind of thing would go into here. So we have another API step here and we're just connecting to the exact same scenario, taking the same path. Again, we're sending over the order number and it's pretty much the same deal as what was happening before. We send over the order number, it goes this way, we retrieve the data from the customer that we actually want. So it should only be one row of data. We get that data and we use an LLM step here to just go through the data it receives from the API step, which would be similar to what we got in the tool before. It'll go through that data and then look at the modification that the user wants to make, and then it'll craft an email to the right department basically just saying like, hey, this person wants to modify their delivery address. This is their current delivery address and this is what they want to modify it to. So that's what that LLM step does. We have it output in JSON because we just want the subject line and the email body to be two separate variables. So we get it to output the subject line and the email body in JSON as two separate variables, convert that to actual JSON so we can use it as two separate variables. Then we just have a Send Gmail Email step here. Email subject line is going to be the subject line that this LLM step outputted that's obviously been ran through this step here. And then the email body, same thing, it's going to be what's been outputted by the LLM step here, but it's been ran through this step. So we're going to try this tool out again. We're going to take a random order number from here. Let's say this one, Grace Martinez. And let's say that we want to change the delivery address. So right now it's 432 Spruce Street, Miami. So we're going to input her order number here. Modification, let's say I want to— so the modification request could be something like, I want to change my delivery address to 123 Example Street, let's say. We'll hit run on this Make.com scenario, hit run on this. We should see this working. So that goes through, that gets sent over back to Relevance AI. This is what it looks like when it comes through the API step, so just all of Grace Martinez's information. The LLM step creates two separate variables, the email body and the subject line. The, this step converts that to JSON so we can use it as two separate variables. And then the send Gmail email sends it over to me. So this is what I got. Modification request for order HAT76543. Dear team, I hope this message finds you well. I'm writing to inform you that Grace Martinez with order number HAT76543 has requested a modification for our order. She'd like to change the delivery address from 432 Spruce Street, Miami to 123 Example Street. So perfect. In this case, I've set it so that the AI agent doesn't actually modify the details itself. It just sends off a request for someone else to modify them because I felt it was a little bit more secure that way because I didn't want anyone to be able to just use these agents to modify orders when maybe it can't be done. Maybe they don't deliver to this address and the customer doesn't know, you know, that kind of thing. Maybe they don't have large in stock and they want to change the size to large. So I thought it'd be better to send off a modification request to the right department rather than just having the AI agent doing it autonomously. So now we can look at the last tool here, which is going to be the Product Recommender tool. And this tool is also going to help the agent to recommend products for the user. So the only input is going to be user query, and this is going to be the type of product that the user is looking for. So this could be something like if the user says, I want a hat that I can wear in the winter, or it's my mom's birthday coming up and I want to get her a hat, she likes flowers, for instance, that kind of thing. That's what would go into this query. And then we have another API step here which connects to the same Make.com scenario, but this time it goes this way. And this time we just send over requesting recommendation as the body for what we're sending through the webhook, because that way we can filter it. So we've set up a filter here, we've made sure that the value that comes through the webhook, if it's requesting recommendation, then it will go this way. If it's anything else, which should obviously be the order number, and it goes this way. And the reason we've done this basically is because it's two different Airtable tables that we need to look at, and we just need a way of differentiating what route the data should take here. And I just didn't want to make two Make.com scenarios. I thought it'd be more simpler to just do it on one Make scenario. So that's why I did it that way. And this is the table that we're going to be looking at for this one. So we have product name, description, color, size. So kind of what an e-commerce store might have as a database for their products. A bit simple maybe, but this is kind of just an example. So the data comes in through the webhook. If it says product recommendation, then it will go this way. We again search the records from this table, get all of them, put it into array aggregator to basically just put all of these data points into an array, and then we send it back to Relevance AI via a webhook response. So through the API step here, what we'll get is just all of the products from here, so the product names, descriptions, colors, sizes. We'll get all of that through in a nice formatted way, and then the LLM could go through that. It can look at the user's query, so something like, I want a hat for the summer or the winter, something like that. Look at the user's query, look at the data, and then determine a product that would be best for them. So quite a simple tool. Maybe I over-explained it a little bit, but we're going to test it out and you can see how it works. So use a query: I want a hat. I can wear in the summer. So I've said I want a hat I can wear in the summer. Let's turn this Make Scenario on, hit Run Tool, and then we should see this Make Scenario working. So that's worked. Obviously it went this way, which wasn't meant to. That's only because I forgot to set up a filter here. So we're going to set it to if the value does not equal requesting recommendation. So that means if it does equal that, it'll go this way. If it doesn't, it'll go that way, just because we we're wasting some tokens there by making it go that way when it doesn't need to. So anyway, back to the Relevance AI tool. This is what we get through the API step. So basically just a copy of this table, we get that through Relevance AI. And then the LLM step here goes through that data, looks at the query, which was, I want a hat I can wear in the summer. And then this is what outputs to us. So the SunShield Wide Brim, it's lightweight and breathable with UV protection. Ideal for sunny days and long trips. And then the glamour floppy hat, and it's given us a description here, the performance baseball cap. And by the way, the main way that it's doing this is through the description here. I forgot to mention that. So we have little descriptions here of just what the product is, and that's basically mainly how the iAgent is going to determine what the best product is. It's also going to look at the color and the size. So if you said something like, I want a large red hat, for instance, it's going to look at the size and the color. But a lot of the time it's it's going to be looking in the description. So all in all, quite simple tools. They're set up pretty simple. There are only a few steps, so really not too complicated to get your head around or too complicated to set up. So now I'm going to show you how to put all of these tools into an agent and then how to actually put it onto your website as a chat widget. So this is the agent here. I've given it a name, Customer Support Agent, and then the agent description: this agent is able to handle customer support for an e-commerce website. So quite simple. The tools are obviously going to be the tools that we just went through, so the Airtable retrieval, Airtable retrieval with modifications, escalate to manager, and then the product recommender tool. And then the core instructions, this is where it all happens. We have the role, you're helpful assistant for an e-commerce hat brand called Hat Haven, and you will interact with customers directly on the website. You need to make sure to actually tell the relevance AI agent that that's going to be interacting directly with customers on a website, because a lot of the time these AI agents are going to be used as internal tools, or they're just going to be used by one person. So we need to make sure that it knows it's going to be on a website talking to users of the website. And then the task: you're able to handle general customer queries and also give users information about their orders using this tool, let them modify their orders using this tool, escalate their queries to managers using this tool, and then recommend products using this tool. I want you to give helpful, concise answers to users' questions and use the tools appropriately to fulfill their requests. Here's a breakdown of the tools. And then I've just given it a quick breakdown of the tools here. You can pause the video and look at what I've written. Or you can just go into the description, get the free template, and the prompt will be there. But basically, the structure I follow for all of these is just tell it what the tool does. So this tool is able to get info about a customer's order. Tell it what the inputs are. So the user inputs for this tool are order number and query. Tell the agent how to input data into these different inputs. So I want you to put the user's query about their order into the query input. This could be something like, what's the address for my order? Or what size style do I have to have it in? Always make sure you ask for a user's order number and use that for the order number input in the tool. And then I've just clarified at the end, you must ask for the order number, otherwise the tool won't work properly. And I've just told it when to use the tool, so use this tool when a customer wants to get info on their order rather than making any modifications, because I want it to differentiate between this tool, which is when the user wants to make modifications. So I've pretty much just followed the same structure for all of these. Again, you can pause the video and read through them, or you can just get the template for free. If we look here, I've given it some context. This is obviously just fake data made by ChatGPT because this is one of the most important things about chatbots. They need to know about your business so they can answer just sort of general questions. So for this, I've just uploaded some context, but you can also upload knowledge bases to the agent, or you can even put RAG tools into the agent so it can pull data from specific vector stores. But for this, I've just given it sort of some context on this fake business. So I've given it, you know, different numbers, addresses, a summary. And then in the notes section, I've said, never make up answers. If you feel like you can't answer a question, always use the Escalate to Manager tool. Never tell a customer that you're using the tool, just use it and then give them a professional and appropriate output. And then also put this last one in after testing it out. I said, if a— I've said, if a user gives you their order number to look up info on their order, And then once receiving the info, they want to change something about the order, then assume the order number is the same. When you use the Airtable Retrieval Modify Details tool, don't ask for the order number again, because I found that I was asking for information about my order, typing in my order number, and then I was saying, oh, actually, can I change the size, you know, just to test it out? And then it was asking for my order number again, which was just kind of weird and unnatural. So I made sure that it uses the original order number that I give to it. So that's all for there. We can hit Save Changes and then we can test this out on my website. So to be able to put this agent onto our website, we hit Share. And you can see here, before it was just, um, template, so you could just share the template with other people. But now we have a Task UI, Chat Widget, and then also Chat UI, which is really, really cool. We can have a look at some of these. So the Chat UI, you can just share this with people and they'll just get this little user interface here, which is really cool. You can also customize it. You can customize the color, the starting prompts, the message input placeholder, and then you can toggle all of these on and off. Then we also have the task UI, which is kind of just a more advanced version of the chat UI. We have the template, which we already had, and then we have the chat widget, which is what we're going to be using. So we get a little bit of code here that we can put into our website. Again, we can change the color, we can change the bubble style, so we can have it as the little picture of the agent, or we can change it to some of these other icons, which is pretty cool. We're just going to leave it on this icon. Again, we can do the starting prompts, the message input placeholder. Toggle this on or off, but we're just going to leave all of that alone. We're going to copy this code, and then to put it onto your website, you'd either put into the header or the footer code of your website so it's on every page. It's really, really simple setup. I'm just going to show you an example of how it would look on a website. Okay, so this is an example of how it might look on a website. I'm choosing a random unused page on my website. I think it's the blog page. Don't have any blogs, so put it on here. This is how it might look. You obviously customize the size of it and everything like that, and like I said, the colors and the icon. But this is how it's going to look. So we can just say hey to it, make sure it's working. Hello, how can I assist you today? So we're going to try and use some of these tools here. We're going to say something like, I want, I want to know what size I'm I ordered my hat in. So I'm going to say to it, I want to know what size I ordered my hat in. So we can send that off and then it's going to think about it. Could you please provide me with the order number? I'll look up the size of the hat you ordered. Let's go over here. Let's pick a random order number. Let's say this one is for Henry Wilson. So copy and paste that, send that over. So you can see it's thinking, it's using the Airtable eCommerce Retrieval Tool. You might want to change the name of these if you know it's going to be on your public-facing website, but that's just what I've named it for now. So, you ordered your hat in adjustable size. If you have any other questions or need further assistance, feel free to ask. So let's have a look. Henry Wilson, and then yeah, adjustable size. So let's say that we want to change that to something else. Let's say I want to change that to large. So we said I want to change that to large. So it's using the Airtable e-commerce retrieval tool, but the modifying the details one. I've submitted your request to change the size of your hat from adjustable to large. You should receive a confirmation once the modification is processed. You'll need— if you need anything else, just let me know. So if you look at my emails, you can see I got a modification request for order hat 23456. Dear team, I hope this message finds you well. Might inform you that Henry Wilson has requested a modification to his order. This is order number, his name, modification request: change size of the hat from adjustable to large. Current size is adjustable, please update the order accordingly. So perfect. Now we can say something to it like, I want a hat that I can wear when I go hiking. So this is obviously going to have to use the product recommender tool. So yeah, use the product recommender tool. And it should give us a hat that we can hopefully wear hiking. So, so that's what I said. Here are some great hat options for hiking, uh, so the Adventure Bucket Hat, the SunShield Wide Brim. If you're interested in any of these hats or need more options, please let me know. So now just to get it to use the escalator manager tool, I've said I want to speak to a manager. I said I can help with that, could you please provide me with your name and email address? So we're going to say Dave and then dave@gmail.com. And then it should hopefully split those up into two separate variables, use the Escalator Manager tool, and then we should get an email on my email soon saying someone wants to speak to a manager. So I've escalated your request to speak with your manager. They'll reach out to you at your email address, dave@gmail.com. And then I just got this email through, Manager Escalation. Hey, I want to bring to your attention that we have a customer, Dave, who's requested to speak with a manager regarding his issue. Fortunately, the AI agent chatbot was unable to resolve his concerns. And we need your assistance to address this matter. You can reach Dave at dave@gmail.com. So perfect, it works exactly as intended. So I hope you guys enjoyed the video on how to make a customer support agent for your website using Relevance AI. This new feature is something that I really, really want to use because it's something that I've wanted from Relevance AI for ages— the ability to integrate your AI agents in more ways than just sort of sending the link to people or sending over a template. You can actually interact with it in different ways, one of them being a chat widget on the website. So that's really, really cool. I know that you could do this with platforms like Agenteve, which is Liam Otley's platform, but I feel like this way I've already got loads of agents on Relevance AI and I can just stick them on a website. And also I prefer to use Relevance AI. All of my tools are on there. I prefer building tools on Relevance AI. So yeah, it's a really, really cool feature and I really wanted to use it. As I said at the start of the video, if you were interested in working with me so we could integrate AI systems like this into your business, then I've left a link to my website in the description, and you can go ahead and book in a free call with me, and we could talk about some ways to do it. And also, like I said, all templates I use in this video will be available for completely free in description. So if you want to go ahead and grab them, find the link that says free templates. And if you guys have any suggestions for videos that you'd like to see, then please do just drop them in the comments. But if not, then I'll see you in the next one.
More from Rory

Dynamic Workflows are crazy. This is how to actually use them (beginner's guide)










