Data-Driven Customer Profiles: OpenAI Assistant API with Zapier Tables for Business - Complete Guide β
Let's build with Zapier and AI (100+ videos)π
2024-01-01
Transcript β
[00:00] okay so let's start leveraging assistance API from open Ai and create profiles on potential leads and our current customers we're going to be leveraging zaper and tables obviously we're going to be leveraging assistance API in order to create these profiles and the end goal here essentially is that anytime we deal with the same individual we have data from past conversations with this individual that we can leverage in our business for whatever the context may be let's jump in welcome back to corbon AI also we're going to be doing a more complex video today which I know some of my audience
[00:30] really likes so I make sure I tailor my stuff like that but go ahead and follow me on Twitter if you want to see random stuff that I'm talking about or just random shout outs of videos that came out new year new me all right we're in 2024 y'all so let's go and jump in so the idea behind this video is that we're going to go ahead and create an assistant API we're going to create this assistant API with the purpose of basically tracking and storing data based off conversations where the unique identifier in our specific context here is going to be the email so to speak more lay in here essentially what this means is that when
[01:01] we receive inquiries through email or this could be used in other context we're going to go ahead and Associate that specific user's email and get all the data from that user that we've interacted with and have it always on call so we don't have to look at past emails we don't have to look at past interactions we can kind of get a general idea of just who this individual is before we even started the conversation on top of that I did a video similar to this in the past I'll go ahead and Link it up there it is similar to this but this is probably a more optim way of approaching it when it comes to storing data handling data and
[01:33] handling these kind of specific inquiries so let's go and start off by creating our assistance API all right so if you are not familiar with assistance API I encourage you to check out my other videos when it comes to assistance API as you'll get a way better understanding and idea of how to leverage this so I'm going to create a really simple one here we're going to call it real estate agent if you want to see more advanced ones or how to handle more data with the files function or just stuff of this nature they'll probably be on the suggested bar over there or you can go ahead and just type in like Corbin AI assist API that rhymed on accident and you get more of an idea purpose of this video though is to just
[02:04] show you how to lock in basically create profiles this is pretty Advanced but we're going to create profiles on individuals so I'm just going to say uh respond to lead emails with one sentence we're going to go ahead and just put the default to gbt 4 here and we're going to go and save so that's all we need to do on the assistant API side we're going to go ahead and jump over to zapier here I'm going to go ahead and create a table here so if you're not familiar with tables think of it like Excel sheets but we can do a ton more
[02:36] stuff we can actually put functions within Excel sheets I've done videos on this as well if you are familiar with coding and you have programmed in the past think of this as basically like fir store database this is like kind of like basically giving us a backend this stuff's powerful y'all um probably not a lot of videos on it that really show you the abilities of this but all I want you to think of is that this is how we're going to store and create profiles on individuals that interact with our business this therefore let's go and create a blank table here we're just going to call this uh you know we'll say our real estate company
[03:07] name is uh Pinewood houses database all right we're going to hit create table here so if you're familiar with programming this is kind of nice basically a big thing with programming is when an individual signs up for your platform or interacts with your software you have a unique identifier in order to associate all the interactions that they had on your platform form with data so we can do a similar thing here in zapier here and what we're going to do is we're going to create our unique identifier or the way we're going to identifier unique
[03:38] identifier in this context is going to be an email so we're going to do email here or we're say users email and we'll do email here we go okay you can even choose icons this used to glitch a lot y'all so let's see if this works okay it does cool we can actually do like based off the Gmail too all right I like this all right want to hit save here and actually it looks like zapier is pretty nice here with there they they basically looks like they've added a unique identifier as well we can't use theirs in this context as this is going
[04:10] to be very specific to the email and our current conversations here but that is interesting I do like what they're doing with that we can't use it on our context so we're going to go ahead and add another field here we're going to go ahead and call this field message ID so here's a great thing about assistance API and basically why everyone has been losing their mind over it is it basically makes it so that on a let's just let me give you an example real quick so as you know Chad gbt if I get a conversation this is basically where assistant API is very powerful so when I
[04:41] can go um tell me how to make pasta let me go and shrink down y'all so I'm not huge on your screen oh come on there we go so basically what assistance API does so you can just visually see it is that now when we are in conversation in the context of API EG everything you do of Automation and the software side we can understand that what was said previously so it's their version of like basically tracking all data for conversation knowing that in order to reference a said conversation we're
[05:13] going to use message ID um we're going to hit save here and there's other stuff we can add here so this can get very complex y'all we can do stuff such as reference the message ID summarize it and then basically add different tags based off the message ID you know characterizing the lead more cold warm uh Hot Stuff of this nature but for this purpose of this video I'm just going to show you how to track data specific to a user's ID and everything that's been associated with that user so for this I'm just going to delete the field but we can get more complex let me know in
[05:44] the comments down below if you want more complex tutorials when it comes to tables as this is basically our version of accessing a backend but zappier makes it nice because it's a nice UI so let's go to create a new zap here all right so we're going to go ahead and hit create zap here first thing I want to showcase here is basically a assistance API and one of its downfalls so you might be saying how is there a downfall of assistance API there is a downfall for some reason don't know why maybe they'll change this in the future but for some reason the very first conversation the very first message doesn't get saved in
[06:15] the underlying message ID EG if I say hello Chad gbt how is today and we get into a conversation the message ID associated with that doesn't get the first very first line which is problematic due to the fact that in order to basically get a as much context with our individual in this we're going to have to ensure that we get all the data that is relevant to that individual therefore there's a work around here but first let me just show you what I'm talking about I'm going to go ahead and say new email here and we're going to go ahead and use our courses email and we're continue here and as you probably saw in the beginning of this video we
[06:46] already have a pseudo email that I sent to myself here I'm going to test this trigger this is going to be basically the email that I receive here question about a random home I think this home was actually in Miami I don't know if it's been sold yet continue and let me just prove what I've been basically saying here so I'm going Chad gbt here and we're going to do conversation with assistant let me zoom in and we're going to actions perfect connected good to go we're going to say uh basically actually we're just going to put in the body plan because we've already identified within the assistance
[07:17] API actions here that it's going to respond to the lead of one sentence emails so we're just going to put the body plan here we're going to choose our assistant and everything else will stay the same so if you're familiar with cite assistant API we don't have access to a message ID until the first message is sent but here is the issue I send this message which is the body that we received but as you'll notice and I'll I'll gut check it to prove it we got a response here right hi Timothy North Quest Pome property etc etc if I hit D duplicate here and I come
[07:50] back to actions and I come over to conversation ID and I type and message this is how we reference conversations IDs and we go to message ID and I simply ask what was the well actually let me do one more just to prove this we're going to say um tell me we say hello wanting to see about a house in Miami called uh Flamingo go go I don't know off the top
[08:21] of the head y'all hit test step here so as you see we'll get a one sentence response as well but as we know from what I just here the very first message was this one therefore when I ask Chad gbt here what was the first message in this conversation because we have the message ID we should get northquest pin home but we're not and that's part of the issue or part of the limitations but I have a workaround I'll show youall so I'm going to say what was the first message in this chat and as you see it
[08:53] won't actually be that body email as you see we got the message ID continue test step here and we're going to to get a faulty basically if we didn't recognize this eror we would actually have the data associated with that customer be limited and as you see it talks about Flamingo goo but that was the second conversation it wasn't the first this was the first so knowing all this I'm going to delete all this I'm going just delete these Chad gbt blocks and we're going to proceed with a workaround of how to get around this to ensure that
[09:24] we're doing this correctly so I'm going to go ahead and delete this delete this as well and we'll come back over here okay so here's what we're going to do this is very simple we're going to go ahead and lower our model to gbt 3.5 turbo extremely cheap host Dev day they slashed it by 66% we're talking micro pennies y'all but in order to ensure that we get all the data associated with individual minus the top here all we need to do is this we know our specific context that
[09:55] we made this assistant API or made our assistant for the context of handling so also just spoiler basically the end goal of what I'm going to show in this use case is basically creating a draft email but you can use in whatever context you may want to do it but it's going to be a draft email that we're going to be able to reference later on that being said though we know the use case for our assistant API here is going to be a real estate draft email responder we could have loaded it with data we could have done more but for now we're not going to get fancy we're just going to say we received
[10:26] a lead email so this is going to incur the message ID which is the basically gold here we're going to make sure we go to 3.5 here we're going to get a hit continue and test step boom we just created a conversation but now we can use and leverage this conversation message ID that we received from this output so basically what I'm saying here the purpose of this is to create a message ID and make it cost effective for us perfect we've created our message ID
[10:56] that we're going to associate with the individ idual who emailed us so knowing that we're going to hit duplicate here I'm me delete this because I don't want that and what we're going to do here is we're going to do conversation conversation we're going to say what'll just say this is the draft email this is the draft email then we can provide the message we received in that draft email that being said with the underline email we received I've done a ton of videos when it comes to Gils how to fine-tune your trigger in
[11:28] order to ensure that you're not wasting it on random spam emails or maybe from MailChimp wanting to upgrade your subscription stuff of this nature you can check out those videos as well but now that we've done this we can start our new chat here what I'm going to do is I'm going to up it to gb4 and our conversation ID is going to come from our create message ID function here and it's going to be called message ID zap here if you're watching this change message ID to conversation ID or message ID like make it so that they're the same as someone that's new could probably get very confused on the naming difference
[11:59] here so maybe just change this to message ID I don't know hit continue here and we're going to test this step so we're going to get a response here and what we can do with this response is we can go ahead and create the draft email here but we're going to add a couple more steps here so we can reference the database we just created so then we got this we got our response Perfect all right Timothy I'm glad to to assist you now to gut check this and to prove what I'm saying earlier in this video I'm simply just going to do this so what was the first meth message in
[12:30] this conversation so the real first message as you saw before is like we received a lead email remember this was the real one but as we received a lead Emil but as I showed you the real for the the actual one that's going to be stored as data is going to be the initial body email we received from Timothy so we should see a p regards here and the original email so as you see here what was the first message in the conversation uh the first message in the conversation was in your inquiry about how to learn more about the North Pine Crest property there you go I was
[13:01] wondering how to learn about the North Crest property there we go so now we know we have all the relevant data that we care about in this conversation let's proceed with basically creating a profile for this individual we're going to create a table here and the purpose of this table here is we're going to create a record in this record this is where we're going to associate all this information so I chose the table we just created together here Pinewood houses database the users email is the most important part of this this is going to be the data that we associate with this
[13:33] individual so for this context this might get a little confusing so I believe I sent it to myself I did okay but for me it's going to be the from email this is basically who sent me the email perfect now here's where it gets cool now that we have the from email we're going to associate the conversation we have with this individual to the message ID so we'll do message ID and then boom continue test this step and as you'll see in our database here we should see it click here there we go
[14:05] we got the underlying user email and we got the message ID associated with that user so we're going to say create profile we'll just say that for now that's how you spell profile no it isn't but okay then from here let's just go ahead and put the cherry on top here and essentially just create a draft just to dot our eyes and cross our te's so I'm going to continue here continue here and the subject will just be you know draft setup or you know uh what was our name of our company
[14:37] pineer no flamingo goo I don't remember we're just going to say real estate response and then the two person we'll do it to the individual that obviously sent us an email and two emails or nope sorry we're going to do the person that sent us the email not sending it to our little confusing just because I sent it to myself in the actual example and then obviously we're going to go to a reply here and here we go there we go full response and you can add a signature etc
[15:10] etc test this step and then we'll get our response we could obviously add HTML here make it look pretty but for our use case if I come to draft here we got our nice little draft email ton of videos on this if you want to see how to make this look cooler that's not the purpose of this video purpose of this video is showing you how to reference this data so stage one is complete let's go to stage two this is basically where the magic happens I'm going to go ahead and back out of this and create news app all right so we're going to go ahead and just do reference data so what's cool about this
[15:40] and in this example I'm just going to do a new email is in my inbox again but this could be spread across any context for example if you have a slack Channel and an individual that's being circulated through your business and their email is their unique identifier and it shows up you could run some type of slack trigger here when this email shows up do XYZ this can be used in any context context I'm going to show you just basically just me being very simple but just showing you the power of it so for me I'm just going to pretend like there's another new email from this individual so I'm Gmail here and we're
[16:10] going to go ahead and do you know where is it new email hit continue I'm going to choose our courses account and hit continue again we'll go ahead and choose inbox here continue test it we should get the same data here but here is where the magic incurs so in this context we're going to assume that we are not creating a new profile in our database but we're referencing the profile we created EG we're referencing this right here and we know that this individual may or may have not have already been through our profile creator that being
[16:43] said there actually would probably need to be additional logic added here so the additional logic that you'd probably want to add to that original automation I created here would also be a filter block now the purpose of this filter block is to basically cross cross cross reference our underlying database there to ensure that the profile hasn't been created yet so actually instead of a filter block we're going to need a pass block here uh because we don't want to filter out individuals rather we want to actually set it up so that if
[17:15] individuals have a profile and database with us or basically if they're in the database we're going to do path B if they're not in the database we're going to do path a so let's assume that essentially the beginning of this though we're going to have to do a table search so we do zap your tables we're going to say uh find record continue table ID perfect and filter count should be fun and essentially we're going to do a lookup field we're going to do users email is exactly look up value and we're
[17:46] going to go ahead and do the from email here so this continue test this step so as you see here we got a buling zap search status was found to be true so really to clarify this and send this home let me back out so as you see with this this is creating an individual within our database so therefore I probably needed to add a pass block here as well because if this was a new email in that individual's already in our database we would want it to send it down different paths so let's jump back over the automation this is actually pretty simple y'all we're going to do path a
[18:18] here and we're going to say uh exist database and then we're to say doesn't exist we're to say not in database to make it very clear and when I keep referencing database that is the tables we created together so we're going to go to pass here and basically this is very simple y'all if we go to this and we're going to say if zap search status or zap search was found to be true say exactly match is true we are going to proceed with this
[18:49] route now if it doesn't exist so we're going to say zap status is exactly matches false we're going to proceed down this route so here's what we're going to do and there you go so it doesn't exist or so this it wouldn't continue on this path because it does exist but here's the situation essentially what we do here is this if the data exists we're going to go ahead and proceed with however we want this automation to proceed because we have the reference data if it doesn't exist
[19:20] then we're going to go ahead and create a record and then proceed with the already existing automation that was the original intention of this automation flow that might have sounded very confusing but let's just say this if I come over here let's just first gut check this we're going to go ahead and actually add a uh table block so we are under the impression here that we basically know that the data exists because it does exist but let's go ahead and just show you the the use case of this right so we're going to still go ahead and see
[19:50] find or create record we going to continue here going to say table ID so lookup field here's going be user email is exact ly and then we're going to go ahead and uh basically grab the email that's from the email here and then the second one is going to be our lookup field is going to be the message ID okay and with the message ID we're going to do the operator of starts with Ms MSG as we know that all message IDs start with MSG this is just how they reference them in the API documentation therefore when
[20:21] we search this we're going to get the relevant message ID that's been associated with that email or SL unique identifier therefore we can go ahead and proceed with furthering the conversation in a separate flow and reference that data so we can go and say what was the home that was being asked about we're going to go ahead and try our assistant here which is going to be our real estate and then we're going to go ahead and reference this conversation ID that we just found as a record here
[20:52] which is going to be the MSG message ID we even named it correctly here we going to continue here and then we should see North Crest pine home if I said that correctly and that's going to prove that this worked and there you go the home that was asked about was the North Pine Crest home property okay so then we can proceed from here we have all the data Associated of that message ID throughout our entire system and structuring of our company here we've now identified that basically any conversation or any type of interaction with our company we can start storing in this message ID rather than storing a bunch of data on this
[21:23] underlying zapier table we can actually store it in this message ID now and we can reference it later on that being said due to the complexities of what I just described here it is going to require a little bit more logic so it's going to require these paths so let's just say my original intention of this was basically just have an end conversion event where I just asked that question what I meant earlier when I said if it's not in the database this is when we run the flow that we saw in the first automation you might be asking yourself what was that flow that flow was specifically creating the message ID and creating a record in zap your tables
[21:55] and then once we have that we can proceed with whatever our end conversion event is in this context that was a lot y'all this was a complex tutorial let me know if you liked it that was okay I got really large there but let me know if you liked it that kind of concludes this tutorial basically I wanted to show you how to create start creating data profiles on individuals that uh basically interact with your business a really great natural unique identifier in this context is always going to be email as you can't have two individuals have the same email they always have separate emails on top of that make sure
[22:26] to leave a like if you feel like you learned something today's video If you like this kind of video I guarantee there's a bunch of suggested videos with my face on it talking about other stuff when it comes to assistance API I'll also leave a playlist here called zapier and approaching all 5,000 apps on open AI or on zapier and you can check out that playlist as well but without further Ado y'all I'll see you in the next video thanks for tuning in and yes surprise I'm an AI Avatar make sure to explore more here at Corbin AI where we demystify AI for your personal and
[22:57] business life until next time