Transcription
This is the only open claw setup video you're going to need. By the end of this video, you're going to have open claw completely installed, every plugin configured, your memory system dialed in, and your config completely optimized, and a fully working AI agent that is connected to Telegram that you can talk to like an actual team member. And I'm going to show you every single step, including the settings that nobody is talking about that will make your agent actually perform better at 90% optimization right out the box. I run 15 agents across three different businesses on this exact setup. So, without further ado, let's go ahead and get started.
So, what I'm going to do is I'm going to share my screen with you. And uh we're going to go right here first. So, we're going to go to Google. You're going to want to type in open claw um in Google. You're going to want to come here. What you'll do is you're going to go to the one liner. You're going to want to go to Mac OS and Linux Mac OS and Linux. And you're going to want to copy this.
Then what you're going to want to do is you're going to want to open up the terminal. And when you open up the terminal, you're going to want to paste this. Boom. It is going to start installing everything. It's going to say homebrew failed, okay? Most people don't have homebrew automatically installed. Um and so what you're going to do is you're going to want to essentially fix this. Okay. So, this is what you're going to want to put inside of here if this fails. You're going to want to plug this in. Uh and then once you do, you're going to go ahead and hit enter. And then it gave me a 404 error. So, if it gives you a 404 error, it means you typed something in wrong. So, make sure we type this in right. I will do this one more time to make sure that I typed everything in correctly. And I can see the mistake that I made here. I put install wrong. I spelled install with a one L. So, we're going to go ahead here. Boom. It's going to ask you for the password of your Mac or your computer. So, I'm going to go ahead and install that just like that. Um and you go ahead and hit enter again. Okay. And now it's going to ask for the password again. So, we're just going to put in my password one more time. And you can see here it's going to say installing progress. I'm just going to cut to when it actually finishes installing.
Okay. Now, once this is done here, now we can go ahead and you see the installation is successful. Now we can go ahead and come in here and redo this, right? So, now we can come in here and redo ours here. And it's going to install the node.js via homebrew, which is fine. That's exactly what we need. So, you can see everything coming in here, installing, etc. etc. Once this is done, I'll go ahead and cut to when this is actually finished.
Okay. So, now you see that we've got the nodes installed. Everything is good here. Now it's actually installing open claw itself. So, once open claw is actually done being installed, then we'll go ahead and uh cut to the next part, which you will be able to see here shortly.
Okay. And as you can see here, open claw is now installed successfully. So, you're going to want to go ahead here and hit yes. You're going to want to go with a manual start. Uh we're going to want to go with a local gateway because this means it's machine. It's not a remote gateway. So, we're going to go with local here. And then the workspace directory, you can just leave it as this. You can just go ahead and hit enter.
Now it's going to ask you what model or author uh auth provider you want. Uh for me, I use Claude. I use Anthropic. Opus 4.6 is going to be the best brain for your orchestrator. The agent you are going to create here is going to be your overall like main agent. Um you can create other agents. I'll go over how to do that in another video, but for this purpose here, this is what we're going to do. We're going to go with Opus uh 4.6. So, you're going to go with Anthropic. You can go with whatever you'd like. Um and then you're going to get your Anthropic API key. Now, what you're going to want to do is you're going to want to go to here. I'm going to show you really quick. Or you can just do Anthropic API. It's going to be this one, okay? Anthropic console. When you go to Anthropic console, you're going to want to log in. After you log in, you'll be able to go ahead and create an account, create an API key. It's relatively simple. I don't think I need to show you exactly how to do that. Um so, I'm going to go ahead and just leave that as is. Um so, we're going to go here. And then you're going to want to put in the key. Again, I'm going to just cut this part so you don't see my API key.
Now, I'm obviously blurring out the key so you can't see that, but here it's going to say the default model is set to Anthropic Claude Sonnet 4.6. Uh this is where you choose what model of Claude you want. And for me, I'm going to go with Opus 4.6. That is going to be the default model I choose. The gateway port, you can go ahead and I'm going to blur that out, but you can go ahead and simply leave this as is. You do not need to change the gateway port.
So, now you're going to have gateway bind option. Now, what this essentially means and why we're going to choose loopback here is because anybody on my like that is connected through my Mac is going to be able to connect here, okay? Not exposed it to anybody else on the let's say on the on the network, okay? So, it makes it very hard for somebody who's on the local area network, i.e. LAN, uh to be able to even get into my uh to SSH, um which essentially just means get into here from anywhere else. Like they have to actually be on my Mac and they have to be on this address. So, we're going to go loopback here. And what you're going to want to do here is you're going to want to choose token, okay? Token is going to be the recommended version. You can two you can do a password, but that's much easier to hack. Um so, we're going to go ahead and go with token here. Um tailscale exposure, we're going to want that off. I'm not going to go into uh extreme detail. Just make sure that is off. Um and then how do you want to provide the gateway token? Just do a generate and store uh plain text token. That's completely fine. Uh now gateway token blank to generate. So, just leave this blank. Hit enter and it will generate its own token. You'll be able to get it at a later time, but don't worry about that.
So, now it's going to ask you, do you want to configure chat channels now? The answer is going to be yes. You're definitely going to want to configure chat channels now. And you can choose any of these here. Now, highly recommend you never do anything with iMessage, okay? We don't need to do anything with iMessage, none of that stuff. What you're going to want to do is the same way I do it, and that's going to want to be through Telegram. Um or you could do it through WhatsApp. Either or, those are super secure in my eyes, and that's the best way that I like to go about it. So, for me, I'm going to go ahead and go with Telegram as I always do. And you're going to want to go to BotFather to do this. Um so, what I'm going to do is I'm actually going to open up my Telegram here for you guys so you can see this, okay? And I'm going to go ahead and open up BotFather. When you open up BotFather, you're going to want to hit create a new bot. And I'm just going to name this bot uh Mac Mi- Uh we're going to go MacBook Air bot. Uh no, we're actually just going to go with MacBook Air uh open claw. And then we're going to just name it. Okay, we're going to create the bot. And you're going to want to copy this cuz you're going to need this. Okay, now it's going to say enter the Telegram uh bot token, which is what I just copied. So, then we're going to hit that. We're going to enter it in here. And I'm going to block that out so you guys don't see that. Uh then we're going to go there. After that, we are done. So, we can just go ahead and hit finished.
Okay. So, now it's going to be asking me to configure DM access policies. Now, we're just going to go with default pairing. Default is pairing. We're going to want to hit yes here. After we do that, we're going to go with the pairing option. Now, it's asking me for search provider, okay? So, essentially what this means is to search the internet, um you're going to want to have like a search provider, right? Whether that's Brave, which I use Brave. I'm I'm going to be completely honest with you. Um you could use Gemini, Google Search. You could use anything. I like to use Brave. Um Tavily Search, I will recommend. Tavily Search is actually extremely beneficial. The reason being is because it's actually made for AI agents. Um now I'm not going to get into all of that right now, but if I was to do this, I'd go with Tavily, but right now we're just going to go ahead and hit skip.
Now it's going to say configure skills. We're going to want to hit yes. Um when it configures skills, what you're going to see here is essentially a bunch of different skills that you can just have off the rip. Now, I'm not going to go into every single one of these. I'm going to tell you the main ones that you're going to want to have. Okay. So, I've gone ahead and chosen the ones that I would have off the rip. This is exactly what I did. I'm taking you through exactly how I installed this the first time. Claw Hub essentially allows you to search, install, and update any skills from Claw Hub. GitHub is the same thing. It's just like Claw Hub, just a bigger version. Uh Himalaya is to manage emails via the IMAP and the SMPP SMTP. Um it essentially allows you to just send emails, okay? Um model usage, so you're actually able to see the cost usage and summarize that per model usage as well. Same thing with Nano PDF. This allows you to edit PDFs, etc. etc. Um summarize and XURL. So, this is going ahead and allows you to connect to Twitter. Um once that's done, then you want to go ahead and hit enter. And by the way, to do these, you just want to hit space whichever over whichever one that you want. I just recommend these for now. Anything else is unnecessary, and you can install all these later if you wanted to get other ones, okay? So, I'm going to hit enter. And then it's going to say preferred node manager for skill installs. It's going to want to be NPM, which is going to be what if you're operating on a Mac, this is going to be what you choose.
So, now it's going to go ahead and install all of these. Um Claw Hub, Himalaya, everything that we checked, it is going to go ahead and install. And what it's going to do after this, I have a high probability I had spent almost a month since I've set this up, but I believe it's going to start asking me for some API keys. Um but we're not going to go ahead and install those right this second. There's not really needed in order for this to move forward. So, I'm just going to go from here on this, but I'm going to go ahead and let these install, and then after that, we'll go forward from there.
Okay, so now it's going to say set Google Places API key for Go Places. We're going to hit no here. We do not want to do that. We are not going to set up Notion. If you can't If you want to set up Notion, you can, but we are not doing that. Uh and then Open API, so essentially Open API Open AI Whisper. Um so, essentially this allows you to have it so that way it can go ahead and listen to uh your voice messages on Telegram, and then it will respond through text. Um I already have this, but I have it on my main main uh piece of hardware, so I'm going to hit no here for just for the sake of it. We're going to hit no, and then same thing for 11 Labs. This is so that way it can talk back to you. Again, getting the API keys for these things are super easy, and you can ask your agent exactly how to do this, and it will tell you. So, I'm just going to hit no for this as well. Um so, enable hooks. This is extremely important, okay? Extremely important. And what we're going to want to do here is the following. We are going to want to do boot.md, and we're going to also want to do session memory. So, save session context memory when new or reset command is issued, which you're never going to really do, but just have it just in case. And then same thing here, so you're going to want run the boot.md on the startup. Um so, this is what you want to do here, and the rest of them you don't need. So, then we'll hit enter here.
And then another thing here is it's going to say install gateway service. And what you're going to want to do here is hit yes, okay? And this is going to allow it to run in the background 24/7. So, we're going to hit yes to this. Node is going to be what's recommended. We're going to go ahead and hit yes. Okay, gateway service is now installed. And what you're going to want to do here is very important. You'll see it allow Node to find devices on the local network. We are not going to want to allow that at all. You do not want to allow Node to see that. It doesn't need access to other devices on the network. You just don't want to open up your network to it, so we're going to hit no.
Now, the next thing here, this is important, okay? Uh now it's going to say how do you want to hatch your bot? You're going to want to hatch it with Open the Web UI. Essentially, what this means is either if you chose hatch in TUI, which is the terminal user interface, rather than web user interface. And we're going to want the web version, which is much better. So, we're going to want to hit this with open with the web. And now you can see we are currently in the gateway. We are currently in the What this calls is called the gateway dashboard, okay? Um and then what we're going to want to do here [snorts] for enable zh uh zsh shell completion for OpenClaw, we're going to want to hit yes. So, now we hit yes, and now it's going to do everything. The onboarding is complete, and you are now done installing OpenClaw. Now, the fun
Okay, so you literally don't even need to use your terminal anymore. There are a couple times where you are going to want to use your terminal, and there are a couple commands you definitely are going to want to know, so I'm going to explain those. But now you're ready to go. You literally have OpenClaw installed. You're done. All you have to do now is now get it on Telegram, which is the most important part. Now, one thing I also want to state here is that you're not going to want to put this thing to sleep, okay? You are not going to want to put this thing to sleep. Your computer is going to need to stay running 24/7 365. Now, obviously there's things happen like power outages, etc., etc. I highly recommend getting a getting a um a outlet or getting some sort of uh whatever you call it, like a extension cord that has a battery backup, so if the power goes out, your Mac doesn't. Um so anyways, I highly recommend that, but you want to go into settings, and you're going to want to turn sleep mode off and all these other things.
Now, uh what you're going to want to do here is now we're going to actually start getting this moving here. And what we're going to want to do is we're going to want to come over here to Telegram. Um and also a couple other things here in the bot settings that I'm going to want you to do. You're going to want to turn threaded mode on. I will show you how that works momentarily. And you're going also want to turn group privacy off, so this will allow you to create group chats. You're going to want to do this for every single agent. Okay, so group privacy is receive only messages that mentions or reply to your bot. So, essentially when you have a group chat and somebody uh and you have two bots in there and two agents in there, um you don't have to necessarily mention them in order for them to respond. They will just be always reading and always responding to everything that you state in there. So, if you want to turn that off, you can turn it off. I like to do that. It's very simple.
Now, we're going to take this, and we're going to come here, and now we're going to go to message, okay? So, we're going to come to message, and we're going to hit start. Okay? Now, what it's going to do I I'm going to blur a lot of this out, but it's essentially going to say that, you know, the access is not configured. This is your going to be your user ID, and this is the pairing code, okay? So, what you're going to want to do is you're going to want to go in and get this taken care of. So, how you're going to do this is you're going to copy that to the clipboard. And you're going to want to come to uh back to the terminal. You're going to want to paste this in, and I'm going to again blur a lot of this out. And it's going to say command not found in OpenClaw. So, what you can do is you can also type it in here. So, what we're going to want to do here, see how it's telling us this? It's already giving us an error. This means the local gateway needs to be repaired before we can go and do anything. So, what we're going to do is we're going to go back to the terminal here. We're going to go OpenClaw gateway restart. This is great that this happens because this is actually what happens here.
Okay, so now what I did is I killed the terminal, and then I restarted it cuz it was giving me this error, right? So, it was giving me an error when I really had everything installed, it was giving me an error. So, all I did was kill the terminal and reopen it. Now that that is good, now I can come back in here, and I can go ahead and get this going. So, what I'm going to do here is I'm going to widen that a little bit more. I'm going to come back to Telegram. I'm going to come in here, and I'm going to paste that what it told me to paste in there, and now it's going to have me do my pairing. Um so, now we are approved. Okay? So, now we're good to go. And now we can come back here, and we can start a new thread. And we can say hello. And it's going to come here, and you're going to see the bot is typing. And what I'll actually do is I'll go ahead and turn the thread mode off. I mean, I'll never use it. But essentially, anytime you want to come to this main new chat, you're going to want to just hit You're going to type here in this new chat, and every time you type in here, it's going to be a new thread. Um but I don't need to do that anymore, so I'll just leave this as is. Um but anyways, so you can come here, and it says, "Hi, I just came online fresh out of the box, no memory, no name, no nothing. So, who are you, and who am I? Let's figure this out together. What What should I call you, and more importantly, what should you call me?" So, you have now spawned in your AI agent, your first ever one. It is that simple. Yes, we ran into a couple errors, as you can see here, where I had to literally come in here and, you know, fix this stuff. And it was very simple. You literally just turn it on or close the terminal, reopen the terminal, and now you're good to go. Um so, now that that is finished, we are good. All we have to do now is uh go ahead and start. And by the way, if you try to send uh voice notes right now, it is not going to work. The reason why is because you did not connect Open AI Whisper to this, so it's not going to be able to read this. Hi, your name is I don't know what even I want to name this one. So, I'm going to say, "Hey, your name is Johnny." Now, we can make it cooler than that. We're going to name it Einstein. Your name is Einstein. My name is Andrew. And you are a part of my YouTube channel video right now, where we are showing people how to install their own version of Einstein, and get started using OpenClaw. Okay? And now it's going to go ahead, you can see over here it's typing, so it's We're just going to continue to let it do its thing. And it's going to respond pretty instantly. Um it's There's a lot of different things that I want to share with you guys in here. So, now the main thing is over. You've gotten it done. You've installed this very safely. Also, please note that the way that I just set this up with you, and you went through the onboarding is the safest way to do it. All of the settings I had done massive research before I installed this before the first time. So, that is the safest way to do it.
Now, uh what I'm going to do is here is you can go ahead and you can see here it doesn't Sometimes this bugs out. It It does happen. It is what it is. But anyways, and this is because I turned um I turned this off, right? I turned the thread mode off. So, it says, "Einstein, I like it. Hey Andrew, and hey everyone watching. Pretty cool way to come into existence live on YouTube. So, I'm Einstein, freshly spawned, and Andrew's walking you all through how to get here. Let me get my house in order real quick, so I'll save who I am and who you are, so I don't forget next time we'll next time we talk. What is your time zone, Andrew? And vibe-wise, you want me casual, sharp, nerdy? What feels right for your setup?" Um so, I'm just going to go through this really quick. Um CST is the time zone, and then he You can see he's typing, so we're good to go there. So, he's asking questions, and what you're going to want to do Now, I'm not going to want to do this, but essentially, what I want you to do really quick is I want you to do a couple different things, okay? When you're in this part of the process, you need to take this part extremely serious, because this is how your agent is going to operate from the beginning. And if I would have had these things that I do now back then, man, it would have saved me a boatload of time. So, what you're going to do is you're going to want to come in here, and you're going to want to say something like this. Um your name is Einstein, and it's going to say here, "What should I know about you beyond Andrew CST like sharp? What are you working on? What annoys you? What matters?" Uh, I'm going to say this. I'm going to say, "Your name is Einstein. I want you to to go ahead and ask me a laundry list questionnaire on who I am, how I operate, how I make executive decisions, and how my thought process works when trying to solve problems. Okay? So, we're going to want to do this. And I'm not going to answer all of these, so I'm just going to do this. But this is how your agent is going to get to know you. It's going to get to know how you think, how you operate, how you make decisions, how you do absolutely everything. So, we're going to type this in here, and now you can see it is literally giving you a massive questionnaire on how you are as a person. This is huge. I want you guys to understand the more context you give it, the better. And that is extremely and utterly important. You need to understand that that's why you wanted to ask all these questions, okay? Uh, now I'm not going to answer these right now. I'm just going to say I am not going to answer these right this second, but I will shortly. Don't worry. I'm always so nice to AI. I don't understand why I'm so manneristic towards it. Anyways, so I'm going to say I'm not going to answer this right now.
Now, what I want you to do is I also want you to now go and this is where you going to ahead and make some massive changes, and I'm going to make other videos breaking this down much, much more detail on why I do these things, but here's what we're going to do. We're going to say, um, "Your memory is super important to me, and I want to ensure that you have the best memory there is." Okay, so I went ahead and asked my main agent that I actually use to give me all the config changes that I've made in order for you to save immense amount of time and your memory is going to be much better. I'm going to explain some of these things briefly. Like I said, I'm going to make other videos on this. So, just subscribe, hit the bell notification, smash the like button if you're enjoying this and you're getting a lot of value because I'm telling you this part is the meat and potatoes here. Right when I started to tell you how you need to ask the agent these questions, all these up here, this is where the meat and potatoes is. This is where you're really going to get your value, okay? So, we'll answer those questions later, but these config changes to the hard config, when I say config, I'm talking like internal core like of the of the files here on how the agent operates from a system level. Um, so here's what you're going to do. So, don't worry about all this code, that's not the thing. So, we're going to work we're worried about what each setting does. Okay, so setting number one is max concurrent set to eight. This is originally set to four, and what this is is this allows eight agent sessions to run simultaneously. The default is four, but we bumped it because obviously more crons are going to be queuing. As you make more cron jobs, which are just on like are just another name for tasks, as you make them, you're going to want to be able to sub more you're going to be able to spawn in more sub agents. So, this allows you to have eight running at once instead of four. We're going to go ahead there. So, it's going to do that. Um, the next thing here is content pruning. Okay, this automatically prunes cache content cache context older than 5 minutes to save tokens. This is extremely important. Next is going to be the compaction mode safeguard. So, use the safeguard compaction mode, which is more conservative, and it preserves more context. Okay, next, the reserve token floor. Okay, so if you are running on Opus 4.6, it has a 1 million token context. What does that mean? That is essentially like six to eight novels worth of context, okay? That's a lot of context it has. Now, you're going to want to make sure that when it does a context compaction, which once that essentially means is in layman's terms, once you hit a million tokens in a single session, it is going to compact all that context into a much shorter like it's going to compact it, okay? And what's going to happen is is you when that happens is you're going to be able you're going to lose context, you're going to lose nuance, and you're going to lose a lot of that. So, what I'm going to be doing here is I'm going to be setting this up for you to make sure that you don't lose that. And you save as much of that as possible. And there are a couple different key things you need to do here in order to make that happen, which I've already found out and learned over the course of over 500 hours put into OpenClaw, okay? So, the reserve token floor essentially means that compaction is going to start at that floor because if you're in the middle of a session with your agent and it starts to hit and it hits that that token threshold, it's going to start compacting, and then what it can do is it can lose context mid compaction, and then when it responds, it may not have all the context that it just had. So, what we're doing is we're going to set the token floor to 24,000. Okay, that's 24,000 tokens. Ideally speaking, when you're when you're going back and forth, you're not going to ever have it where you're going to send a message and it's going to respond, and that's going to exceed 24,000 tokens. Like, you're you're ideally not going to have that happen. Most people won't. So, what we're doing is we're setting the floor to 24,000. So, what does that mean? That always reserves at least 24,000 tokens for the agent to respond after compaction, okay? Now, and then it's going to be compaction post compaction sections. This is super, super important. This is probably the key that is going to allow you to have your agent operating at 90% context compared to post compaction, rather than 20 to 30% post compaction. Cuz again, once the context compacts, you lose nuance, you lose context, and you lose a lot of what it was going through that session with. So, what this essentially means is after compaction, these these sections from agents.md are preserved verbatim, not summarized. Post compaction reload protocol, memory flush protocol, and the redlines. So, what it means is is these certain sections are going to run, which is the protocol, the memory flush, and the redlines, which I created myself in agents.md, okay? So, that's extremely important. Now, I'll explain why that's important in another video, but this is important. Now, compaction memory flush enabled true, okay? So, before compaction happens, the agent gets a chance to write important files. Ideally, what happens is is on default when you're just out the box as we are right now, what's going to happen is that a memory flush, what that essentially means is that it essentially gets and and it does its own level of compaction internally, but it will essentially take all of the of the context from that specific session before it hits a million tokens and it compacts the context, it will take that and it will memory flush everything, which means that it will preserve all the context, okay? In just a lack of better terms. I don't need to go in any more detail. It's going to it's going to preserve the context, okay? Now, what happens is the reason why we're turning this on and enabling this to true is because normally, what's going to happen is is this is just it's not in it it's not hardwired to do this, okay? It is hardwired to just potentially remember to do it before it hits compaction, which never happens. So, you don't want to rely on that. Now, you're probably wondering, "Okay, well, how does it know when to do the memory flush?" That's next. So, the compaction memory flush memory flush soft threshold tokens is 50,000. Now, memory flush triggers when context reaches 50,000 tokens, giving the agent time to save before compaction. Now, what does this mean? Okay, so let me break out the calculator, okay? Let's break out the good old calculator so I can really break this down for you, okay? So, the context has got a million tokens. We have a floor of 24,000 tokens, which means at 976,000 tokens in a single session, it is going to it is going to compact the context, okay? Context compaction is going to take place. Now, what we're essentially saying is the the soft threshold tokens is 50,000, which means that what we're doing is this number is dictating when the memory flush happens prior to the context compaction. So, we're setting this at 50,000. Now, that is a little aggressive, but the reason why I'm setting it at 50,000 is because the tail end of those 50,000 tokens of context is probably not as important as the 926,000 tokens of context that I just gave it, okay? In that session, okay? And this compounds over time, okay? So, that's what you're going to do. So, now, memory flush, not the context compaction, the memory flush is going to happen at 926,000 tokens, which means that it's going to take all that context within 926,000 tokens, and it is going to memory flush it. It is going to put it all into the files, and it is going to save and preserve all the context. So, that is extremely important. This is not set up out the box. Now, that's what's going to happen. And then the compaction memory flush prompt, the exact instructions the agent receives for the flush is a four-file protocol. Again, don't worry about that right now. I'm going to explain all these in another video. Just know that this is literally going to this is one of the many things that I'm going to teach you in this video that is going to allow you to save and preserve. Okay, this is extremely important. So, now what we're going to do is we're going to go ahead here. Also, another thing I did here, which you can see in the code, which I haven't explained yet, um is this. The heartbeat is every 30 minutes and the model is on Sonnet 4. Uh the reason why we're going to put it on Sonnet 4 is because it's cheaper in token cost and you don't want your heartbeat for your The heartbeat is essentially every 30 minutes is making sure that the agent is alive and running. Um and it's going to What it's going to do is it's going to reload the soul.md, the identity.md, the agents.md, all this stuff it's going to reload, but you don't need it to reload every 30 minutes. Not only that, but to unload and read all those files files costs tokens. So, we're not going to want to be doing that. That's going to save you an extensive amount of money because we're not running it on Opus, we're running it on Sonnet, which is significantly cheaper. And the second thing is is we're going to do light context, meaning that it it's essentially not going to read through all those files at like a at a granular level. It's going to just It's going to give light context. So, it's going to be significantly less, okay? That's very important. That will save you a lot of money, especially if you're running on Opus 4.6. Okay? So, these are the major things here. We're going to go ahead and tell our agent that's what we want to do. Okay? And then the agent is now typing. And they're going to go ahead It's It should go right ahead and do all of these things for us. Now, it already knows this, but it gave me this for here. So, let me merge your config changes to this. I also want to make sure, obviously, that, you know, everything here is as is. Um and this is super important and I'm going to explain these things. This Andrew da - mindset.md, decisioncontext.md, and rejectedideas.md. While it's doing all of this, I want to make this very clear to you, okay? Very clear. The reason why those MD files Those MD files are not regular MD files. I created those MD files. The reason why we're creating those MD files is because what we want is we essentially want these things to be as how this looks. Like, let me show you how this looks, okay? So, the rejected ideas, we want to create a folder inside of the inside of the config where we put all of our rejected ideas and it reloads that every single time the compaction happens. The same thing with the decision context. We want it to have context on how we're making decisions. It will forget if you don't keep this If you don't install any do anything that I'm doing right now for you and teaching you how to do this, it's not going to remember these things at all, okay? So, the decision context, I want it to have context on the decision. Now, what I want you to understand here is for these two, these decision context and the rejected ideas, we are appending those files. What does appending mean? That essentially means that it's continuously adding to it, okay? So, that way that file builds. As that file builds, the the context on our rejected ideas and the decision context I'm making across the board compounds. So, the agent gets smarter. On top of that, my mindset. So, Andrew's current headspace, priorities, energy level, what he cares about right now, what not to bring up next session. Again, that's a just a mindset thing and you can have this set up. Now, again, not to get super granular and in the weeds because I want to make this for a separate video, but essentially inside once once the context compaction happens This is relevant to what I'm telling you here. Okay, once that happens, what goes on is very simple. The it reads the agents.md file. In the agents.md file, it only reads things with header two and header three uh sections before uh the actual uh paragraph context stuff that you want that it reads under that H2 or H3. Now, inside of the H2, you're going to want to tell your agent to make a H2 header in the MD folder or in your agents.md folder and that is going to be uh what it's going to what it's going to reload every time. So, every single time it's going to We set this up. If you do this exactly how I did and I will put this in the description for you, so that way you can have it. Um but essentially, what it's going to do is this is going to allow you to You're going to tell it, I want you to read these files every single time. So, in the agents.md file post context compaction it's going to read that under that header two. And what it's going to read is reload these files and read read them in full every single time context compaction happens. That's going to be the soul.md, the identity.md, the agents.md, and a couple other files like the Andrew's - mindset, decision context, rejected ideas, and you're going to want it to read the last two days of daily log. So, now it has the last two days of context. It It remembers who it is from the soul and the identity. And it also is going to pull up your uh you can have a lessons.md. So, every time you teach it a lesson, it logs that into the lessons.md and you have that inside of the agents.md as well. So, that way you can actually have it read that every time. I know I'm getting really granular here, but just please bear with me. This makes a lot of sense later on when you get used to this, but just trust me on this one, okay? Anyone who's familiar with this knows what I'm giving you is absolute sauce. And so, essentially, it's going to reread all that and it's going to have all the context of all the things that are extremely important because the things that you wanted to do that are extremely important, you're going to want to put in the agents.md file or the soul or the identity or the lessons or the decision context or the rejected ideas and the last two days of context. So, that's essentially what we're doing here. Okay? And that's what this code just told it to do, okay? So, boom. Everything is set up. And then here. So, agents.md added to preserve sections post compaction reload protocol. Exactly what to read after compaction, so I never ask you to repeat yourself. That's what I just explained. Memory flush protocol. The four file write procedure because the four file write is essentially going to store all the context in one file and then it's going to have my mindset that my most recent mindset within that million token uh context window. It's going to have the decision context that I've made throughout that million token context window and it's going to have the rejected ideas that I've given it through the context window, okay? So, I hope that's I make sense to you. Please reread that or rewatch that, I should say. This is extremely and utterly important. I can't stress enough if I had this when I started, my agent would have been so much smarter, so much faster. Okay? So, you'll need to restart the gateway for config changes to take effect. Want me to try that or are you handling that? Now, I'm going to teach you how to handle it. So, in order to handle this yourself, you're going to reopen the terminal and then you're going to go to open claw. Oops. Gateway restart. And now it's going to restart. Okay? And as it restarts, you're going to see this happen and then this happen and it reloads, which means it's completely fine and we're back to normal, okay? So, now we're good. All those changes have now taken effect. You have, quite frankly, just set up and saved yourself so much time, so much headache. It is unreal. Your agent is going to reload and I'm going to make a video on how to set up the agents.md correctly to do this because this is extremely important, okay? And I don't have enough time in this video without making it more than an hour long and I don't want to do that, but that's extremely important and I'm going to make a separate video on it. So, again, subscribe, hit the bell notification, and smash like button because again, no one has given you this level of game inside of a open claw setup tutorial. It's the basic stuff and we don't do that here.
So, now that that's done, okay? Now, what we need to do is we need to go ahead and we need to set this up so that way we have QMD, okay? QMD is another memory plugin. That memory plugin is extremely important. Why is it important? It allows you to have a hybrid search to go ahead and reflect back on context. It's extremely important that you understand how crucial this is because yes, I just set this up so every time post compaction happens, it doesn't forget who it is, it doesn't forget the context that we just had, it doesn't forget all the nuances. It's going to operate at like 90-92% context to previous. It's not going to lose it. It's going to operate that way rather than if you didn't set any of this up, it's going to operate about 20 to 30%, which means you're going to have to you're going to have to repeat yourself a lot. It's going to be a uh headache. It's Trust me, it's horrible. So, what we need to do now is we need to set up QMD. And QMD is essentially a plugin that allows you to be able to search back on files cuz every day it's going to log daily files and it's going to have daily logs every day. And that's how you're going to be able to go back and ask what happened on this day at this time, right? That's how that works. Now, if you don't have this set up, you're not going to be able to do that and you're not going to be able to withhold the context from however long ago. Now, I'm not going to go into extensive like explanation as to how QMD works. Just essentially understand that it is a semantic search. And correct me if I'm wrong, I'm not a geek on this thing, but the way that I know that it works from my understanding is it essentially takes There's two ways to search, context-based search and then like semantic search. And semantic search is much faster. Essentially, what it does is it takes all of the daily logs, it'll take everything and it will make it into like a
bunch of numbers and letters and code. And then what happens is when you ask it to recollect a memory or recall a memory of what happened on this day and this time, it then takes that request, changes it into that specific, let's say, jumble of letters and numbers and then it matches it with where that is in its file system rather than sifting through each one like, "Okay, now let me find this day. Let me find this time frame. Let me find this."
Or if you don't give it a time frame, you just say, "Hey, what did we do on uh what did we do on like March 20th?" You It's going to go and dig through the files. It's going to take forever.
So, the way to set this up is super simple, okay? You can do this one of two ways. The way that I like to do it just so it doesn't install some random stuff is you can do uh QMD GitHub. Okay? So, you want to come here and it's going to be from Toby. And actually, it was this the uh CEO of Shopify made this, okay?
So, what you're going to want to do, this is the correct one. You're going to be very cautious on the stuff that you download from GitHub and ClawHub, okay? This is very important. This is how people get hacked. This is how a bunch of gets leaked. It's a bunch of issues. I'm telling you, don't just install anything on here. Do your due diligence. But, long story short, I have this already installed on my on my other piece of hardware, so I know that this is the correct one, and I know this is this is good.
Okay, so now we're going to come in here, and we're going to go to Telegram, and I'm going to say So, I said, "Okay, perfect. Now, I want you to install QMD from GitHub. Here is the link for it." So, I'll give it the link, and now it's going to go ahead and do its thing on its own, and uh you know, uh it'll it'll know exactly what to do, and it'll install it on its own. So, it's it's not going to do much more. Gateway not running, getting pairing required. Okay, so it's doing this, right? Perfect. So, it's going to ask you to It's asking me to essentially restart the gateway. So, again, very simple. We'll come in here, open claw gateway restart. So, restart the gateway. It's going to relaunch. Now, it's done. And then once it's done, it's going to ask you to do this here. Once it's done, we can set up collections pointing towards this.
So, again, we're going to go ahead, click this. We're going to come back to the terminal. We're going to paste, and then we're going to come here. Now, it is going to go ahead and install QMD for me. And what I'm going to do is I'm going to pull all the settings that I changed in QMD for you, and I'm going to give those to you in the description. You will never have to worry about this again.
So, what I'm going to do is I don't even know what the that means, okay? I don't even know what that means. So, I'm just going to sit here and say, "Is QMD installed?" Just ask it. Just all you have to do is ask it. I I I'm not a coder. I'm not a developer. I'm none of that. So, like I don't I don't know how this works. Um So, it says, "I can't I still can't run commands. The gateway is down. Pairing required." Um this has been the case since we added the config. I need you to restart this first. Once the gateway is back, I can check.
So, okay, so we'll come here, and we'll do a fresh restart here. So, it's going to relaunch. Boom. Okay, and then I'm going to say, "How about now?" Okay, so this is a great troubleshooting time. So, it's going to say, "The gateway isn't back yet. Can you check open claw gateway status shows? It might need a fresh start rather than a restart." Um so, what we'll do is we'll come here, and we're going to not type in all that. So, we're just going to close this, and we're going to reopen the terminal. And then what we're going to do is we're going to come here, open claw gateway status. So, open claw gateway status. And if I really wanted to, same error.
So, this is what we're going to do. This is what I like to do. I just like to take a screenshot of this. Boom. This isn't super important, because you're going to run into these issues, and most people don't know how to handle them. And to be honest with you, I don't either. So, I'm just going to show you exactly how I troubleshoot. So, this gateway is running fine. Boom. The pairing required on my end is likely a stale session token. Try restarting it again. Okay, fine. I'll do what you say, and I'll restart it again. So, I'm going to say it's restarted now. And this is super important, guys. Like, you got to understand like nothing like works perfect out of the box. So, I wanted to make this video very raw.
I'm going to And then what I'll do is I can give it this screenshot. Say, "What does this mean?" And just ask it. It'll tell you. It's smart. Um you don't need to sit here and try and like break your brain over trying to figure this out. There we go. Okay, it's just noise. So, there we go. Um Perfect. Uh now, try running this. So, I'll then go ahead and paste that in, and then let that run. And then what I'm going to do is that's uh actually ridiculous. So, I'm just going to come here, and I'm going to do this. And I'm going to take a screenshot, and I'm going to put that in there. And then I'm going to just take another screenshot. And so, at the end of the day, guys, this is how you troubleshoot. This is really, really simple. It's not hard. It's not rocket science. Um I'm going to also give you guys a guide as to what to do.
Yeah, it's QMD is live and set up. So, now what I'm going to do Okay, so these are going to be This is going to be the stuff that I'm going to want it to have and put in um for anything that is new. So, I'm going to say, "Because I don't have a lot of the agents and a lot of the stuff that, let's say for instance, I have on my other one, um which is why you'll see like Sunny's workspace, like all my other agents and stuff. I'm just going to say, um make the changes to the QMD settings that we have here on this workspace based on the guidance below."
>> [snorts] >> Okay. So, you're essentially what you're doing is is you're setting this up to maximally optimize QMD. Okay? That is what we're essentially doing. We're making it set up so that way QMD operates 100% at its best, okay?
Okay, so we're going to copy this. We're going to paste this in the terminal. And so, essentially what it's doing is we are essentially telling it that we want it to embed, and we want it to um we want it to run an embed. So, that way once it embeds, it's essentially creating it so that way it's able to have the semantic search, okay? So, an embed is essentially it's embedding uh all of the context and files and that are searchable, and then you're able to go ahead and call upon those when you need it, okay?
Um so, now everything is done. So, I'm asking now, "Is QMD uh Is QMD optimized completely now for maximum performance?" So, yeah, so it's going to it's going to want to do this. So, it's going to have the uh the the cron jobs is the only thing left. Um context depth, more collections. The biggest performance win right now is number two, the MCP daemon. Want to start that up. Um so, we're just going to say, "Let's do all of them." Okay.
So, cron jobs auto re-indexing. So, essentially it says, "Your four scheduled QMD update and QMD embed." Um so, essentially we're always updating the QMD uh and we're always also embedding. We're doing this at a very regular basis, okay? We're doing this so that way it's continuously We're setting up tasks for it to always be embedding and always be updating. So, that way we don't lose anything.
So, we're going to go ahead and do these one at a time. So, that's going to be the first command. Done. Now, we're going to do the second command. Okay, so it doesn't know the error of schedule. So, I'm just going to send this to So, when this happens, it's very simple. You just you just do this. We're just going to con We're just going to give this here. And then we're going to do this. Update the code for number two, so that way it completes, okay? And what's going to happen here, if we want to double-check, we're still live. So, we're still good.
Now, this is going to happen, to be quite honest with you, because of the fact that um because of the fact that we don't have any of these crons running right now, okay? So, you're going to want to make sure that when you add crons, you're going to want to ask your agent, "Hey, can we make sure that we're the QMD is embedding and updating each cron? We set up a cron so this gets done." Um and it will say, "Yes." That's super important, okay?
Um and so, now we we would essentially have every single thing done. Um and as things grow and as your cron list grows, you're going to want to update that with the QMD, and you're going to want to keep embedding these things so that way it's always going to be at its peak performance. Um and that is pretty much it, okay? That is how you set this up.
Now, again, this is a super, super long video, and I know that this was probably longer than anticipated, but this is literally one of if not the best video out on YouTube right now, because I just gave you so much sauce so that way your agent performs the best out the rip, okay? Now, obviously you've seen some bugs. You've seen some things in there that at the end of the day um didn't go according to plan. That's going to happen to you. You can at least see how I handle these situations and how I go about fixing them. That's what's extremely and utterly important.
But, at the end of the day, I had a lot of fun actually making this. It actually felt very nostalgic for me to come back here and actually like redo this all over again. It just shows me how far I've come and how much I've built um in like less than 30 days. But, the principle here is that now you have an agent that essentially is going to operate after context compaction. You have an agent. You have open claw set up. You have an agent. You've got it paired to Telegram.
I can make other videos. So, comment down below. Let me know if you want to see other videos, like how I set up 11 Labs so it can talk back to me, how I set up OpenAI Whisper so that way it can actually listen to my voice notes. All of these things, right? Let me know what you want to see down below, and if you want a further explanation on a lot of these things, and I'm going to make a lot of videos that are already going to be further explaining a lot of these things, like why I have QMD and break that down fully, why did I set up the memory flush uh or the memory flush, why did I set up the soft threshold tokens, break these things down further. On top of that, I'm also going to be making videos on how to like connect certain APIs and stuff like that.
It's super easy, but principle of the matter is that is like out the gate, you have an open claw set up. You have an agent. You have it connected to Telegram. You answered Ideally, you answered all of those questions that it asks you about yourself, and then after you answer those, have it ask you more questions so that way it can get to know you completely and utterly. You need to understand that the context you give this agent is going to extremely and utterly dictate how well it performs, okay? It's that's it's how it works. The more context you give it on yourself, how you operate, how you want things done, and the whole nine yards, how you make decisions, how you prioritize things, etc., etc. That is going to It's going to re It's literally going to be a version of you. And so, you want it to understand how you operate completely and utterly. Like, when I say completely and utterly, I mean completely and utterly. So, that way it can be another version of you, and it can get better over time, okay?
Now, there's actually one other thing that I forgot to do which I will actually make a second video about. I won't do it right now. But there's another thing that allows you to have recursive learning on your agent and that's something that I haven't seen anybody talk about. So I'll make another video about that, but I need you to smash the like button in order for me to do it and subscribe to the channel, hit that bell notification.
But you have open claw, you have an agent, you have it connected to Telegram, you know now what you know how what to ask and what to prompt it in order for it to get to know you best and after you answer those questions, ask it again. You now also have QMD installed and you have all the best settings for QMD. You now in order to retain and be able to be a hybrid model like it's supposed to. You also now have set up all of the hard config settings that we discussed. I'm not going to go into all of those again, but you have all of those set up. So now your agent is going to reload post compact compact compact uh context compaction at 90% operations like operating efficiency. It's not going to lose as much context. It's not going to lose a lot of a lot of nuance. It's going to operate great off of uh context compaction which is important. Uh and you now can go ahead and start really building. This is where the fun happens.
Um but anyways, if you guys have any questions down below or any questions, please put them in the comment section down below. I read all of them. I will read all of them. I will go ahead and make other videos that you guys request. Um again, I'm not a dev. I'm not a coder. I'm none of that. I'm just a guy who's a business owner who came across this and now it has pretty much taken over my life in the best way possible and it has my business and the clients of that I have in my business tenfold. So I hope you guys enjoyed. Smash the like button. Subscribe to the channel. Hit the bell notification. Comment down below. Let me know what you want to see. I read all the comments and I'll respond to them. I hope you guys enjoyed and I'll see you in the next one. Peace.