00:00build this Grock 4 AI agent, it never forgets
00:02Do you ever wish your AI would remember everything that you told it so you don't have to keep giving it more and more context
00:08But with the brand new Gro for model, which is literally the most powerful AI model on the planet now, we can build this incredible memory agent system that will remember everything that you tell it
00:17So in this video I'm going to show you step by step how we can use grock for lovable and nitn to create this beautiful WhatsApp style chat interface in which you can talk to gro for this AI agent and it will never forget what you tell it
00:31Meaning you get a beautiful personal productivity assistant remembers everything you say your team say or your clients
00:36With that in mind grab that coffee let's dive straight in
00:37And a very quick tail
00:39Why do we care about Grog 4? Well it is absolutely smoked all the other language models and outperforms PhD students in every category
00:47And Grogall costs exactly the same amount as Claude, but it's five times better per dollar
00:50So let me show you how this system works very quickly
00:54So the way this system, this agent works, okay, is connected by web hooks to liveable
00:57So let me just show you very briefly how this works
00:59We'll ask this beautiful chat interface a question
01:02For example, how old Robert died? It then comes through to the scenario
01:05It will speak to grock
01:05It will store the memory
01:08It has the ability to search for internet
01:09Now crucially, what I've done is given its own functional database, which is perfect for projects such as this
01:14Of course, we could use rag, but we're actually going to build a specific dynamic thing where we can give it information daily
01:20It has two functionalities
01:22One is to search its memory database, and the second one is to create a record
01:25So, I'm going to give it a fictitious memory here
01:27And this memory could be the fact that I don't know, Jack really loves the color purple
01:32Please mention this when he talks about colors
01:35All right, cool
01:35So, when you're actually having this conversation, you can say things like this
01:39Hey, dude
01:39Um, I would love to purchase a new kitchen
01:42What colors would be great? So, let's trigger the scenario
01:47Come over here and ask this a question
01:49Cool
01:49So, we ask it a question
01:50It's now checking
01:50We come back over to our scenario
01:51It's running
01:53It's now checking Grock, which means it's actually using the system we want
01:56And as you can see, guys, it's also searched the memory, which means what this does in the system instructions, it goes over actually finds out what memory
02:02So, before it even responds, it will check your list of memory
02:04So, the idea of this is that you could have a conversation with it every day and actually it knows what you've said every single time
02:10So, you don't have to keep on giving it all the context
02:12And guys, just like that, if I come down, it's given me a beautiful answer
02:15It's also, by the way, research the internet to get some additional context
02:18So, it's also powered by the internet, which is ace
02:21But if I come over and have a look, guys, I can see it says, "Hey, you mentioned love in the color of purple
02:25I'll definitely weave that into my suggestions." We didn't have to mention it
02:27It's check this memory
02:27So, we're going to build this entire thing together step by step
02:30What we need to do first of all, guys, I'm going to grab over now the actual blueprints that we need, and I'm going to show you why this is super relevant in a second, right? I'm come over to every automation and grab this
02:39Cool
02:39So, we're going to download these two things
02:41We're also going to build these together
02:42the step by step
02:43So, we've got the Grock memory agent that we can just plug, play, and upload, which is great
02:45We just download that
02:47And then, crucially, what we also need to do is give a prompt to lovable
02:51Now, Lovable's really cool
02:51It's in the same category as Bolt
02:53We talk a lot about these AI operating systems
02:55What I wanted to do is simplify this
02:57So, let's just copy all the text in this document
03:01And what we can do is head over to Lovable
03:03Great
03:03And we can just paste it in
03:06If you want to create your own um specific thing, you can do that straightforward
03:10What's really cool is you can come down, give it the prompt
03:12What I've done is given it a load of coding for how I kind of want it to look
03:15But you can also these things down here, which is remix projects, which is fine
03:18One that you like, remix it, and then just adapt it for what you like
03:21Cool
03:21So, we give it a big prompt
03:21We're basically saying, "Hey, I want you to create me a beautiful WhatsApp style chat interface." We hit enter
03:26It starts building
03:28Then we come over to our brand new workflow
03:29I'll show you how you import it
03:31Then again, we will build this together step by step
03:32Let me just come down over to import from file
03:34You select the file and the whole thing populates
03:37Really freaking cool
03:37So what we're going to do though first of all building this step by step is come down here
03:42I'm going to go for web hook over here
03:44Okay
03:44Beautiful
03:44Okay
03:44And you're going to get this thing again
03:46This is what connects to Lable
03:47We copy this web hook just by clicking it
03:49We come off
03:51Of course, we're going to give this a name
03:52We'll call this one Grock memory which is ace
03:55I don't I'm so excited
03:55We get these big quantum leaps
03:57And the fact crushes it I think is really freaking cool
04:01So we come over to this
04:02Lovable is doing it
04:02And what we're going to say is something like this
04:05Hey, I would like you to send the chat messages to this web hook
04:07Cool
04:07And all you're doing, guys, is enter in that web hook
04:10And when it's done, we're going to hit enter
04:12And whilst that's waiting, guys, what we first of all then need to do, if I come over to our beautiful scenario over here, is we want to add in the AI agent and connected to Grock
04:19So to do that, we come over
04:20Let's go over here
04:22AI agent
04:22Beautiful
04:22We need to add a chat model
04:24So click on chat model
04:26Type in XAI
04:26Fantastic
04:26And you're going to need to add an account
04:30Now, where do I do that? You're going to head over to console.x.ai
04:34AI
04:34You come over to your dashboard
04:36Really cool
04:36Go over to your API keys and then you just create an API key like so
04:40Boom
04:40We hit this
04:40It'll pop up
04:43Give it a name like ABC or whatever you like
04:45So see remember what it looks like
04:46And then you can simply copy this to clipboard
04:47Come back over to your scenario here
04:49Uh click on this
04:49Click on this bit here
04:53And then we just simply let's just create a brand new connection
04:56Um let's let's do a new one here, shall we? Create a new credential
05:00There we go
05:00Fantastic
05:00And we're in
05:02Superb
05:04That's now all people connected and we can chat with Grock which is cool
05:06So let's just check that that works
05:07Let's just remove this and let's add in a little chat interface real quick
05:10Chat trigger
05:12Great
05:12Bring it over and we should be able to have a conversation with Grock in our new scenario which is great
05:18So come down in chat and we'll say hey man who was the tallest man to ever live and you can see now that is working perfectly
05:27And then we've got the information back immediately like lightning fast which is very very cool
05:32Beautiful
05:32So, what we want to do next is once we've done that is probably going to start giving it some tools
05:35So, I'm going to bring this guy over here for a moment and let's go check in on how Lovable Bull's getting on
05:39Cool
05:39So, now Lo's built this thing, we're just going to say, hey, I wanted to send it to this information here
05:43So, just send that one off so it comes through to the right web hook
05:46In the meantime, let's get the actual scenario set up and working over here
05:49So, for the meantime, if I just do it based off a chat and then we can connect to deliverable afterwards
05:54What's the stuff that we want? So the first tool we're going to add guys is Tavi which you can add by HTTP request tool and filling out this information
06:03Really really cool
06:03And basically you just do it with the headers
06:05If I click on this for example, hey use it to search internet
06:07Obviously you can just add a key for this
06:09I've just done this very quickly
06:10Uh value here
06:12You put your API key in from tab
06:14Again just come over to taby.com sign up get a free API key
06:17Very very cool
06:17Uh and then we've got the query to be defined by the model results 5
06:21So basically it'll pull down the five top results from Google and then you're ready to rock and roll
06:26So the next thing we want to do is give it the ability to search memories and also create memories
06:30So how do we do that? We're basically going to add in a table which obviously you can do here the same module then we just change it
06:35First one is to create a record
06:37So we come down
06:39So automatically you pick the list uh the base the table and all you need to do is just let the memory cuz this will pull through all the categories in air table which I've got memory
06:48It's the only one I've added in there
06:49Of course you can do this many different ways
06:50Uh, and I just said, hey, let the model define what the thing is
06:53Awesome
06:53That creates the memories
06:55Then we've got searching memories, which is the same thing, but operation is to search instead of create
07:00And it can do it from this bit here
07:03No need for a formula, and it will return all of the information, which is code for very, very cool news
07:07And now we've done that guys, we can basically just connect it together with the web hook
07:10So let's get rid of a chat message real quick
07:11Bring the web hook over
07:13Connect that guy up
07:15And then we need to send something back over to Liverpool to create our operating system
07:17So come down here to respond to web hook
07:19First incoming item is fine because it's just going to be the output from the agent
07:23Come over to the first web hook
07:25Instead of respond immediately, just put using respond to web hook node
07:29Beautiful
07:29What we need to do now guys is give the agent a prompt and instruct it on what we kind of want it to do
07:34So before we do that, I'm just going to test this workflow so we can actually get something from URL to make sure the data comes by
07:40To do that, I'm just going to say, hey, okay, message didn't go through
07:45Let's just make sure that that all is all fully active
07:48If I just stop the scenario real quick
07:50Come over
07:50Come on here and let's just listen for test event
07:52Come back over and we'll say one more time
07:54Hey
07:58Okay
07:58So, basically it's not sending the message to the web hook
08:00Very, very cool
08:01Let's just fix that very quick
08:03So, we just say, "Hey, information is coming through
08:05Make sure you send it to this address." Simple as that
08:06Cool guys
08:08I've just sent yo, and the message came back
08:09Little tip, by the way, when you're testing this, if you're isolating it, you need to make sure it's respond immediately
08:14But the news here is that we've actually got the message, which is cool
08:17So, we connect it like so
08:17Click on the AI agent and then we need to basically say hey this is the thing that you're responding to
08:23So all we do is we come down over here to message which is great and pop that in the prompt
08:30Fantastic
08:30Next thing I want to do here as well is just give it a bit of a memory
08:34So guys for the memory section we click on the simple memory and then define below I'm just going to put this JSON body date which basically means it'll remember everything we spoke about today and then we can actually store things into its long-term memory which is very very cool
08:46I will put context length as 10
08:47But and then if we come over to the agent just check out what his actual system message is
08:51So come down here which is basically it instructions comments expression just so I can full screen this real quick
08:57Beautiful
08:57Basically we just tell it everything we want it to do
08:59Uh what its job is it's called behavior protocol
09:02Basically every time it responds it needs to check its memory before it does that
09:07And if asked to it needs to create a new memory
09:08So, for example, now if I do execute workflow and I come back over to our beautiful new scenario, which is uh this one right here, right? I can say, "Hey, Bruce, what's my favorite color? Also, please record the fact that my favorite food is tacos
09:22Thanks." All right, hit enter
09:25Bam
09:25Now, this is working in the background
09:27We get this animation
09:28We come back over to our scenario
09:29We can see it's now checking in with Grock, which is awesome
09:31It's now searching the memory database to find out all the stuff that we said
09:34And then what it will do is create a memory for us
09:37So if I come over to our knowledge base for example, you can see here we've got Jack loves a cold purple
09:41Please mention it when it talks about it
09:42There we go
09:42Jack's favorite food is tacos
09:44This was mentioned on insert date
09:47So that's basically how it works
09:48And in the future, if I ask it for something like, hey, book a restaurant, it will know that Jack really likes tacos
09:54So let's go find Mexican restaurants instead
09:55And then we come back to the conversation here
09:56Basic conversation history
09:58I can see your favorite color is purple
09:59I've also recorded your favorite food is tacos
10:02You mentioned today
10:02Is there anything else that you would like to share or discuss? Now, really importantly, this is an AI operating system.