ChatGPT Memory Key Explained: Enhance Consistency & Scalability in Zapier Automations | Tutorial β
Let's build with Zapier and AI (100+ videos)π
2023-10-05
Transcript β
[00:00] welcome back to Cori where I am showing you daily how to start leveraging artificial intelligence in your personal and your business life in this video we're going to go over comprehensively everything you need to know about the chat gbt memory key found in zapier and you're going to learn in this video why zapier essentially is such a powerful tool for allowing us to use this furthermore I'm going to break this tutorial down into three major parts the first part here I'm going to explain essentially what's incurring in the back end of zapier by showing it through a actual chat gbt chat that we can do in the front end so we're going to understand it to Ely essentially what is
[00:31] the function that this is serving the second part of this tutorial is we're going to jump into zappier and I'm going to show you some examples with the memory key without a memory key explain use cases of the memory key in different context of why You' use it and maybe why you wouldn't use it and then the latter part of this tutorial essentially is I'm going to go on a whiteboard and I'm going to draw out essentially what's truly happening with the code and essentially how this is being achieved so you know you can really understand from you know from the start to finish everything that's accomplish with the memory key and why it's such a powerful tool but but without further Ado let's go and jump into today's video here
[01:02] where we're going to explore all the functionalities of the memory key so before we jump into zapier's front end let's go and explain essentially what's even happening so essentially what the memory key does is if I wasn't going to use the memory key found here on zapier essentially every single conversation that incurs within the zapier flow is going to be the start of a fresh conversation so what do I mean by that if we jump over to Chad gbt's front end essentially it' be like this uh we need uh do or we need captions for my company
[01:34] we are a real estate company wow that's how spell in Florida so this is what happens when you don't add a memory key okay we need captions for a company okay it's going to bring out um you know give me captions for the the real estate company in Florida and it's going to go like this but here's what's incurring if you don't have a memory key essentially what happens is that it goes to the automation once okay great now when you go through it a second time essentially you're starting to chat all over again from the very beginning so as
[02:07] you'll see here the answers will be different but here's the thing the answers also could be the same because of the fact that we're starting the chat fresh again essentially could lead to the same outputs that we saw in the chat that occurred three chats ago so essentially all that's happening when you don't have a memory keys I'm just resubmitting and restarting a chat with open ai's API so this can be used in some use cases but the reason this is detrimental as I said before is Du the fact that some of these outputs will be repeated which is going to be good maybe I'm doing a social media caption and I
[02:37] don't want to use this same caption of turning your Sunshine State dreams into reality and therefore because there's no prec contextual context it causes issues in scaling and when there is repeated you know automations that Ur through the same flow so what I mean by that essentially is this is what happens when we add a memory key we said we need captions for my Company Real Estate Company Florida uh we're going to go ahead and just hit save submit so let's just say we just went through the first time of the flow but we still have that memory key we can go ahead and proceed further down the
[03:08] conversations we're going to say we need more captions don't repeat past ones so I'm going going to ahead and let this generate so as you see here we got a output of 20 captions just so we don't go crazy again I'm going to say uh Max of five new captions but essentially let's say we add a memory key we've added the memory key now we're going to get more captions and just in this context we're going to get five more captions but the captions that are outputed here aren't going to be repeating because of the fact that we
[03:39] know the captions we've already outputed in the past so what this means essentially is that by adding a memory key as you see in the front end version we're giving essentially the chat context of previous outputs which is a very powerful tool and very powerful asset to have in the context of automation as we will dive into right now when we come over to our memory key here or or sorry our Chad gbt block let's just say we do the same exact uh output here say generates captions I'm going go ahead and just you know honestly copy the input here we need caption for my company we are real
[04:10] estate company in Florida I'm going to paste that in here we'll keep with the 3.5 here and essentially maybe we just add a little SP space there um no memory key we're going to hit continue here and then we're going to go ahead and test this step and we're going to get a output that we're asking for but here is the kicker essentially every single time it does this output it's going to look different in some way whether it's small whether it's not small you'll see in this test here so as you see we got 10 different captions here we got quotation marks let's go ahead and come back over
[04:40] here and we're continue again and we're going to retest this step there we go as you'll see there is going to be different captions here but the problem is that some of these captions may have already been used so keep hitting retest this step and essentially we're not getting consistent outputs at scale if this automation would Ur a lot of times and just to really showcase this I'm going to say uh add emojis and hashtags to each caption and then I'm going to go ahead and hit continue here and test this action so there isn't a lot of times that you'll use a chb block without a
[05:11] memory key due to the fact that memory Keys ensure that the output I see during the debugging phase and the testing phase I can expect to see you know three you know three weeks from now problem is that if we don't add a memory key what you'll notice is that yeah it might look fine in the debugging phase but let this automation Run 10 20 times and you're going to going to start seeing some outputs that you're not going to like and it's going to cause you to come back to this Chad gbt block wonder why your prompt isn't working but in reality it's just because it has no contextual data to base off its decision therefore as
[05:42] you see here what was the major difference that we saw between this one and the other one was we want to have an indentation here but also the way it placed the underlying emojis um you know previously it had the emojis in the beginning here but now it's like putting them throughout we're not getting consistent output so therefore add contextual data here we can go ahead and you know put in cap out and we can say we need captions for my company we are a real estate company in Florida add emojis U and hashtag spe caption
[06:12] parameters don't repeat past captions so here's what's going to incur here I'm going to hit uh test this action here and essentially what we're doing here is that we're going this is the first chat that's incurring within this memory key so this is the first I just started a new chat and this is my new memory key uh the memory key is associated with the chat right so essentially as you see here here is how it's formatted notice how there's quotation marks notice how essentially there seems to be an emoji in the front
[06:43] and then Emoji found later on in it so let's go ahead and retest this we go ahead and retest this step and we should see similar structuring here because we're using the same chat therefore we can expect the same type of output so there we go let's see if this is a new chat here we go so the new chat came in notice how we have quotation marks still we have the Emoji in the front and then we have the Emojis later on now we're getting consistent output here outputs here and we have identified essentially don't use past outputs found within the
[07:13] cap out chat U that's happening here now that being said this kind of logic and this kind of proceeding usually works best with gbt 4 it can work with 3.5 but you know in some context you'd probably you know if you're putting out like maybe in a social media post you probably only want to generate one caption so it's easier to track essentially to make sure there is no repetitiveness of the underlying outputs you know a great example of this is using memory keys in the context of AI article generators essentially when we push out a bunch of Articles we don't want to have an article that was already written four weeks ago incur again
[07:44] therefore you know the way we structure and the way we format our prompts need to work in pair with our memory key um therefore that's why having a memory key is so important in the context of automation as now we can ensure that essentially the outputs will be consistent or alternatively consistent in the sense of essentially the output won't have you know maybe we don't want quotation marks there let's ensure that no quotation marks won't come out uh maybe we don't want emojis in there so we would add some type of formatter there another thing you can do as well is let's say you get a memory key and you get an output it's really really
[08:15] good but the problem is that there is just one slight thing that's wrong with the memory key but you can't seem to you know refresh your chat um in order to get let's say the quotation marks out in this context that's where the formatter block from zapier comes into play as essentially we can take that consistent output found in that Chad gbt block but you know remove small things so for example if I wanted to remove the quotation marks I could do you know manipulate the text we're going to go ahead and do an event of replace and essentially what I would do here is put in the input uh the reply here and I
[08:45] would find the quotation marks I would remove it of empty space here and then I would test this step and then all quotation marks found in this output are gone now and we can kind of utilize it from there with that being said essentially understanding how and when to use use memory Keys is pretty fundamental I would say there isn't many use cases that you wouldn't use a memory key the only time I could really think of it is maybe it's like a very like summarize this uh find a key point in this even stuff like that you still would want to use memory key because the fact that it's a you want to ensure that the output that you're dealing with the
[09:16] data that's can be manipulated throughout the flow is is going to look the same so there isn't no random quotation mark That's added in there comma that's added in there an emoji that's added in there having a memory key ensures that certain things that certain discrepancies that could incur in an output wouldn't incur now knowing this essentially when you add a one here essentially all I'm doing is starting a new chat you know a new memory key think of it as a new chat and if you're familiar with talking to Chad GBC in the front end you know sometimes you can go down rabbit holes or you know you keep
[09:46] repr proctoring a chat to the point that you're actually better off just starting a new chat because this allows you to start on a clean slate and ensure that the output that you get looks uh more effective and more better for whatever the use case that you have so now we understand the use case of a memory key and why it's so fundamental let's go and explain a little bit more of what's actually happening here and why this is such a powerful tool in the context of automation now I'll be honest with you this is very impressive for zapier to have and the reason why this is impressive for the zap year to have is
[10:18] that everything that you see here as a input essentially is provided within open ai's API and what I mean by that is Max tokens is not something custom that zap your made temperature is not something custom that zap your made top PE isn't something custom that zap your made it's just stuff that you call upon within opening eyes API it's already essentially like there like the functions already exist this though A Memory key doesn't actually exist within open AI API calls um intuitively and that's why it's so powerful and that's
[10:49] why using zapier as an automation tool just for that fact alone should push you over the edge if you're choosing between automation tools especially in the context of artificial intelligence because from my understanding other tools don't have the functionality of a memory key so let's go ahead and talk about what's actually happening here with this memory key and why it's so powerful so we know that essentially when we use a chat gbt Block in zap year oh that is not what I want we are essentially basically doing an API call within openi we provide our key and essentially when we write out a user
[11:19] message we are just you know prompting it within open ai's API and they just made it really nice and look really nice for us so it's just like drag or input values and essentially we don't have to see the raw code which is fine but what's happening which is so impressive about this memory key is that zapier essentially what they're doing is that they're are they're creating their own database of conversations for you um so the traditional way of handling the open ai's API call in the context of code is that you'll write out a you know your
[11:51] user message maybe some of the Tope temperature stuff of this nature and essentially what happens is in the context of code you don't have uh any pre contextual data the that's a one-off message therefore you'll have to make sure that you you know adjust the temperature the top PE to a certain amount so to ensure that because we have no previous messages to base off our output we have to Ure that every single time we start that new chat the output is exactly what we want which makes it a lot more complex and more complicated
[12:21] because that means two things that means that we're going to have to really understand how to prompt and that means we're going to have to really understand how to handle temperature max token assistant instructions assistant name bunch of other variables we really need to understand in order to ensure that every single time we start a new quote unquote chat or we call upon the API it is a consistent output requires a lot higher threshold of understanding when it comes to prompting but with zapier does which is super super cool is instead of every single time is a new chat and therefore the outputs are
[12:53] inconsistent they do with the memory key of course if you use the memory key is that by inputting that memory key now I do that chat now the next output that incurs it's going to base off the formatting the structuring the output the type of stuff that we already like based off this chat it knows that essentially that this chat went by fine and essentially the next chat is going to be a similar type of output to the previous chat therefore what this ensures us to do and what a memory key allows us to do is that every future chat is going to be consistent in the way it comes out because of that prec
[13:24] contextual data um so instead of essentially every single time we send an API call is basically just shooting in the dark if it's not really formatted or structured well when it comes to temperature and stuff it is basically already knows within you know the grounds of the type outputs you like based off the memory key you provided so the next question is how do they do this and what's going on here I'm not sure uh I think they actually I am sure they use AWS as their backend which is like you know one of the major Cloud functioning uh backends in the world and essentially what they do which is like really cool
[13:56] is um you know you'll put in your first prompt and you'll lock in your memory key so this will be a little memory key here they send that as a data file to your specific backend as a you know this is the memory key this is the data associated with this memory key for this specific user and essentially every sing every single time a new chat incurs it's that data is being sent to the your back end uh for that specific memory key and essentially what this allows it to do is you know that what's What's Happening Here Right the pre contextual data of
[14:27] this chat knows what's said here they're doing that in their own way of AWS which makes this super powerful as that whole process right there would require very complex code and it'd be very data intensive but it seems like zappier is Will to take that uh on their backend and I don't blame them because honestly this memory key is extremely powerful if you are running an automation company or your automation company uh really wants to have more uh easier use cases or the ability to really use artificial intelligence
[14:58] with with in your flows and you don't offer the capability of having a memory key having pre contextual data you're shooting yourself in the foot this is out of all stuff here other than the prompt The Prompt is the most important this is the okay well end the model of course but regardless of the model just actual input stuff prompt is most important memory key is the second most important hands down hands down is the second most important because of the fact that instead of us shooting in the dark every single time we are having pre contextual data that's going to base off our future outputs we can know consistent will incur which will mean
[15:30] we'll be able to scale better which means that our our automations work better which means when we build on automation for a client we don't have that client talking to us three weeks later talking about now my chpt outputs don't work well or there isn't inconsistencies in the output that's what the memory key does for you and that is why zapier is so powerful in the context of automation especially of artificial intelligence because we are afforded the ability to use a memory key um using a memory key in any other context you would have to set up a lot of complex code a lot of backend stuff a lot of data storage a lot of huge shabam
[16:02] and all we need to do and all we need to understand is that essentially put in a Max of 32 characters random string of characters I can put anything here and essentially those characters represent the chat that's occurring within this automation flow and specifically within this automation flow so you feel like you learned something make sure to leave a like for the value that you just learned today really helps us here out corbon a lets me know you want more tutorials around this topic if you're interested in learning more about artificial intelligence and automation I'm going to leave a playlist at the end here essentially we're diving into all 5,000 apps found on zap your store and I'm showing how artificial intelligence is you know encompassed in every single
[16:34] one if you want to learn more about prom structuring and essentially how to handle chat gbt blocks I'm going to link a video at the end as well that essentially shows how to handle the 3.5 model the 16k model the gbt 4 model and it's getting really full comprehension of everything that's entailed there you can go and check that out without further Ado 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
[17:04] business life until next time