Transcript for:
Managing AI Prompts with Airtable

in this video I'm going to show you how to use aot table to better manage your AI prompts within your automations the main mistake that people make is they embed their prompts directly into their automations like this which means anytime you want to change a prompt you have to open your automations you have to test it and you risk breaking all of your other automations instead we manage all of those prompts in air table including your system your user and your assistant prompts and we use clever automations so that we can import those prompts as variables here we can map in those prompts for system and you can see we have those same variables here nicely broken apart like this with access to our system user and assistant prompts directly and so we can simply come in here and select the system prompt then we can do the same for our user prompt just like that and then we can add in our assistant prompt as well then we can save that Automation and then if I were to come in and modify the prompt and then the next time this automation runs it's going to import that prompt into the automation automatically without having to come back into the automation to change it in this video I'll show you how to build the air table database the entire Automation and this mechanism to import the prompts as variables for chat GPT step by step from scratch now if you want access to These make.com Blueprints so you can simply import the automations that we build today and have them available just like this including access to the air table database make sure to jump into my new community the no code Architects there's a make workshop and a bunch of other templates you can get access to like you see on the video today it's a growing community and you can get text support to all your questions and there's calls almost every single day where you can talk to me personally to get started I'm going to go ahead and create an air table base from scratch I'm going to go ahead and close this I'm going to rename our base to AI prompt database I'm going to rename this table here to prompts now we're going to create a few different columns here this first one is going to be the name of our prompt this is the name of the prompt that we'll reference in our automation go ahead and save then I'm going to convert these other columns into our system prompt this should be a long text go ahead and save then I'm going to convert this to our user prompt user convert this to a long text as well go ahead and click save then let's convert this one here to assistant and again we'll convert this to a long text and save it now I'm just going to jump into my existing base and copy over some sample prompts in our automation we have something to work with going to paste that I'll click continue then I'm going to just adjust the row height a little bit here so we can better see it so now what you can see here is that we've grouped these different prompts with their Associated system user and assistant prompt so that in our automation we can reference the capital prompt and it's Associated system user and assistant prompt so I just opened up a brand new automation I'm going to start with an air table module and we are going to search for records now I have to add a new connection to our new base so I'm going to go to add connection type ooth I'll go ahead and rename this to AI prompt database I'll click save it's going to open up this window to connect the new base I'll add that base AI prompt database I'll make sure to use the one that I'm building from scratch Grant access I'll go ahead and pick the base AI prompt database table prompts and then I'll go ahead and select all which is going to bring in all of the different columns from the air table base and I can leave the limit here at 10 but if you had more prompts then you'd want to expand that I'll just move it to 100 click okay that means our make automation could bring in a 100 rows from our prompt database now keep in mind your automation is probably going to trigger from a different module other than this so you might actually be triggering from something like a web hook in which case after it triggers then it would search your a table database to bring in the prompts for the rest of the automation but in this example I'm just going to use the air table search as the trigger to demonstrate the functionality so now if I run this module once it should bring in all of our prompts and so you can see here we we have all of our prompts we have the main name and then we have the system user assistant and a bunch of other fields that we don't really need so we have all the data that we need but I want to bring it into this format here just like this that allows us to see it in a very organized and nice manner so to do that what we're going to do is we're going to use the text aggregator module that's in your tools and we're going to scroll down and go to the text aggregator and for the source module you're going to want to use the air table search and what this module is going to let us do is it's going to go into all of this data and it's going to refactor it so that we can build out this Json structure that we see here now before I start building out the text here I'm going to go ahead and show advanced settings and I'm going to go to the row separator and I'm going to move that to other and then I'm going to put a comma and then I'm going to go ahead and start to build this out so you don't have to understand everything that I'm doing here I'm essentially building out a Json object so I'm going to start with a quote and I'm going to use a built-in make function called upper which is going to convert our variable here to uppercase if it is not already and then I'm also going to use the replace function on the prompt from Air table and in order to access these functions you just need to type it just like I did and it will turn into these built-in functions and here I'm going to replace any spaces in the prompt with an underscore and I do that just for formatting reasons and to keep things consistent now I'm going to add a colon I'm going to jump over here to these other tools here I'm going to go to this space I'm going to add another colon and simply turn that into to an underscore so what that's going to do is if I ever have a space in one of my prompts like this with another word it's going to replace this space with an underscore and now from here I'm going to close the parentheses for this replace and then a second close parenthesis for this upper here and now I just need to close that original quote and now here I'm going to add a colon and a curly brace and now I'm going to add in our system prompt I'm going to go open quote system close quote with a colon then I'm going to add an additional quote and I'm going to map in the system prompt from Air table here we have our system prompt then I'm going to close the quote now I'm going to add a comma and add in our user prompt again add a quote user close quote colon and now we'll add in the user I forgot to add the quotes around the user so I'm going to add those as well then I'm going to add another comma now we're going to add in the assistant prompt close quote colon open quote now let's map in the assistant close quote now we're done we can just add the closing curly brace now again this might look a little bit confusing but again we're just writing code that is going to help us format these prompts into a nice experience when we're building our automations I'll go ahead and click okay as always I'm going to come down here and click save it'll give you a warning because it doesn't like this to be the final module in your automation I'll save anyway then we're going to add an additional module here this time we're going to type Json we're going to parse the Json and in the Json string here we're going to Simply put a curly brace and we're going to map in the text from the previous module and then we're going to close that curly brace and click okay we'll go ahead and click save again it's going to warn us it doesn't like the Json to be the final module but go ahead and save anyway and then let's go ahead and give this a test run and see what we get again remember you will need to add in some of your own prompts over here and include a system user and a assistant prompt for each prompt that you add let's run this once let's see if we get any errors run anyway so it looks like everything came through if we look here we're going to see see all of the rows coming from Air table and now if we look at this module here we're going to see the input is all of the bundles coming from Air table consolidates all of that into one final output string that looks like this and then we map that into our Json so if we open this up and you see here we have our output we have all of our main prompts and then if we open this up for each prompt we have our system user and assistant prompts so now we can simply come into our Automation and we can go to chat GPT I'll go ahead and show more I'll create a completion if you don't already have a connection you'll need to add one and then we'll go ahead and select a model CH GPT system 40 and then we can go ahead and start adding our messages we'll go ahead and add our system roll and then we can map in for any one of our prompts you see we have that nicely formatted prompt now with the system user and assistant prompts for each of our main prompts so let's go ahead and map something in we can map in the system prompt here then we'll go ahead and add in the user prompt right here just select that go ahead and put in the assistant prompt just like that and map that in from our Json object and here our Max tokens I'll go ahead and just put zero and we'll go ahead and click okay I'll go ahead and click save we won't get that warning anymore because we're no longer using one of these modules as the last module and now we should be able to just run this going to format all of our prompts and then map those into chat GPT if I open this up we can see the messages that we sent open this up so we can see that our prompt from Air table is getting mapped in just like that and the same with our user and our assistant prompts and so again if we wanted to adjust any of these prompts instead of having to open up the automation come in here and adjust it here and so now I can just save this Automation and the next time I want to update a prompt instead of having to come into the automation I can simply go into my Air table database I'll go to the prompt make an update and then I can just jump into the automation I can go ahead and run it again now we can see if we come into our automation this execution and we open up our system prompt we can see that the prompt changed automatically without having to actually update the chat GPT module you are a culinary expert that has won many awards I meant to say one but now you can see the power of storing all of your prompts in an organized fashion here you can store every single prompt that you use in your automations the system the user and the assistant organize them nicely here and just map them directly into your automations just like we did in this video so if you like this video make sure to jump into the no code Architects where you can get access to a bunch more content including a bunch of templates like you saw today I'd love to see you there but either way I hope you enjoyed this video and I'll see you on the next one