OpenClaw COMPLETE Tutorial - All 12 Concepts You Need To Know (Memory, Cron vs Heartbeat, Workspace)
By ByteGrad
Summary
Topics Covered
- OpenClaw Sparks Instant Gold Rush
- Proactive AI Wins Over Reactive Chatbots
- Self-Hosted Flexibility Trumps Vendor Lock-in
- Heartbeats Enable Silent Proactive Monitoring
- Memory Persists via Editable Markdown Files
Full Transcript
Welcome to this OpenCloud tutorial. In
this video, we're going to talk all about it. You can use OpenCloud to have
about it. You can use OpenCloud to have a personal AI assistant. It was
previously called Clawbot and then they had a few days where it was called Moldbot, but they finally settled here on Open Claw and it's been blowing up.
There's already businesses being built around it. There's a gold rush going on
around it. There's a gold rush going on here. So, it's actually really
here. So, it's actually really interesting tweet here. So, there's a bunch of hosting services already that are charging money and of course, we can't verify the numbers, but it does seem likely that at least some people are already paying for it. In fact,
there is one person here who is going around helping people setting up Open Claw and charging money for that. In
fact, is charging a lot of money for it and there seems to be people actually paying for it. In fact, he claims his schedule is actually quite booked. So,
really exciting time to get into Open Claw. I think this is the right time to
Claw. I think this is the right time to learn it. We're still early. This is
learn it. We're still early. This is
going to build out over time into something really big, I believe. So, in
this video, I'll help you learn it, get a better intuition for how it works. It
was actually created by uh this person called Peter Steinberger. He actually
has a ton of projects here on his GitHub. So also for those of you out
GitHub. So also for those of you out there building software, I think it's quite motivating because all of these projects that were built by this person ultimately led to one big monster hit
and that's all you need. So it can help you with your emails. Hey, you just received an important email from somebody that you talked about before. I
have drafted a reply. Uh do you want to send this? It can also help you manage
send this? It can also help you manage your calendar. It could notify you, hey,
your calendar. It could notify you, hey, you have a meeting coming up in 10 minutes. Here's the meeting URL. And you
minutes. Here's the meeting URL. And you
can do way more advanced things as well.
It can, for example, control your browser if you set that up. And that
allows you to check in for your flights, as an example. And you can do all of that from the chat apps that you're already using. This is one of the
already using. This is one of the differentiators with some of the other AI chat apps, which is a different app, right? But with OpenClaw, I can use it
right? But with OpenClaw, I can use it inside WhatsApp, Telegram, Discord, Slack, the apps that you're already using. And I have identified the top 12
using. And I have identified the top 12 concepts that you need to know to work with it effectively. So let's quickly list them out and then we'll go through them one by one. So first of all, you
need to understand open clause plays in the ecosystem. So what is it and why is
the ecosystem. So what is it and why is it different from these other AI chat apps that I'm sure you're using as well, right? You can already chat with AI
right? You can already chat with AI models with these other apps and you can and if you want to build AI automations, there are other tools as well. So why is openclaw different? And actually we'll
openclaw different? And actually we'll also take a look at some use cases because you need to see some practical examples to really understand its usefulness. And we're going to talk
usefulness. And we're going to talk about the overall structure of open claw. Right? So you get something called
claw. Right? So you get something called a gateway. What is a gateway? You need
a gateway. What is a gateway? You need
to run that somewhere. Right? You can
run it on a Mac mini or a VPS. But what
are we even running on there? Like what
what's what does it consist of? You also
get some dashboard a control UI. What
can we do in there? And and what are the other parts that you get as part of a open claw setup? Right? So you can send a message over telegram or WhatsApp. It
will go to a so-called gateway which will do some things on it and then ultimately it will send it off to an actual AI model. Right? So you can connect an AI model like one from open AI or entropic. Right? So there's a
certain flow that it goes through and then you will eventually get a response.
Right? So what are all the different moving parts here? There's something
called a workspace as well. So so it has a particular folder structure. We'll
talk about how it's structured and what you find in the workspace specifically.
Right? So there are all these files like soul.md and identity.md. What are all of
soul.md and identity.md. What are all of these markdown files and how are they used when you send a message through telegram or WhatsApp to well the
gateway. We'll talk about that. Open
gateway. We'll talk about that. Open
claw will attach some things before it sends it off to the model that you connected. Right? So you're connecting a
connected. Right? So you're connecting a model. We'll talk about that in the
model. We'll talk about that in the overall structure. But there are things
overall structure. But there are things appended to the message, right? So those
markdown files are attached to the messages that you actually send. So
we're actually going to take a look under the hood to see what actually gets sent off to the models. And there are tools that can be invoked. So if you send a message like search the latest news, it may use a search web tool. You
may need to connect an API key for that.
But you actually don't need that to just fetch some site for example that you don't need any API key for that. There's
a tool for that. You can even let it control a browser. Of course, one of the most powerful parts of OpenClaw is that it feels very proactive. It is proactive and it does it essentially with
so-called chron. They basically allow
so-called chron. They basically allow you to run something on a schedule. But
there's also the concept of heartbeats, which is also something that runs periodically. So, what's the difference
periodically. So, what's the difference between those and when to use one over the other? Now, if you're sending a
the other? Now, if you're sending a message and it's a big message with a lot of instructions, for example, on how to summarize the news for you, right? If
you're doing that over and over again, that's too much work. So you can package those instructions up in a skill and then you can give your agent access to the skill. We'll talk a little bit more
the skill. We'll talk a little bit more about what skills are, how they're structured, and there is actually a website or platform for them where you can find other ones as we'll also take a look at a an agent loop, right? So you
can send messages and ultimately receive a response. But what happens in between
a response. But what happens in between those steps? We're going to dive a
those steps? We're going to dive a little bit deeper into that. It doesn't
always start with your own messages because sometimes you've set up a chron task or there's a heartbeat. So an agent run is not only triggered by your actual messages. Sometimes it's triggered in
messages. Sometimes it's triggered in some other way. And there's the concept of sessions. So it deals with sessions
of sessions. So it deals with sessions in a certain manner. You can send a message over Telegram and it needs to keep track over what channel it needs to send back the response to. Maybe you've
also connected WhatsApp or Slack or Discord or some other channel. Maybe
you're in a group chat with people. It
actually keeps track of the transcripts of your conversations and we'll see how it does that. To really get the most out of OpenClaw, you actually want it to remember things about you. So, it has the concept of memory. It will keep
track of a daily log, but also you can store things for longerterm memory.
There are also some other tools for that to help you with that. And there are some tips and tricks that I think you should really know about to really get the most out of it. It's very easy.
There are some simple prompts essentially allow that allow you to make it useful very quickly. So, I recommend you watch all the way to the end to see those. And there are a couple of other
those. And there are a couple of other things as well. Uh there are plugins. Uh
you can have multi- aent setups. You may
want to give it a voice. So there's a bunch of other things that we'll take a look at the end. But these are the core concept. So let's go through them one by
concept. So let's go through them one by one. Let's start off with open class
one. Let's start off with open class place in the ecosystem. All right, let's start with number one here. What does
open class place in the whole ecosystem?
What exactly is it? What can we do with it? And how is it different from the
it? And how is it different from the other tools that you may have seen around? So, if we go to its website here
around? So, if we go to its website here on the homepage, it well, it starts off by mentioning emails and a calendar and doing things like check-ins for flight.
These are very typical personal AI assistant tasks. If you would hire a
assistant tasks. If you would hire a person to help you out in your day-to-day tasks, these are the types of tasks that you would come up with. And
typically, it is indeed done through a chat app like WhatsApp or Telegram, the ones that you're already using. So, it's
basically a personal assistant. All
right. Now, what are some actual common use cases? Well, a lot of people like
use cases? Well, a lot of people like having a morning brief delivered to them. So, when you wake up during
them. So, when you wake up during breakfast, you can check your chat app, you can see the things that are in your calendar for that day, some weather info, some news from your industry, and
it can even suggest some priorities for you that day. It can also monitor things for you. So, if it's monitoring your
for you. So, if it's monitoring your email and it sees something urgent, it can reach out to you, hey, there's something you should see, right? Or you
have a meeting coming up in your calendar or hey, your website is down, right? So, a lot of you actually have
right? So, a lot of you actually have websites or apps. For example, I run a website. So, I have bitegret.com. It's
website. So, I have bitegret.com. It's
an e-learning website. I had a Black Friday sale. Now, I've been a bit lazy
Friday sale. Now, I've been a bit lazy and I have not removed this yet. It's
been quite some time since Black Friday.
It's been months already. I could set it up so it would monitor my site and I could be very generic. I could say, "Hey, let me know if something is wrong with the website or if I should change something in the website." And I would
give it access to the code of the website either on my own computer on GitHub. and then it would probably
GitHub. and then it would probably notice at some point, hey, you still have this Black Friday sale thing. You
probably should remove it. A lot of people seem to use it for researching as well. And it can then automatically save
well. And it can then automatically save it to the workspace. I will talk about that. But it will then get added as
that. But it will then get added as context in your conversations. So then
it's already aware of the latest things going on in your industry. It can also control browser. So, if you wanted to
control browser. So, if you wanted to check portals or you want to fill in some kind of forms, I've actually been trying it to get it to download invoices because every month I need to collect
all my invoices for bookkeeping and I would really like to automate that. So,
this is for me personally an important one if you want to build up a personal knowledge base over time automatically from your conversations for example.
That's also a good one. The nice thing is it can do it through multiple channels. It doesn't have to be only
channels. It doesn't have to be only Telegram for example. It can be your other chat apps as well. Maybe you want to have other people be aware of it as well. Now, if you're in IT, there's a
well. Now, if you're in IT, there's a bunch of things for that as well, like logs, summarization, checking status of various apps or servers or other things, helping you with scripts. So, you could
say, "Hey, automatically suggest scripts for me that can automate parts of my workflow." And as it learns more about
workflow." And as it learns more about you, it can actually suggest certain scripts or other things that can help you out. Now, you can say, "I can
you out. Now, you can say, "I can already do some of those things with other AI chat apps." Of course, I can already chat with an AI and you will get some response in text, but that is often
a separate app and the experience in those apps is very tailored towards a question and then getting a response.
With open claw, the experience is more tailored around the proactiveness. The
idea is that over time you can automate tasks and it will automatic and it will proactively reach out to you when there is something. Technically, it may be
is something. Technically, it may be possible to set that up in other chat apps as well, but it's just not it's not tailored towards that experience. With
OpenClaw, it also has access to your computer. It of course, it depends on
computer. It of course, it depends on where you run it, but typically it has access to the things that are on the computer that you installed it. So, it's
it can simply do more things on your computer than other chat apps. Now,
there are some coding related agents that are released by some of those other providers and those can also do things on your computer, but I would say that's more geared towards developer coding use
cases and not like an AI assistant use case. You're often interacting with
case. You're often interacting with those through a terminal. With OpenClaw,
I'm interacting through WhatsApp or Telegram, for example. And there are also other tools for AI automation, but I would say those are also different.
They have a visual interface where you can connect nodes, for example. We have
to drag and drop nodes and connect them.
Those are also not really geared tailored to the chat or personal assistant workflow or or experience that Open Claw offers. And with Open Claw, I can describe in natural language something like I want to receive a
morning brief every morning on 10:00 a.m. and it will create an automation
a.m. and it will create an automation for that, right? With perhaps a Chrome task. Technically, I could do something
task. Technically, I could do something similar in the other AI automation apps because they also have like a chat sidebar. So, you don't have to manually
sidebar. So, you don't have to manually drag and drop notes anymore. You can
just describe in natural language what you want, but it's just a different experience. It's not tailored to the AI
experience. It's not tailored to the AI assistant that you would chat with in the chat apps that you're already using.
And with OpenClaw, I can self-host it.
It's open source. I can see what it's doing. I can run it where I want. And if
doing. I can run it where I want. And if
you really want to, you can change things. You can tinker around in it. And
things. You can tinker around in it. And
it's not a separate app, right? So, it
works in the apps you're already using.
And it has a more batteries included setup for the AI assistant, right? So,
there are some default tools out of the box. It has certain memory settings that
box. It has certain memory settings that makes sense for that. It deals with your uh sessions, your chats in a way. If you
have multi- agents, it has a way to route that. With OpenClaw, I can also
route that. With OpenClaw, I can also use the models I want to use. Whereas
with a different AI chat app, you may be locked to just the model provider offers. But with OpenClaw, I may want to
offers. But with OpenClaw, I may want to use a free model for a particular task, let's say, right? So, I can even use multiple models depending on the task.
So, you may want to have an entropic model as your default model. And then
for coding specific tasks, you may want to use codec. So if I had to summarize why it's different, well, it is more specifically tailored to the AI assistant experience. So yes,
assistant experience. So yes, technically you could set up other AI apps or automation uh services to to get similar results, but it's just easier
and more pleasant to do it with Open Claw. Also, I can use it in the apps
Claw. Also, I can use it in the apps that you're already using like Telegram, WhatsApp. I can use not only the models
WhatsApp. I can use not only the models that a that one specific provider offers. I can connect other models and I
offers. I can connect other models and I can self-host it. It's open source. I
can see under the hood what it's doing.
And you can even tinker with it to get exactly what you want. This gives it a unique place in the ecosystem. It will
allow it to defend itself from the other providers that may start offering something similar. All right. Now,
something similar. All right. Now,
before we continue, let's actually set up an open claw instance so we can see what we get. So, where should we run open claw? we could run it on our own
open claw? we could run it on our own computers and then it may have access to well pretty much anything on our computer. This is a bit risky because
computer. This is a bit risky because all of this is so new. Some of the security aspects still have to crystallize a bit over time before we know exactly what is perfectly safe and what isn't. So I do not recommend that
what isn't. So I do not recommend that you run it on your own computer at this at the time of recording. Ideally, we
can put it somewhere else as sort of like a sandbox so it does not automatically have access to everything on our computer. So what some people are doing is they're buying Mac Mini. So you
have like a physical manifestation of your AI assistant on your desk. I think
it's pretty cool, but it's so pricey and it can take some time before it arrives.
So before you order the Mac Mini, just try hosting it on a VPS. It's a really good experience. It's literally a few
good experience. It's literally a few minutes. It's so much cheaper. You can
minutes. It's so much cheaper. You can
always order the Mac Mini later. And the
VPS providers, they've made it a really good experience. So things like backups
good experience. So things like backups is only a few clicks. If you want to reset it, start over from scratch, it's a few clicks. It's a really good experience these days. So, I recommend starting with OpenClaw on a VPS. So, I'm
going to use Hostinger in the video.
Yes, they are today's sponsor. But one
of the reasons I like them is they already have this open claw app out of the box. So, you can go with a VPS plan
the box. So, you can go with a VPS plan and just start with Open Claw here out of the box. There's almost no setup and you'll be good to go. And by the way, the other benefit is it makes it very easy to host other things as well. Like
if you have an app, an XJS app that you want to host or you can host N8N or other services with, for example, Coolifi. So, there's a bunch of other
Coolifi. So, there's a bunch of other things you can host very easily with a VPS as well. So, they have a couple of different VPS plans. You can see that here on the VPS page as well. I will go
with the KVM 2 plan in this video. I've
had a good time using it. They have
great specs. If you already anticipate that you're going to need a little bit more, maybe you have other people connecting to it and or you have like heavier workloads, you can go with one of the more powerful plans here, but I
will go with KVM2. All right. So, I'm
going to go with the KVM2 plan. Now,
here on the checkout page, I would really appreciate it if you use my coupon code, which is all uppercase bytegrat. So, if you apply that, you can
bytegrat. So, if you apply that, you can get an even better price. So, that is all uppercase bitegrad. I would really appreciate it if you use my coupon code.
It's a lot of it takes a lot of time and energy to create these videos. They the
coupon code will work on both the 12 month and the 24 month plan. Right. So,
this is I think the quickest way to get started with Open Claw. You can just click on deploy here and you will go to the check out page here again and you will see something here with auto deploy
open claw app will be deployed after VPS is purchased. This is the fastest way
is purchased. This is the fastest way that I know to get started with right and then right make sure you don't forget about the coupon code all uppercase. This is the fastest way that
uppercase. This is the fastest way that I know about to get started with open claw and I've had a good experience with hosting. So if you just quickly want to
hosting. So if you just quickly want to get started with openclaw you can just use that default app they have out of the box. Now I will actually show you
the box. Now I will actually show you how to set it up from the terminal actually so you can get a little bit of intuition for what's happening under the hood. Um you can pick a daily auto
hood. Um you can pick a daily auto backup and a server location. And here
we can pick an operating system. Right.
So I'm going to go with a plain YUbuntu here just to show you here in the video how it's set up. If you just want to try out OpenClaw I would just recommend going with the app out of the box. But I
will go with this and let's go through the checkout. All right. So after the
the checkout. All right. So after the checkout we go through an onboarding process. So you can pick. So actually
process. So you can pick. So actually
you can also pick the settings here. I
will just go with the plain YUbuntu install. And you need to pick a password
install. And you need to pick a password that you will need if you want to log into the VPS. So make sure you don't forget it. All right. So here we have
forget it. All right. So here we have some additional features. I will leave it like this. And actually I will take the Docker manager as well. So this is a bit of a new feature here in Hostinger.
It allows you to easily deploy Docker based apps including Open Claw actually uh with almost no setup either. So
actually really nice feature. I'm going
to add it and then it's going to provision the resources. So we just have to wait a few minutes. All right. And
after a few minutes it's ready to go. So
let's go to manage VPS and here we have all of the settings for our VPS. Right?
So it has given us an IP address and we can get access to our VPS with this command. I'll show you that in a second.
command. I'll show you that in a second.
So we have a bunch of settings here. Now
one thing that I really like is they have this docker manager option. So I
just added that and they have a catalog here of all of these apps essentially that you can install on your VPS. And
one of those things is actually Open Claw. So you can actually also deploy it
Claw. So you can actually also deploy it from here in case you didn't do that yet. Right. So, this is the easiest way
yet. Right. So, this is the easiest way to get started with OpenClaw. Get a
hostinger VPS. Use coupon code bite grat all uppercase and the open claw app. But
I will show you in this video how to do it with terminal commands as well. And
by the way, I will go through it pretty quickly here with the VPS setup. I have
other dedicated videos just for the VPS setup. So, if you want to have a
setup. So, if you want to have a complete comprehensive tutorial on that, check out that. I just want to focus more on Open Claw, how it works, and what we get in this video. But,
nonetheless, I still want to show you how it's done on a VPS, right? And I do want to emphasize, by the way, everything that we're doing here is quite new. It's quite experimental. So I
quite new. It's quite experimental. So I
would treat it as an experiment at this point. Don't try to connect important
point. Don't try to connect important accounts, sensitive data. Just try it out first. And when you really know what
out first. And when you really know what you're doing and some of the security aspects have been uh crystallized out a little bit more, you can do more things.
So let's quickly go through it. So let's
copy this and let's open up our terminal app. So here on Mac, so here on Mac, I
app. So here on Mac, so here on Mac, I can search for terminal. On Windows, you can search for PowerShell. It should
work the same. should be the same commands. And what we can do here is
commands. And what we can do here is paste command they give us. This will
give us access to the VPS. So I will say yes here. And now we need that password
yes here. And now we need that password that we used to set up the VPS. So
hopefully you still remember it. Okay.
So I pasted it here. It won't show it, but I did paste it. All right. So then
we're in our VPS. You can see this has changed to this root thing. So the first thing I'll do is add a new user because typically we don't want to do anything.
We don't want to do everything as a root user. So we're going to create a new
user. So we're going to create a new one. I'm going to call this user admin
one. I'm going to call this user admin claw. And we need a password. I will be
claw. And we need a password. I will be a bit lazy here and use the same password as for the VPS. So just paste it here. It will ask for some details,
it here. It will ask for some details, but I will just leave all of these blank and just go ahead and press enter. So
then I'm going to make that new user like a an admin. So I can use a pseudo commands on the VPS. Basically give it some privileges. Okay. And then I will
some privileges. Okay. And then I will become that user. So I can do su-admin claw. And you will see now that this has
claw. And you will see now that this has changed again into into a green color here and then the name of the user. So I
can do something like who am I and it will show me the name. All right. So let
me clear here. All right. So now we actually want to install open claw. If
we go to the website, scroll down a little bit. There should be a command
little bit. There should be a command here. This works everywhere. Installs
here. This works everywhere. Installs
everything. You're welcome. Okay. Let's
put that to the test. I'm going to copy that and go ahead here and paste that here in the terminal. All right. So now
it runs the open claw installer. Now it
will need no jazz. So that is not installed here yet. So it will automatically try to install that. It
will need the password. So I just paste it as here. So it's now installing Node.js and also Git and npm. And now
it's going to install Open Claw itself.
All right. So after a few minutes it is installed. So may take a little bit of
installed. So may take a little bit of time but it did work for me. Now here it warns me about the path missing. So I
found that sometimes this could be an issue. It will say if you try to use the
issue. It will say if you try to use the open claw CLI it may not work but we'll check later if that's still necessary.
Now after installation it will automatically go through onboarding here. So we go through an onboarding
here. So we go through an onboarding process and actually quite responsible.
The first question is if you want to continue and the default option is no.
All of this is risky. Be careful with the things that you connect here. Be
careful with the accounts and the data that you connect. They have a must readad here about uh security. So if you copy that and I recommend that you go through it. It's a bit much to go
through it. It's a bit much to go through the video to discuss it here in the video. I will continue here. All
the video. I will continue here. All
right. So we'll go with the default option here. All right. So here it needs
option here. All right. So here it needs a model, right? We'll talk more about how it's structured in a second, but ultimately we need some kind of AI model to power the whole experience, right? To
to be like a to be like a brain of our setup here. So you can go with a lot of
setup here. So you can go with a lot of different options actually and you can actually also configure multiple providers, but in fact I will use OpenAI and I will go with the OpenAI API key option here. So here in the OpenAI
option here. So here in the OpenAI dashboard, I can go to API keys. I will
create it right here. I can go back to the onboarding here and I pasted it right there and pressed enter. So then
we can pick the model. So you do want to have one that's a bit powerful of course, but you do want to keep costs in in mind. Open Cloud does tend to send
in mind. Open Cloud does tend to send quite a few requests, the AI model. So
as a default model, I think you don't want to go with with one that's too that's too pricey.
If I'm price sensitive, I would probably still go GBT 4.1 first. But for the YouTube video here, I will go with GPT 5.2. All right. So then we can set up a
5.2. All right. So then we can set up a channel. So this allows us to send
channel. So this allows us to send messages through a chat app essentially through the gateway. We'll talk about what a gateway is, which in turn will send it off to the model that we just set up here. Right? So there's a certain
structure. We'll talk about it in a
structure. We'll talk about it in a second. But in this video, I will use
second. But in this video, I will use Telegram, but it works very similarly with the other options as well. So let
me quickly show you how to set up Telegram here. So it says open up
Telegram here. So it says open up Telegram and chat with this account at botfather. Basically setting up a bot on
botfather. Basically setting up a bot on telegram. So here in telegram I can go
telegram. So here in telegram I can go to apps and they have a web app. It's a
bit easier in my view. So I will use this web a and I have connected this to my phone. So there will be some QR code
my phone. So there will be some QR code that you can scan from your telegram app on your phone. So then you are seeing the telegram app like this. Now I need to chat with an account called
botfather. So if I open that up I can
botfather. So if I open that up I can click on start here. So here it says run / newbot. So we'll say newbot. I'll
/ newbot. So we'll say newbot. I'll
press enter. I need to give it a name.
So I will say openclaw_bot.
And then it wants a username. Okay. So
that's I guess I will just use the same.
Okay. So that's not possible.
YouTube bot. Let's see if that works.
Let's also take an openclaw oc YouTube bot. All right. So that works. It has
bot. All right. So that works. It has
created this bot for me and we can go there. So here there is the open claw
there. So here there is the open claw bot. Okay. But it will give you a token.
bot. Okay. But it will give you a token.
So if I click that and I go here, I can paste the token. Make sure you don't show these things to other people. We
want to keep it private. And so here we can see it has updated something here.
And so there's a certain folder structure here. We'll talk about that in
structure here. We'll talk about that in a second. Now we're not completely
a second. Now we're not completely finished here with the Telegram setup.
We have to do something called pairing as well. We'll do that in a second. So
as well. We'll do that in a second. So
now we can say skills. We'll talk about what skills are and when you would use it. I'm just going with the default
it. I'm just going with the default options here. We'll just use mpm. So, if
options here. We'll just use mpm. So, if
you're using any of these services, you may already want to select them. You can
press space to select them. However, I'm
just going to skip everything here. Do
we want to set Google API key? No.
Gemini for images perhaps. Right now,
no. Notion 11 Labs may be interesting for voice if you want to speak to your AI assistant. For now, we'll just skip
AI assistant. For now, we'll just skip everything. Hooks as well. We'll talk
everything. Hooks as well. We'll talk
more about what hooks are. Right. So,
now we can see onboarding complete. It
has written some other things here. Web
search. So, we can configure that. We'll
talk about it in a second as well. But
typically the the thing you want to do right now is go to the dashboard. So
there's a dashboard that you get out of the box. It has this address that says
the box. It has this address that says local host and it has a certain token in the URL as well. You do not want to show this to other people cuz then they may get access. Now if you try going to that
get access. Now if you try going to that address, if I copy that and paste that right here, it won't work because this is on my computer, but it's running on the VPS. So it says something here, open
the VPS. So it says something here, open from your computer, and it has this SSH command. So we can just try uh copying
command. So we can just try uh copying this and opening up a new terminal window. So, I'm leaving this one
window. So, I'm leaving this one running. Opening up a new window. So,
running. Opening up a new window. So,
this is a new terminal window or PowerShell if you're using Windows. If I
paste that right here, it does say something here about host. This needs to be the IP address of your VPS. So, if we go to hostinger here, you can see here we have an IP address. If I replace host here with the actual IP address and then
press enter. Okay, so we need to provide
press enter. Okay, so we need to provide the password again. So, I'll paste that right here. After pasting it, actually
right here. After pasting it, actually does not give me feedback here. But now
if you try copying the URL again including the token if we go there. So
make sure I know actually after you submit your password there's not any feedback and then a few minutes later we see something about connection reviews.
I've run into this issue before and it seems to be the so-called gateway is not running for some reason. Right? So we're
trying to connect to the gateway basically the app running on the VPS but it's not up and running here anymore for some reason. So if I Ctrl C out of here,
some reason. So if I Ctrl C out of here, I am now out of this. And if I try to do open claw-h, we have another issue where it says the command is not found. So
this goes back all the way to what we saw with that warning in the beginning about the path missing. So if I copy that issue, that warning and if I give it and if I give it to chat, it gives me
a command I can run. So if we paste this and now if I try open claw-h I can just do up and down arrow key and let's see what it works. Now you can see I'm actually getting a response here right
so now I'm able to use the open claw CLI. Now what we need to do is we need
CLI. Now what we need to do is we need to have that so-called gateway. We'll
talk about what that means. It needs to be running. So if I do open claw gateway
be running. So if I do open claw gateway they actually show it here as an example as well. You can apparently change the
as well. You can apparently change the port but if I just run this it should run the gateway again. Now you can see we are getting some logging here. We
don't need to do much with that. But it
should be running now. So now if we try connecting again. So if I clear out of
connecting again. So if I clear out of here, go up with my arrow key here. So
now if we try using that SSH command again, if you lost this command, you can actually also get it by here. If I stop it here, if you first do openclaw dashboard, you will see all of the
dashboard information again, including that SSH command. But I need to make sure the gateway is running. So I do open claw gateway. So now it's running again. Now I can copy this uh command
again. Now I can copy this uh command again, right? And paste it here and
again, right? And paste it here and press enter. Now it will ask me for
press enter. Now it will ask me for password again. I will paste it right
password again. I will paste it right here. So I'm not getting any feedback
here. So I'm not getting any feedback here, but it should still work. So now
if we try going to that address, I will copy the URL with the token. And if I paste it here in my browser, we have access to our dashboard. All right. So a
little bit of setup there. So it is probably a little bit easier to use Hostinger's default app out of the box.
Now at least it is working. Make sure
you don't show the URL with the token to other people. Right. So now we have
other people. Right. So now we have access to open claw running on the VPS through this dashboard here. And I can chat actually with it from here on. So
not just telegram or other chat apps also from this dashboard. We'll talk
about the overall structure of everything in a second. But if I say something like hi how are you? I get a response here. Right. So this is coming
response here. Right. So this is coming from the GPT model that I connected. So
we have an overview here with a bunch of settings. We'll talk more about all the
settings. We'll talk more about all the things that we can do here. But we're
not completely finished with the setup here. So, so it's a bit annoying that I
here. So, so it's a bit annoying that I have to keep this running otherwise I lose access. So, if I would uh close
lose access. So, if I would uh close here, Ctrl + C. Now, if I would refresh, I don't have access anymore. So, we're
going to run this as a background process. So, it will keep running. I
process. So, it will keep running. I
will do that with a utility called T-mok. So, it's a package here for
T-mok. So, it's a package here for YUbuntu. I'm first going to install. I'm
YUbuntu. I'm first going to install. I'm
first going to check for updates. I will
paste my password here once more. It's
going to update packages so that we can get the latest one. So then I can say pseudo app install yes we want t-mox. So
it's going to install that. Okay. So
with t-mox I can create like a session in the background. So I'm going to create a new one. I'm going to call it claw. And now we see this weird uh new
claw. And now we see this weird uh new view. And in here I'm going to run the
view. And in here I'm going to run the gateway. So do open claw gateway. So now
gateway. So do open claw gateway. So now
that is running again. And you can see actually the dashboard is working again.
So it is running but I want to close out of here. So I can do ctrlb and then d.
of here. So I can do ctrlb and then d.
And now I'm out of here. Right. So now I have control back over my terminal here.
I can even close out of here and if I refresh you can see it keeps running.
Okay. So we have this dashboard to chat but of course we want to chat through our actual Telegram or WhatsApp or whatever you're using. So we need to do one more thing here. So here I can go to the bot that we created and I do need to
start here first. We need to do some pairing as it's called. After a few seconds it should give you some kind of pairing code. So if we copy this
pairing code. So if we copy this actually we can copy this command. So we
can copy the command here. If we open up the terminal, we can run that with the code at the end. So also I will then paste that here at the end. And that
should be enough for telegram. So let's
see what happens. All right. So now it says approve telegram. So now if we say something like hi, how are you?
We should be able to get a response. All
right. So we can see it's typing here.
It may actually take some time in the beginning. All right. Actually, the
beginning. All right. Actually, the
first message for some reason it didn't succeed. I saw an error here in the
succeed. I saw an error here in the logs. If after a minute or so, you're
logs. If after a minute or so, you're not getting any response. Well, I tried again and now it seems to be working.
Not exactly sure why. But the nice thing is here in the dashboard under settings, you have all these logs. So, it does show you some things like if something goes wrong here, I can see probably something with the response back to
Telegram for some reason didn't work the first time, but now it works. So, if I ask what model are you, we can see it's typing here at the top as well. And
indeed, it is using GPT 5.2. Right. So
now I can chat on my phone in Telegram or WhatsApp or your other channels with the model that I connected here. So this
was a very quick setup here. Now let's
dive a little bit deeper into what we're getting here and how it's structured and what we can do with All right. So let's
talk about the overall structure here.
So the way I think about it is there is this gateway. This is what you're
this gateway. This is what you're essentially hosting somewhere. whether
it's on your own computer or on a Mac mini or on a VPS. This needs to be running somewhere. And then you have a
running somewhere. And then you have a so-called channel. So this can be a chat
so-called channel. So this can be a chat app, right? So I can send a message from
app, right? So I can send a message from Telegram. I can say what day is it
Telegram. I can say what day is it today, right? I send off a message here
today, right? I send off a message here that's going to this gateway here. And I
can also send messages from WhatsApp, right? So that's also going to the
right? So that's also going to the gateway, right? Or Slack or Discord. And
gateway, right? Or Slack or Discord. And
there are all these channels to send messages to the gateway. I guess that's why why it may be called a gateway, right? because it's sort of collecting
right? because it's sort of collecting all of the incoming messages from all these different channels into one place.
So there are all these different chat apps that you may already be using that you can use here. Now what you also get out of the box is this dashboard, right?
So I can also sort of connect to the gateway not only through this but also in this what they call control UI. This
can be a dashboard. I guess technically it's the terminal CLI as well. You can
also interact with the gateway, right?
So I have a dashboard here. So
basically, these are all the different doors into the same gateway, right? So I
guess that's technically why it may be called a gateway because it's sort of because it's sort of combining all of the different signals or messages into one place, right? So the way I think about it is it's basically a web server.
So if you're building an app, you probably need a server at some point so users can send requests and the server will then send a response. It's the same with the gateway, right? So if I send a message over Telegram like I just did,
we're sending the message here into the gateway and the gateway will send it along to an AI model that I connected right. So I connected OpenAI's GPT 5.2,
right. So I connected OpenAI's GPT 5.2, right? But you can actually also connect
right? But you can actually also connect other models like Opus, but you can also connect other models like Cloud Opus or Sonet by Entropic or you can connect Gemini by Google, right? So you can
decide which AI models you actually want to use. Now before it sends the message
to use. Now before it sends the message it actually does a few things. So what
you get with open claw is essentially an agent that is running here and when it receives a message from you over telegram for example it will actually inject some additional text into that
message before it sends it off to the AI models that you connected. And so it will inject the text that you have in these files which we'll talk more about in a second. So maybe you have some
instructions for how the agent should behave or its uh personality or when to pick a certain tool, right? So it
injects these into the conversation. So
it basically does some context management for you, right? And then it's sent off to the models. Now the models will eventually come with a response and the response may be to invoke a tool, right? So here with OpenCloud, the the
right? So here with OpenCloud, the the agent that we're running here in the agent runtime, it not only can inject context, but it can also run the tools here. So there is a read tool. It can
here. So there is a read tool. It can
read files that you have on the computer in which you're running. It can edit the files as well. It can run terminal commands on your computer. And there are some other built-in tools as well. And
once there is a result of calling that tool, it will send it back to the model.
Right? This is how an agent typically works. There's like a a tool calling
works. There's like a a tool calling loop. The result of calling the tool
loop. The result of calling the tool will be sent to the model again, the AI model, at which point it will send a response again. And there may be
response again. And there may be additional round trips like that. And
there are other tools as well like searching on the web or controlling a browser even right so it's the AI model that decides to actually invoke a tool but the tools themselves are executed
here on the gateway and you can also have skills the AI model may want to load the skill which is also basically a bunch of context into the conversation.
So you may have some skill about how it should review code right so you can save skills in here as well and actually skills are part of the system prompt that it injects. So when you send a
message, it not only injects these files, it actually also injects a system, right? So this is a more general
system, right? So this is a more general prompt and we'll talk more about it in a second, but that is also injected before it's it gets sent to the AI model. We'll
take a look at what's exactly in the system prompt later, but it will contain things like the tools that are available, the skills that are available, some workspace information, even some instructions for itself on how
to update things, right? So you can see it's doing quite a few things here when it starts interacting with the AI model for you. Right? You can also imagine
for you. Right? You can also imagine that you have follow-up questions or messages to the model. In that case, it needs to make sure that to attach the previous messages as well. So the AI model gets the complete conversation
history, right? So there's a bunch of
history, right? So there's a bunch of context management and other things that it's already doing when you're just sending simple messages even from your chat apps. And so it's basically running
chat apps. And so it's basically running an agent here, an agent runtime, right?
And this allows you to do not only chatting but also doing things like coding, right? Because coding, what does
coding, right? Because coding, what does it do? It basically has to read, right?
it do? It basically has to read, right?
Because an app is just a bunch of files essentially. So as long as it can read
essentially. So as long as it can read files and also edit them, it can build apps. This allows you not only to chat
apps. This allows you not only to chat but do pretty sophisticated things just with running an agent runtime. And this
is derived from something called pi mono. There is a certain underlying
mono. There is a certain underlying structure for running an agent. That's
what they picked. Okay. So ultimately it has processed uh the complete response from the AI model and now of course we at some point also want to see something in our own chat apps right so I sent off
a message a few minutes ago I said hey hi what day is it today it's gone through that entire uh loop here essentially and ultimately well it's just a simple response here we don't
have to it didn't have to do much ultimately it's sent back a response here to my telegram channel this also involves some logic because it needs to know what channel to respond to it needs
to make sure the routing here happens properly. So, right, if I have a group
properly. So, right, if I have a group chat, I don't want to see messages from the other channels, right? So, all of these channels uh a proper response here. There is something with session
here. There is something with session management as well. We'll talk more about all of this later, but there is also something with session management here that's happening in this gateway that we're hosting. Since we can send these messages from all these different
platforms, you can imagine it needs to normalize the structure of that data into a common structure and then respond back to it in a certain way as well. So
it needs to keep track of the conversations that you have the session.
It also needs to have access to these files or injecting that into the context. There's a bunch of things that
context. There's a bunch of things that it needs to keep track of. So there is a certain folder structure that you get out of the box, right? So for example, I actually connected OpenAI with with an API key, right? And so it needs to store
that somewhere the API key there are two uh folders I guess. So by default uh you get this openclaw directory in your home directory right so this still sign is
basically your user right so you can imagine that it's something like this right so on your computer wherever you host it would be something like this so in this one it has the more you could
say sensitive data this is more like app data or state right and there's a period in front because a hidden folder and this first one here is the more sensitive one so it has things credentials right so I connected OpenAI
here with an API key. So that is stored here in credentials and there's also some general config. So there is an openclaw.json
openclaw.json file which has configuration about how open clause should behave and actually your conversation transcript your session transcripts are stored in here as well. So you want to be a bit careful
as well. So you want to be a bit careful with this folder. Now there is one folder inside of here simply workspace.
So this is a well sort of a nested folder in here. This one is recommended that you can commit in git, right? I
could perhaps back this up. Well, here
we have all of these files, right? So,
agents.m MD. So, we have those context file. There's also some memory related
file. There's also some memory related files like a daily log. We'll talk more about memory a bit later. And this is actually used as the the current working directory. When running tools, for
directory. When running tools, for example, it happens with this folder as the current working directory. And the
current working directory is relevant for example the path, right? So, if a tool is invoked and it uses a relative path, this is the uh working directory that will be used for that. Now
technically it's still able to reach outside of this as well. For example, in this folder. So it's not a hard sandbox,
this folder. So it's not a hard sandbox, right? A tool could use an absolute path
right? A tool could use an absolute path for example. Typically this is where the
for example. Typically this is where the agent will do things. This is where it's creating new files as well. If you ask it to create a script, right? Or other
artifacts. It will create them and put them in here. But this one is typically recommended that you commit in git and uh maybe use a private git to back up the things that you have in here. But
this folder typically not because I don't want to for example commit my API keys, right? So you have to be a bit
keys, right? So you have to be a bit careful with this folder. But this one typically contains more things that you would want to store over time. Now I
said when we send a message, the agent will start running and it will go through like a a loop here perhaps if there are tools. Ultimately it will send a response back to the channel that you send the message from. But the agent can
also start running in some other scenario. For example, if you've set up
scenario. For example, if you've set up a chron job or there's also the concept of a heartbeat, right? If we send a message like every morning 8:00 a.m.
send me the latest tech news, it's going to create a chrome task and at 8:00 a.m.
once a day, it will also kick off a an agent run like that. Depending on
exactly what the chrome task should do, it may not even respond. So, if it's a chrome task or a heartbeat, the result is that you should not be bothered. It
will simply not send a message back, right? So, it does not always send a
right? So, it does not always send a message back. It depends on what you
message back. It depends on what you want it to do, right? And sometimes it will send you a message without you having specifically prompted for it, right? Because if it's once a day on 8
right? Because if it's once a day on 8 a.m., it will start sending you a
a.m., it will start sending you a message every day. Even though I didn't prompt specifically for it, that's why it's so powerful because it can feel very because it can be like proactive, right? As long as you've set it up once
right? As long as you've set it up once over time, it can remain more proactive like that, right? So, we can also set up more like automation tasks with this.
So, that is the highle overview here for the most part. So this gateway needs to be always running. If you shut it off, this the messages won't work anymore. Uh
if you set up chrome tasks, they won't work anymore. So this is designed to
work anymore. So this is designed to always be on, right? So as long as we have this gateway running, we can do pretty much anything we want, right? So
of course there are some other things as well. There are other channels. There's
well. There are other channels. There's
also the concept of nodes. So you can actually allow it to control like a camera on your phone. So there are some more advanced things we can do, but for now, I think this is a good overview.
Now, by the way, before we continue, if you quickly want to try it out yourself, you can start with Open Claw on a VPS by Hostinger with the link in the description. Make sure to use coupon
description. Make sure to use coupon code buy to grant all uppercase. I would
really appreciate it. So, if you just quickly want to try it out, go ahead yourself. You can pause the video. You
yourself. You can pause the video. You
can always come back later and see if you like it. All right, let's continue with the workspace here. We already saw it a little bit in the overall architecture. So, if we go back to that
architecture. So, if we go back to that on the gateway, wherever you're running the gateway, you're going to have two folders. So there will be an open claw
folders. So there will be an open claw folder itself with things like credentials and some configuration and transcripts of our sessions. But in
there will be a workspace folder. So
that's this one. Well, what open clock calls the agent's home. It's the only working directory used for file tools and workspace context. The workspace is
the default current working directory, but it's not a hard sandbox. tools
resolve relative paths against the workspace, but absolute paths can still reach elsewhere on the host unless sandboxing is enabled. Right? The
default location is here. So
technically, you could change it. And
there are basically two big jobs that we do with the workspace here. So the first one is that it's the brain on the disk.
We specify things like the soul.md,
right? So we have all of these files, agents.md, user.mmd, we have all of
agents.md, user.mmd, we have all of those files in there. When we start a new session, Open Claw will inject those files into the conversation. The
responses are shaped by that and we can just change those files. So we can do that from the dashboard even. So we
don't have to do anything complicated.
And the other thing is that it's a well you could say working directory. So if
it's creating something, if it's writing a file, for example, you ask it to create a script, right? So when it produces something, when it produces an artifact, it's going to create it and put it in there, right? So then
typically you will get a real file and you can open a real file right so that's the second thing but I would say mostly most of the time you are going to be interested in changing these files like
agents.mmd etc. Now you can find those
agents.mmd etc. Now you can find those files here in the dashboard as well. So
if you open up the dashboard gateway dashboard here under agents we have one agent enabled and here there's an overview by default and then we see files. So this agent has access to these
files. So this agent has access to these files and we can see workspace here is indeed that till they sign right. So
here it's written as home admin claw.
This is the user I created on the VPS and then we have openclaw workspace right and it's literally files right. So
here we have agents.md for example. So
this is injected when you send a message when you have a new session and you inject it when you have a new session it's going to be injected and this will be sent along to the model. And what is it doing here? Well, it's specifying
first of all, read the sole MD. This is
who you are. Read then user ID. This is
who you're helping, right? Reading the
daily log, right? So, we'll talk more about memory in a second. And also read memory.m MD. This is more like longer
memory.m MD. This is more like longer term memory. We'll talk more about
term memory. We'll talk more about memory in a second. So, it's basically just giving some instructions to the assistant. It's talking more about
assistant. It's talking more about memory here. You wake up fresh each
memory here. You wake up fresh each session. So, what does that mean, by the
session. So, what does that mean, by the way, each session? Well, when you're chatting with your assistant, you can do forward slash new. This starts a new session, a fresh session. Or if you're just starting from the first time in
your channel, that's that's also going to be a new session. It would be a bit annoying if every session it it's going to ask us again like where do you live?
Facts like where you live, we can just store that in memory. By default, it will keep track of some daily things, but then longer term it has memory. MD.
This is more longterm. Okay, we're
specifying up front in the first session that we want to store things in there.
Here it has more information about memory. So here it's telling the model
memory. So here it's telling the model when when somebody says remember this update well the daily memory file, right? Or relevant file, right? When you
right? Or relevant file, right? When you
learn a lesson, it needs to update agents.md and tools.m MD or the relevant
agents.md and tools.m MD or the relevant skill, right? Now, how can it change
skill, right? Now, how can it change these files? Well, it's because we have
these files? Well, it's because we have a tool, right? It can edit files. These
are just files that can be edited. So
the AI model can choose to invoke the edit tool. Now how can it change those
edit tool. Now how can it change those files? Well, remember the agent has
files? Well, remember the agent has access to an edit tool here in the gateway. So if the model decides we
gateway. So if the model decides we should invoke an edit tool to change those files, it can just change agents.m
MD. That's just a markdown file. Same
with the daily memory log. And here it says you can read, edit, and update memory.m MD freely in main sessions. So
memory.m MD freely in main sessions. So
it makes a bit of a distinction between main sessions and other types of sessions because I could also be in a different chat with with for example a group of people create group chats
sessions with other people but we only load the memory file in main sessions and it says that's a direct chat with the with your human which is going to be us. Okay, it has a so basically just
us. Okay, it has a so basically just giving some instructions on how the agent should behave about memory but some other things here as well. So it
has some safety instructions very good.
Of course it also says you can do these things. So save to do freely are read
things. So save to do freely are read files, search the web and work within this workspace. But for some things it
this workspace. But for some things it should ask us the human firsts like sending emails or anything that leaves the machine. Anything that you're
the machine. Anything that you're uncertain about. Something about group
uncertain about. Something about group chats here. You have access to the
chats here. You have access to the human's stuff. That does not mean you
human's stuff. That does not mean you share their stuff. In groups you're a participant. Think before you speak. In
participant. Think before you speak. In
group chats when you receive every message be smart about when to contribute. Respond when directly
contribute. Respond when directly mentioned or asked a question. Right?
Otherwise stay silent. Right? So there's
a bunch of instructions here that improve the whole interaction that you as a human have with the agents here.
Something about tools formatting as well because it can look different depending on which chat app you use. So it needs to read the heartbeat MD file. Heartbeat
versus cron. We'll talk more about this later. Here it says proactive work you
later. Here it says proactive work you can do without asking. Read and organize memory files. Check on projects the git
memory files. Check on projects the git stat. Right. So if you're coding an app,
stat. Right. So if you're coding an app, update documentation. Commit and push
update documentation. Commit and push your own changes. Okay. something more
about memory, right? So very importantly because it by default it seems to store more in daily logs but then sometimes periodically every few days use a heartbeat to identify significant
events, lessons or insights worth keeping longterm and then updating the memory MD file with that. Right? Also
removing outdated info okay so this is a starting point. Add your own
starting point. Add your own conventions, styles and rules as you figure out what works. Right? So that's
a really important file actually.
agents.mmd it's uh pretty big 7.7 kilobytes compared to the other ones it's the biggest if you update it by the way and you save probably best to start a new session again so that uh the files
are injected again the updated files so agents.mmd is uh a good place for rules
agents.mmd is uh a good place for rules priorities how to behave okay so then we have soulm the persona the tone the boundaries and if we take a look here by default this is what we have uh you're
not a chatbot you're becoming someone so really trying to make it Will human core truths be genuinely helpful? Not skip
the great question and I'd be happy to help. Just help. Okay. So, uh basically
help. Just help. Okay. So, uh basically no, we don't want filler words. Have
opinions. Be right. So, things like uh be resourceful, earn trust through competence. Remember boundaries, private
competence. Remember boundaries, private things stay private, vibe, continuity.
We also said this file is yours to evolve. So, the agent is actually able
evolve. So, the agent is actually able to change these files. If you've put a lot of work in them, then it makes sense to create a backup out of these as well, right? So, it's actually recommended
right? So, it's actually recommended that the workspace folder itself that you commit this into git. You can create a private git repo and just uh periodically commit so that you have
like a backup. Okay. So, we have uh user.md. So, this is uh us, right? So,
user.md. So, this is uh us, right? So,
we can give the assistant some additional information about us. By
default, this is empty. We we have an identity file as well. So this is more for the assistant. So we can give it uh a name even an avatar and some emoji.
Basically creating an identity for your assistant. We have tools.m MD to provide
assistant. We have tools.m MD to provide some guidance on when to use uh tools.
And let's see which one bootstrap.md.
This is the first time. This is added on the first time. So if it's a new session, you may have specific things you want to add here. And then we have heartbeat.md.
heartbeat.md.
So by default there is actually I believe every 30 minutes it's going to make an actual API call to your AI model. So every 30 minutes I believe
model. So every 30 minutes I believe it's every 30 minutes by default you can change it but it will check the heartbeat.md file and if you have a task
heartbeat.md file and if you have a task like notify me if there is an important email it will send a message to the model that you connected may decide to
invoke tools to read your emails or a list of emails new emails. The model can make a decision. Should we notify the human you or not? If it needs to notify you, it can just reach out to you. This
heartbeat, the way I think of it is basically like a default chrome uh task out of the box. It's a little bit differently, but it has some uh overlap.
Now, by default, actually, it's an empty file. And if it's an empty file, it will
file. And if it's an empty file, it will skip heartbeat API call or there are only comments, which is the case here.
We only have comments. It's not going to make an API call to your AI models. So,
you shouldn't be spending any money.
Otherwise, you can add something here and it will check for that every so many minutes which you can configure. And we
actually don't have a memory MD file yet. I've just created this open claw
yet. I've just created this open claw instance. So, it hasn't saved anything
instance. So, it hasn't saved anything to memory yet. But if you do change one of these files, probably best to save it and then just start a new session in your chat app to make sure it's injected again in in the new session. Right. And
by the way, we can also see those f files here in the terminal. So, I could just check for what it what files do we have in that openclaw workspace folder.
And we can see indeed we have agents.mmd
uh we have all of those files right that we just saw. So you can so if you prefer working in the terminal we can view that but but it's also nice to have uh this right here in the UI. Now these are the
files but there are some other things in here as well. There's actually also skills. So if we take a look at skills
skills. So if we take a look at skills there are actually some built-in skills and it says all skills are enabled actually. So by default these skills are
actually. So by default these skills are all enabled. We'll talk more about
all enabled. We'll talk more about skills, but it's basically additional context that an agent may want to get access to. So, if you want to download
access to. So, if you want to download something from Claw Hub, there are basically some helpful instructions or things to know for the agent that it may want to load into the context before it actually starts downloading things from
Claw. Right? If you're generating images
Claw. Right? If you're generating images with Nana Banana, that may be helpful as well. But in this case, I would need
well. But in this case, I would need some API key. And actually, you can see a lot of these skills are blocked probably because it needs something in order to use. You can see some of them are actually eligible but uh they probably require some more setup but
we'll talk more about skills in a second. Right. So in our open claw
second. Right. So in our open claw instance we have a one agent. It has
access to these files and these skills in that workspace. Now there are some other things as well not necessarily related to the workspace but for example the tools that this particular agent has
access to cuz technically you could have multiple agents and they may need access to different types of tools. We can see here there are a bunch of tools. We'll
talk more about tools the channels as well. So we have only connected one
well. So we have only connected one channel the telegram channel and the chron jobs. We haven't created any chron
chron jobs. We haven't created any chron jobs yet. But in terms of the workspace
jobs yet. But in terms of the workspace most of the time you'll be interested in these files here. So just to show you what happens if you try to create some kind of artifact is a fancy word but basically if you would create an app for
example it needs to what an app is basically just a bunch of files. It
needs to put those files somewhere. So
it's going to put it in that working directory. Right? So if I ask it can you
directory. Right? So if I ask it can you create a simple HTML app just an index.html HTML file, right? We can make it a react app or next.js app which is just more files. But just to show you
what would happen if I say this. So now
it's finished and you can see now it has created a an index.html file in that uh directory. Right? So open claw workspace
directory. Right? So open claw workspace index.html, right? And just to prove you
index.html, right? And just to prove you that the file exists, if we list the files again in that workspace, we can see now there is also an index.html file. And by the way, you can also check
file. And by the way, you can also check if it created a file like that in the dashboard. Here under chat, you can see
dashboard. Here under chat, you can see there's actually it actually gives us some more information under the hood of what it did. So you can see I asked it on Telegram. I sent that message, but we
on Telegram. I sent that message, but we can still see that here in chat. So it
displays like the main chat in here and it we can see that the assistant invoked the right tool. So it created a file. It
wrote index.html in that workspace folder. And we can see here uh that it
folder. And we can see here uh that it was successful. So if we click on that,
was successful. So if we click on that, right? So this is the tool output. So
right? So this is the tool output. So
you get more tool information in the dashboard. Of course, we're not if
dashboard. Of course, we're not if you're just chatting with an assistant, you typically don't need to see that. So
here in Telegraph, I don't see it. But
to actually see the HTML like render it in a browser and see an actual UI, it would require a little bit more work here. We would have to forward some
here. We would have to forward some other things as well. So we'll do that a different time. So that is in a nutshell
different time. So that is in a nutshell how the workspace folder works. Let's
continue now. All right, let's continue with the context. when you send a message over any of these channels into the gateway before it passes it off to the model, it's going to add a bunch of
things to there. So, we can read that here actually. So, context is everything
here actually. So, context is everything that Open Claw sends to the model for a run. And these models, they have context
run. And these models, they have context windows. So, there's only so many tokens
windows. So, there's only so many tokens that you can fit in there. By default,
it comes with a system prompt. So by
default open club will add a system prompt which contains rules tools skills some time runtime and injected workspace files. Here under system prompt we can
files. Here under system prompt we can read a little bit more about it. So it
has a certain structure. So it's going to include the tools so that the model knows which tools it may be able to invoke. Uh something about uh safety a
invoke. Uh something about uh safety a short guardrail reminder to avoid power seeking behavior or bypassing oversight.
skills if they are available and let's see some uh workspace information documentation so it may want to read up on openclaw docs and then also those workspace files right so those are the
files that we talked about agents.mmd
soul.md those are injected as well some other information so that is part of the that's part of the the prompt that goes to the models right so it's not only your message there's a bunch of things
added to there that's only the system prompt but if you already have a conversation history. The previous
conversation history. The previous messages are also going to be sent along including the uh responses from before and also the tool calls if the model decided to invoke tools before the
results of those are also going to be included as well. Right now context is not the same as memory. So memory can be stored on disk and reloaded later.
Context is just what you're used to as context. It's just part of the the
context. It's just part of the the conversation essentially the current window. So if I go to my uh chat here
window. So if I go to my uh chat here with my open claw assistant, if I do forward slash new there are these slash commands, it will start a new session.
So at the beginning of a session, it's going to inject the system prompt including those uh files. So if you just change something in those files like so MD and you may want to run forward/ new to have like a fresh uh start again. Now
as you chat you can also do forward/context. This will give you some
forward/context. This will give you some information about the current context.
So actually it will show you what you can do. So you can do list and we can
can do. So you can do list and we can get more details if we want. So let's
actually try list. So if I do context list, you can see it breaks down the current contact. So here it says the
current contact. So here it says the system prompt is you know pretty uh significant here. It has injected these
significant here. It has injected these workspace files. So all of those files
workspace files. So all of those files that we just discussed a skills list. So
we can see the skills that are included here, the tools as well. So it has access to these tools and the session tokens. Okay. Now if we want more
tokens. Okay. Now if we want more details, we can also do context detail.
In that case we get something similar but we can see something more. So here
the top the tools and their schema size and the top tools the text size. So we
get a little bit more information here mostly about tools it seems. We can also do forward/ usage tokens. So now if you send a message what is oneplus 1 it will
show you the tokens that were used under each normal reply. Now if you have a very long conversation at some point you can compact it as well. So basically
summarize the previous messages. So we
can make the context window a little bit more efficient, a little bit more compact and this is done automatically actually but you can also do it manually with / compact. So it says here every model has a context window that's the
max tokens it can see and once the window is tight open clock compacts all the history to stay within limit. So
it's going to summarize all the conversation into a compact summary entry and keeps recent messages intact.
The summary is then stored in the session history. So then the future
session history. So then the future requests use that summary. So autoco
compaction by default is on but you can also do it manually with forward/compact. All right let's talk
forward/compact. All right let's talk about tools. So by default we actually
about tools. So by default we actually saw that it has access to a bunch of tools. So it can read and edit right. So
tools. So it can read and edit right. So
it showed that here when we asked for its context and you can actually also see that here in the dashboard. If you
go to agents, you can see that for this particular agent, it has access to these tools. And you can configure whether it
tools. And you can configure whether it should have access to certain tools or not from here as well. So you can even disable all of them in one go. But by
default, we can see it can do read, write, edit, and patch files. It can
execute shell commands, manage background processes. Here for web, it's
background processes. Here for web, it's quite interesting cuz often to do something useful, it needs to go out on the web. And there are two tools for
the web. And there are two tools for that actually. So web search and web
that actually. So web search and web fetch. So by default web fetch does not
fetch. So by default web fetch does not need an API key. So if I ask it can you fetch the bytegrass home page. It should
be able to just fetch basically just make a plain call to that page it's going to see some HTML and we can even see what it's going to do under the hood in the dashboard as well. So if I open
up the chat here in a different tab it's already generating a response here but before it did that it already is showing us that it used the web fetch tool right. So it will show tool behavior
right. So it will show tool behavior here in the actual open cloud dashboard.
It won't show you that in the actual channel. So here in the actual channel
channel. So here in the actual channel on telegram we are just getting that the final uh response from the model. So
that works out of the box. But if you want to search on the web, this one does need an API key. So if I say can you search the web for by grat it's responding that it can do that. But web
search is not configured. It needs by default the brave search API key. So,
Brave Search is the default provider for that web search tool. So, we can create an account here on brave.com and we can get an API key. Now, once you have the API key to actually set it, you can go
to settings config here in the dashboard. And here there's an option
dashboard. And here there's an option for web. And here in the config, if you
for web. And here in the config, if you search for Brave, you'll find a a form here where we can specify the API key.
Actually, we can pick the web search provider. You can also use perplexity.
provider. You can also use perplexity.
So, here for perplexity, then we can specify the API key. But if you're using brave here, you can specify that right here. And then there are actually some
here. And then there are actually some other settings here as well. There are
some other tools. I will talk about memory in a second, but it can search the existing memory as well as get particular memory files. It can do things with sessions and also with UI.
So actually it can control a browser as well. So if you want to do some kind of
well. So if you want to do some kind of browser automation, that should technically be possible. Now it depends a little bit on where you're running it.
So here on a VPS where I'm running it right now, there's no window like there's no UI or window. So it would run like a headless actually it can run its own uh windows. So that would be separate from your own existing windows
right? So imagine on your own computer
right? So imagine on your own computer you already have a browser it can just create a new window and control that.
Now actually you can take it a step further. There is also a Chrome
further. There is also a Chrome extension and this lets it control an existing Chrome tab. So you can do all sorts of browser related tasks. So you
can work with tabs and snapshots and screenshots navigation clicking typing. Typically, it will be useful for
typing. Typically, it will be useful for more like JavaScript heavy website where a simple fetch call won't help you much because it needs to actually render the JavaScript in order to be useful. It
should be able to display the screenshots in the chat inside the dashboard here as well. So, it may not show it in the actual channel but behind the scenes in the dashboard. All right.
So there's also the concept of chron tasks and heartbeats and these are one of the most powerful features in open clock because this is what makes your AI assistant feel proactive that it can
proactively reach out to you even if you didn't just send a prompt to it because previously you have already set up something or in the case of a heartbeat there is by default a so-called heartbeat and it can also reach out to
you if it needs your attention. So we'll
talk about the differences but what is a chron job? So if you want to do
chron job? So if you want to do something on a schedule every morning, send me a daily brief with some info the news. Typically that's going to be a
news. Typically that's going to be a chron job. It can automatically be
chron job. It can automatically be created for you. So if you say something like send me a brief of latest tech news, it should pick up on the fact that you want to do something on a schedule and it should create a chron job for
you. All right, so I'm getting a
you. All right, so I'm getting a question here and I'll just say yes, sure, that time zone and I just want to get the top headlines and a brief outline. All right, now it's still
outline. All right, now it's still working here. But if I go to the chat
working here. But if I go to the chat here in the open cloud dashboard, you can see some of the things that are going on behind the scenes. Right? So I
said this uh message is what I sent and now you can see it has used a tool the chron tool and specifically it has done the add command. So here we can see some other information here right and then
ultimately it has finished that. Now we
should be able to see that here in the dashboard as well. So if we go to chron jobs we can see there is one job and if we scroll down we can see more information about it. It has come up with a prompt. So every morning
automatically send this prompt to the AI model that you connected. Right? So if
we take a look at the diagram again. So
previously we saw that you had to send a message yourself over telegram and then it would send that to an AI model. But a
chrome job or heartbeat it will send it by by itself right so and this will be the prompt that it sends to there right so the prompt there's still a user message in the API call being made but
that user message is now created by open claw with that prompt that we saw from the chrome job. So it's not coming from a prompt that you wrote yourself manually in telegram for example and the
AI model may then want to invoke tools right gets a response back again. So
that whole back and forth is not only triggered from you actively sending prompts you can set up a chron job and you can trigger agent turned. So this is sent to the model and we can see there's
some information how often we can actually run it right now. So let's
actually run it and just see what happens. Right. So this is an API call
happens. Right. So this is an API call to the models. Right. All right. So I
happen to run into an issue because I haven't specified the brave search API key. Right? So what we talked about with
key. Right? So what we talked about with enabling the web search tool which would be which it would try to use in a chron job like that. But you can see we were able to trigger it at least and it has
some information here how to enable that but we we've seen it before. So with a chron job ultimately you do expect to get a message right because a morning brief ultimately the result of that agent turn I want to be I want to wake
up in the morning and have that ready to go in my telegram here right so with a chron job typically you expect some output now there's also the concept of a heartbeat and some people are actually a bit confused what's the difference but
with a heartbeat the way I think of it it's basically a chron job that you get out of the box with open claw so by default every I believe it's 30 minutes
openclaw will and a message to the AI models. Uh, typically it's for checking
models. Uh, typically it's for checking something. You could have something
something. You could have something like, please notify me. I received an email from an important client that I have, right? So, every 30 minutes,
have, right? So, every 30 minutes, OpenClaw would send an API call to the AI model that you connected with that as the user message. In that case, the AI model may decide, hey, we need to check the email, right? So, there may be some
read email tool. Maybe you connected Gmail, for example, right? And based on that, it can check if it should notify you. So if there was an important email
you. So if there was an important email from a client then again you want to be notified but very often there's not going to be an important email. So then
you do not want to be bothered right so you do not want to be disturbed in that case. So with a heartbeat it's more
case. So with a heartbeat it's more common that you are actually right at the end of the agent turn here that you are not disturbed actually. So it may actually not send you a message. So
another example of crunch would be every Friday at 5:00 summarize what we did this week right and it would send you the message basically like a scheduled task and you typically expect some kind of output and to be received somewhere
with a heartbeat it's more like quiet monitoring so typically you'll be use it to monitor something and if something needs your attention it can reach out to you right so you could say something like if we have a meeting starting
within uh 30 minutes notify me so we saw an example of the chron job how we can set it up you just well you have a task and it will automatically pick up on the fact that it should be a chron job. With
heartbeat, it's a bit different. So,
this actually one of those files that we discussed previously. There's also a
discussed previously. There's also a heartbeat file and we can see that here in the dashboard as well. So, if we go to agents and then the main agent here under files, we have those files and one
of them is actually this heartbeat file.
So, by default, this is empty or it has these uh comments. Now, if it's empty or has only comments, it's not going to make an API call to the API models from my understanding, right? because it says
here, keep this file empty or only with comments to skip heartbeat API calls.
Okay, so if I would add a task here like check my email for important client emails, right? Something like this. Now,
emails, right? Something like this. Now,
every uh 30 minutes, it's going to make an actual API call to these AI models, right? And it will have this as one of
right? And it will have this as one of those tasks, right? Checking something
periodically. And you can add other tasks in here as well. And then it should batch that into the same API call. The user message that's being sent
call. The user message that's being sent to the AI model with a heartbeat is not coming from your own prompt. It's
something that OpenClaw put together, right? So here in agents.m MD, it also
right? So here in agents.m MD, it also has some instructions on how to deal with heartbeats. Right? So this will be
with heartbeats. Right? So this will be part of the message going to the AI model. Here it has something else. Stay
model. Here it has something else. Stay
silent. Heartbeat okay when. And so here it says heartbeats be proactive when you receive a heartbeat poll. Basically a
message. Don't just reply with heartbeat okay every time. If it's going to do a check and the AI model finds out, oh, there's no important email. There's
nothing to notify the user. it should
reply with just heartbeat. Okay, that's
what's being specified by OpenClaw in the prompt as well. So, as soon as OpenClaw receives a message back with heartbeat okay, depending on the structure of the message it gets back, it will decide whether to bother you or
not. Typically, not because there's
not. Typically, not because there's heartbeat okay in the final answer from the AI model, but it's telling the AI model, hey, read heartbeat MD if it exists. Follow it strictly. If nothing
exists. Follow it strictly. If nothing
needs attention, reply heartbeat okay.
It can actually edit that heartbeat file for you as well. So you can also say something like from our conversation come up with a useful heartbeat. So
here's a heartbeat runs periodic agent turns in the main session. So an agent turn my assumption is that they just mean like an agent loop here with what they may call tools and ultimately the
agent come up with like a final answer in the main session. So my telegram conversation here should be the main session. The default is actually 30
session. The default is actually 30 minutes in most cases. What the
heartbeat prompt is for background tasks. So consider outstanding task.
tasks. So consider outstanding task.
Then it may nudge the agent to review follow-ups like check your email inbox or a calendar reminders and surface anything to you that may be urgent. But
if nothing is urgent, nothing is wrong, it may actually decide not to produce any output for you, right? A heartbeat.
Okay. And it can also check in on you.
Check up sometimes on your human during daytime, not just as an occasional lightweight, anything you need, but avoid nighttime spam. During the
heartbeat, OpenClot treats heartbeat.
Okay. if if it gets back the response from the AI model as an acknowledgement when it appears at the start or end of the reply. Heartbeats run in the agent's
the reply. Heartbeats run in the agent's main session by default. So, I'm only running one session here on the Telegram, so that should be my main session, but if you have multiple
channels, that may be different. Here's
an example. Heartbeat. So, checklist,
quick scan, anything urgent in the inboxes. If it's daytime, do a
inboxes. If it's daytime, do a lightweight check-in. If nothing else is
lightweight check-in. If nothing else is pending, if a task is blocked, write down what is missing and ask Peter next time. Right? So little things like that.
time. Right? So little things like that.
And the agent can also update the heartbeat.mmd file. So you can just ask
heartbeat.mmd file. So you can just ask it to update it with something. Right?
Update the heartbeat and dd file to add a daily calendar check. So you do not have to manually write it in the dashboard yourself. You can also
dashboard yourself. You can also immediately trigger a heartbeat with a command. So if you quickly want to try
command. So if you quickly want to try it out and be aware of the costs, right?
So these run full agent turns, right?
And if you're going to reduce the time from 30 minutes to 5 minutes, you may burn more tokens. All right. So, some
people are confused like chron versus heartbeat. So, they have some examples
heartbeat. So, they have some examples here. So, if you just want to check your
here. So, if you just want to check your inbox, let's say for important client emails or urgent emails, they recommend a heartbeat for that. It batches with the other checks that you're doing, maybe a calendar check or other things.
It's all going to be batched together into that API call. Send a daily report at some specific time. So, this is a specific time and therefore uh they recommend a chron job. So the exact
timing, right? So heartbeat just runs
timing, right? So heartbeat just runs every 30 minutes, let's say. But if you really want it to be specifically at some time, probably it's a chron job.
Monitor calendar for upcoming events.
Heartbeat natural fit for periodic awareness. Run a weekly deep analysis.
awareness. Run a weekly deep analysis.
So they recommend a chron job for this.
It's a standalone task. And one of the tricks you can do is you can specify different models for certain tasks. So
if you want to use this particular model for a deep analysis, that is possible.
Remind me in 20 minutes. Well, in this case, it would probably be a crown job, right? Because if my heartbeat is
right? Because if my heartbeat is running every 30 minutes, well, 20 minutes would that would be too late, right? And also, I need an exact timing
right? And also, I need an exact timing in that case. So, actually, if you have a one shot with precise timing, that's a chron job as well. Background project
health check. So, just basically a check for right. So, very often this
for right. So, very often this monitoring or checking is usually a heartbeat, right? It can just be batched
heartbeat, right? It can just be batched together with the other things that we want to check, right? So, m when to use heartbeat, multiple periodic checks. So
we do not want to have five separate chron jobs checking an inbox or calendar or weather or anything else. A single
heartbeat can batch all of these. Right?
So heartbeat advantages reduces API calls. A single heartbeat is cheaper
calls. A single heartbeat is cheaper than five isolated chron jobs. Smart
suppression. If nothing needs your attention, the agent replies with heartbeat. Okay. And no message is
heartbeat. Okay. And no message is delivered. And when to use cron when you
delivered. And when to use cron when you need exact timing like we saw a standalone task. So a task that doesn't
standalone task. So a task that doesn't need conversational context. If you want to use different models or thinking levels, oneshot reminders, noisy or frequent task that may clutter your main
session history or tasks that should run independently of whether the agent is otherwise active. All right, let's talk
otherwise active. All right, let's talk about skills. So, if you have a specific
about skills. So, if you have a specific skill that the agent should have like how to create commit messages, how to
scrape data or how to design an app, right? a really specific uh piece of
right? a really specific uh piece of knowledge or skill then you can package that up as a skill put it in your library of skills. Now it looks something like this. So you can have a
skill.md file let's say because we have
skill.md file let's say because we have some knowledge about how to create a git commit in a particular format. It would
be quite a hassle for us to every time we have a new conversation that we would have to load this up into the context manually ourselves. Right? So we can
manually ourselves. Right? So we can package it up in skill. Uh we can reuse that everywhere we want. a bit similar to reusing a big prompt that you may have. But also it can be loaded on
have. But also it can be loaded on demand by the agent. So if you have some conversation has nothing to do with commits. You do not necessarily bloat
commits. You do not necessarily bloat the context. It's only when you say
the context. It's only when you say something like um can you make a git commit in some format that it may decide to load this skill into the context.
Right? So sort of dynamically adding useful things to the context. Right? So
it's just a skill file with some instructions, some text, but it may actually decide to reference other files. So you may have other files that
files. So you may have other files that it can then load on demand as well, right? So you don't have to put
right? So you don't have to put everything into one big skill.md file
because that would also unnecessarily bloat the context. Right? So this is kind of the structure of a skill. Now
you don't need to know much about that because that's already done for you under the hood. So if you have a conversation and you happen to have a talk about git commit and now you're like ah that's kind of useful, you can
just ask it create a skill out of this conversation and it should be able to save that. So here under agent skills
save that. So here under agent skills you can see that we also have skills here. So if I open this up there are
here. So if I open this up there are actually 51 built-in skills already and we actually saw this during the onboarding. So there's a bunch of
onboarding. So there's a bunch of services essentially that already are included here in terms of uh how to work with them. So for example there is a
with them. So for example there is a discord skill some other services as well so that the agent knows how to deal with those services. Now if you want to have more there is claw hub here as here
as well. This is what's being linked to
as well. This is what's being linked to here from the documentation on openclaw.
So here you can see if you scroll down there is claw hub. It's the public skills registry. So if you want to
skills registry. So if you want to download more you can do that from there. You can discover, install,
there. You can discover, install, update, backup skills. They have a full guide on that. So there are a couple of popular skills here as of recording.
Trello and slack and they are installed well one of the options is with npm. Now
there have been a few security issues here. So uh they do mention here that
here. So uh they do mention here that security notes these are treat third party skills as untrusted code read them before enabling prefer sandboxed runs.
So you want to be a little bit careful with what you're downloading. So those
files are loaded from three places. So
there are bundled skills shipped with the install. So that's actually what we
the install. So that's actually what we just saw when we went through the onboarding. You can also put skills
onboarding. You can also put skills directly in the openclaw folder and also actually in the workspace. Right. if you
add a skill about doing code reviews. So
then the agent when there's an agent turn going on, it may decide let's load this up into memory to see how we should do it. All right, let's continue with
do it. All right, let's continue with the well the agent loop or basically just a full example of me sending a message ultimately all the way at the end getting a response. So if I ask it something like what are the courses that
bite grant offers because the web search tool needs an API key. I haven't set that up but web fetch tool actually does not need an API key. So if I press enter here, we are sending a message to the
gateway, right? So it's going from
gateway, right? So it's going from telegram to the gateway and before it passes anything to the actual AI model, there's a couple of things that happen, right? So roughly it's something like
right? So roughly it's something like this. The input arrives. Well, it needs
this. The input arrives. Well, it needs to know which session that message belongs to. We'll talk a little bit more
belongs to. We'll talk a little bit more about session management in a second, but maybe you have a group chat on WhatsApp and that is a different session, a whole different conversation history than the conversation you're
having here on Telegram. You can see I just got the results back and the conversation may be different here than on than the one I'm having on WhatsApp.
Now, they can also be the same. So if
you are using telegram and you by yourself let's say are also using a WhatsApp and it needs to remember whatever you wrote in WhatsApp and it needs to be the same conversation essentially you can still share that
that can still be the main session and you're just using that through both WhatsApp and telegram but they can also be separate sessions so there is some logic right so it needs to decide that because in the next step here it's going
to build the well the message the complete context that it's going to send over to the AI model including conversation history. Right? So it needs
conversation history. Right? So it needs to know which history it needs to load.
So in this stage it's doing some context assembly. Right? So we've talked about
assembly. Right? So we've talked about the different parts of the context.
There's a system prompt all of these workspace files. There's tools and
workspace files. There's tools and skills that it describes as well to the AI model. So the AI model knows which
AI model. So the AI model knows which ones it can invoke. And of course the previous messages from the history are also sent along, right? So from that session. So ultimately it has all the
session. So ultimately it has all the info and it's going to send to the model, right? And you again you may
model, right? And you again you may actually have different models configured but ultimately it will send it to one of those. Now the model may decide to invoke a tool. So let me actually move this here in the center.
So the model may come back and say hey we actually want to read a file or like we are doing here fetch a page. So
there's a web fetch tool. Could you
invoke that? So then openclaw will invoke that tool. Right. So that will give some result. In that case it would just be the HTML of that page. Right.
the /courses page that I specified here would just be whatever the fetch call returns. The result of that tool call is
returns. The result of that tool call is then sent back to the model, right? So
then the model continues iterating over that. So there's basically like a bit of
that. So there's basically like a bit of a loop, right? So there may be some tools or skill execution or maybe not.
Now ultimately that loop if there was a loop um has been finished and the model will come up with a final response. So
in that final step, the gateway is going to do uh a couple of things. Send
message back, but also right so typically it will send back the message to the to telegram but it may do some other things as well like save a transcript of the conversation and if
you have set it up in such a way it may also write let's say to memory in some way maybe the memory MD file we'll talk about in a second as well. Right? So
this is roughly the way the the whole flow of chatting with your AI assistant.
Let me actually make this horizontal. So
it's something like this. This is
roughly how it looks like. All right,
let's talk about sessions. So why is there even a concept of sessions here with open claw? There needs to be some kind of uh continuity, right? So if you send multiple messages over telegram,
that whole conversation has to be sent to the model, right? So it needs to know the history of the conversations you have. Also, when you're DMing from
have. Also, when you're DMing from Telegram and then you're DMing from WhatsApp, let's say some other channel and typically you want it to be the same. It should be the same session,
same. It should be the same session, right? So, typically if you're just a
right? So, typically if you're just a single user using this as your AI assistant, there's no other people involved. Typically, you want them you
involved. Typically, you want them you want them to share the same session across all the channels. But sometimes
you don't want to have that. you want to have maybe in a group chat the group chat should not be or when you have multiple users different users they do not need they you do not want them to be aware of each other's sessions you don't want to have some separation between
sessions also when you're using chron jobs and there's like a recurring task where the AI model gets invoked well if you have a super long session about something else that does not need to be
sent along to the model right so these chrome tasks can have different s separate sessions as well now what is in a session well it's the conversation history including the tool calls and the
results of them and they can typically be pretty big. Now typically you have one main session by default that means the telegram and the WhatsApp they are typically using the main session. I can
see that here in chat as well by the way. So you can see here this is main
way. So you can see here this is main you see all this main but there's another one here for chron. You can see the chron one here is sort of like a different thread almost and this is because here we're also interacting
because this one is also interacting with the AI model and the AI model is just receiving some prompt right on our end here on so at in openclaw we do need to have a separation because I do not
want to send my whole main conversation along to the model when it's running the chrome task and the chrome task is just about some daily news brief right so there's need to be different sessions and we can see that here in the controls
as well so you can see sessions I have on agent in the main and then we have that chron uh session right so that's that is separate so here in a doc uh there's a little bit more information
about how to control how direct messages are grouped so the default is main so all DMs share the main session for continuity so if you're on WhatsApp or uh telegram they share the same session
which is typically what you want if you're like a single user what if you have multiple different users or you want to get a little bit or you you do want to have different conversation in WhatsApp versus uh Telegram. Um there is
an option for per channel pier. So you
can isolate the session by channel but also by sender. So this is recommended for multi-user inboxes. So if you have different users then you may want to change the session. DM scope setting you
can do that. So they have some more information about a secure DM mode when you have a multi-user setup. So if your agent can receive DMs from multiple people well they have an example here of the problem that could occur. So Alice
sender A messages the agent about a private topic. for example, some
private topic. for example, some appointment and Bob messages your agent, what were we talking about, right? So
those are two different people. But now
if they share the same session, Bob would receive information about what the other sender, right? Because they share uh the same session. So in that case, you probably want to change the DM scope
to isolate the sessions per per user. So
they have an example here with secure DMO per channel. Now those sessions uh are actually sort of recorded. So they
are there's a transcript of them at this location. So in the open claw folder in
location. So in the open claw folder in then for your specific agent there is a folder with the sessions and it's going to be in JSON. So if you want to do perhaps some processing on that that's
actually possible. Now a conversation
actually possible. Now a conversation may become very large and the the context may grow to be very large. There
are some mechanisms here to help you with that. So session pruning trims old
with that. So session pruning trims old tool results from the in-memory context right before each LM call. But this
seems to be only active for when you use the entropic model. And the other thing that we saw before is it will do some compaction as well. So the models they have a maximum context size. So as you approach that at some point you probably
want to summarize the whole conversation. So compaction we're
conversation. So compaction we're summarizing and persisting it in the JSON L. With session pruning we're just
JSON L. With session pruning we're just trimming the old tool result and that's in memory per request. Okay. And there's
some logic about when the auto compaction happens. For example, when
compaction happens. For example, when the model returns some kind of context overflow error or when it matches some threshold. Now before the auto
threshold. Now before the auto compaction happens, so before the auto compaction happens, we can run a silent agentic turn. Basically just make an API
agentic turn. Basically just make an API call to the model, we can ask it to write uh the state in memory for example in the memory file in the agent workspace so that compaction can't erase
critical contact. Right? So there is a
critical contact. Right? So there is a bunch of logic here already implemented for you keeping track of conversation history and dealing with context
management and in the conversation you can also write some of these slash commands. So you can do forward/ status
commands. So you can do forward/ status shows the current status right so I can see what I'm running right now what are the main uh important settings I can also see context here and also those compactions how many tokens I've used
and if you want to start a fresh session you can do forward/ new or reset and actually you can also stop the model so if you can see so if you want to stop the current run you can just write
forward slash stop and if you're doing some configuration around the different users you can just run forward/h who am I so you can check which uh like sender ID that you're currently using. I can
also do for/context as we've seen before and then also the details and you can see it takes a bit longer now because we're sending the context info to the model and we're ask and it's it's going to ask the model to explain the context.
So it's actually an API call that's being made. Right. So now after a few
being made. Right. So now after a few seconds I get a response and we've seen it before. So it gives some information
it before. So it gives some information about the context included here in the session. So we've seen that it's been
session. So we've seen that it's been building the context of the messages right with all those files the skills the tools are actually quite big the sessions tokens used the sessions tokens. So you can see there's a bunch
tokens. So you can see there's a bunch of session related management built in here as well. All right let's talk about memory. We want our AI assistant to
memory. We want our AI assistant to memorize facts about us over time. So it
may know your workflows uh your personal information like the city you live in and such so that in subsequent uh conversations it knows about those. Now
we've already seen memory a little bit.
So, so memory here in openclaw are actually just uh two files basically. So
there is a daily log file. So let me move it like this. So there is a daily log file and there is memory md. So all
the memory all the things that it memorizes it's actually written to files right. So if you wanted to remember
right. So if you wanted to remember something it needs to write it to well one of these files. So if you take a look at the docs here. So open claw memory is plain markdown in the agent
workspace. The files are the source of
workspace. The files are the source of truth and the model only remembers what gets written to the disk to those files.
So those files are these two. So there
is in the workspace folder there is a memory forward slash and then some date MD. This is meant as a daily log like a
MD. This is meant as a daily log like a diary. And this is automatically read
diary. And this is automatically read when you have a new session. Right? So
if I do uh forward/ new, I have a new session and then in that new session, it should read the contents from that file when I send a prompt to the model, right? So that's going to read the
right? So that's going to read the today's log as well as yesterday's logs.
But then there's maybe an even more powerful one which is memory MD. So this
is more curated long-term memory, but this is optional. So this actually does not exist by default. So if we take a look at when to write memory, so decisions, preferences, durable fact,
right? That's long-term stuff. We want
right? That's long-term stuff. We want
to put that in memory. MD day-to-day
notes and ongoing context, we write that to these log files. And when now when we say writing to these files, the daily log file or memory.m MD, it's basically
going to be the model that decides invoke a tool to edit those files or to edit those files to write facts to them.
But how does the model know when to do that? Well, remember when you send a
that? Well, remember when you send a prompt, OpenCloud builds a complete context, right? And so it does a context
context, right? And so it does a context assembly and it injects all of those files including agents.mmd. This is like the most important one with a lot of pointers for the model on how to behave.
And we've seen it before. If we go to agents here in agents.mmd there are a bunch of instructions for the model to follow including about memory. So let me actually copy this and let me just paste
it so we can read it here. So this is this gets sent when you send a prompt through telegram. Open CL injects this
through telegram. Open CL injects this file when before it goes to the model.
Right? So the so here you can put some instructions. So here there's an
instructions. So here there's an instruction for every session. Right?
Before doing anything else read that daily log file for recent context. So it
may decide to invoke the read file tool to read today's memory file. Here
there's something for memories. You wake
up fresh each session these files. So
daily note, right? So basically
specifying to the model what it has access to. So there's the daily files
access to. So there's the daily files and then there's also this memory.mmd
the long-term memory. Okay. So here
something more about memory md only load this in the main session. Do not load in shared contexts. You can read edit and
shared contexts. You can read edit and update memory.md
update memory.md freely in main sessions. Write
significant events thoughts decisions opinions and lessons learned. This is
curated memory distilled essence not raw log. Right? So here we're already giving
log. Right? So here we're already giving right when you send a prompt and this is included we're already telling the model hey we want you to update the memory MD file but it's not a super strong instruction. It's not it's sort of it's
instruction. It's not it's sort of it's sort of hidden between all of this. We
can probably emphasize it a little bit more to the model. Right? So and there are some other instructions as well about that but I don't know if the models are really going to properly write to the file. Right? So here in the
docs it also says this area is still evolving. It helps to remind the model
evolving. It helps to remind the model to store memories. It will know what to do. If you want something to stick, ask
do. If you want something to stick, ask the bot to write it into memory. So I
think a best practice here is if you do want it to remember something, right, you want to be explicit about it in your prompt. So you could say something like
prompt. So you could say something like please remember or store the main lessons from this conversation, right?
Instead of just relying on what's in agents.mmd, I think it can be a little
agents.mmd, I think it can be a little bit more explicit. Okay, so but in agents.md we have some other things as
agents.md we have some other things as well. When somebody says remember this,
well. When somebody says remember this, update the daily log or relevant file.
When you learn a lesson, update agents.md tools.mmd. Right? So it can
agents.md tools.mmd. Right? So it can update those other files as well. When
you make a mistake, document it so future doesn't repeat it. Right? So this
agents MD that you get out of the box already has some instructions concerning memory. Here there's also when we scroll
memory. Here there's also when we scroll down memory maintenance during heartbeat. So periodically every few
heartbeat. So periodically every few days use a heartbeat to read through those daily logs. Identify the
significant events and then update that long-term memory file with distilled learnings. Remove outdated info from
learnings. Remove outdated info from memory.m MD. Okay, so it has a bunch of
memory.m MD. Okay, so it has a bunch of information. So already in the
information. So already in the agents.mmd file which gets sent along
agents.mmd file which gets sent along with your prompt. But as a best practice, probably best to be explicit about it when you want to store or remember something, right? At least as of recording, right? So there's the
daily locks file and then agents.md,
which is something we can see here, right? So here by default, this is
right? So here by default, this is missing. There is nothing here yet. I
missing. There is nothing here yet. I
guess if I would say something like please remember or store the fact that oneplus 1 is two in long-term memory.
You can see if we take a look look behind the scenes here we can see that it actually first does a memory search and we're talking about writing to the to these files but later it has to
retrieve information from them as well.
It has tools for that. We'll talk about it in a second. But it has now stored it in these in long-term memory. So now if I go back to memory.mmd we can see that it actually exists and has content now
facts right so written by the agent right and again I've and I triggered that here from my telegram account but we can look behind the scenes here with the chat option here right so first it
did some search in the memory here it wrote right so we can see the path of the file so you can see the files that it has written to there's a tool right there as a writing tool okay so then it
finished and it gave us a response here okay now we already saw this tool here about memory search, right? So now we know how to write to memory, it also needs a way to retrieve it, right? To to
read it, you could say. Now we already have an instruction for that which is every time there is a new session, it's going to read that from today and it's going to read the daily log from today
and yesterday. And we say if in the main
and yesterday. And we say if in the main session a direct chat with your human also read memory MD. Right? So every
time a new session starts it should read right most of right typically it would read from both of those files cuz usually you have your main right in most setups I assume you just aren't just you're just going to be in like one main
session so typically it should already automatically read from there on the start of a new session and don't ask permission just do it now to read from those files you can imagine those files could become pretty big over time
especially memory MD and maybe you're deliberately putting in a lot of info so it needs an efficient way of reading those files or retrieving specific pieces of information in your conversation, right? So, if it's not
conversation, right? So, if it's not only about reading all of those files at the start of a new session because during the conversation, you could also say something like, "Hey, please look up
what setting I used to have for the audio level for the videos that I record." And just as an example, now it
record." And just as an example, now it needs to go into your memory and look this up. So, there are some tools out of
this up. So, there are some tools out of the box that Open Clock comes with.
Memory search. It's a semantic recall over indexed snippets and memory get. So
here with memory search it's actually a little bit fancy. So you can you can sort of uh factoriize it. So the you can create embeddings out of your memory and
then efficiently search over the indexed snippets. So here if we scroll down a
snippets. So here if we scroll down a bit open clock can build a small vector index over memory.mmd and actually those other files as well. So semantic queries can find related notes even when wording
differs. So this is actually enabled by
differs. So this is actually enabled by default. It watches memory for changes.
default. It watches memory for changes.
So that is actually already happening with SQL light by default, but some people seem to prefer using this QMD as of recording still experimental. So some
of the power users I've seen are are trying to use this and they report pretty good results with it. So that may be something that you want to try, but it's still experimental. This is
disabled by default. Now, if you go into uh config here and we go to memory here, you can decide what the memory what they call backend should be. So built in for
the open claw embeddings or QMD. So uh I guess mostly useful if you have a very large knowledge base that you want the agent to be aware of so that you can index that and then efficiently retrieve
it. Writing to the files which we
it. Writing to the files which we discussed and this is reading the files.
So some quick tips and tricks to help you get started and get the most out of it. When you're just starting you can
it. When you're just starting you can just you can just give a massive brain dump about everything in your life, your business, your relationships, whatever you want the AI assistant to know about.
So it can keep those things into consideration, right? So for example,
consideration, right? So for example, given everything above, maybe you've already had a conversation proposed 10 automations or workflows and you can even rank them by impact and effort, right? And you can tell it to memorize
right? And you can tell it to memorize the most important part, writes it to the memory.mmd file. Now, if you're
the memory.mmd file. Now, if you're price sensitive or you just want to use different models, there are some ways that you can do that. So you can have a more expensive model that takes care of
the most important decisions like some kind of architecturing some kind of architecting task and planning task and then you may have a cheaper model does some simpler task right that may also be
faster right so you may have some workflow or some scenario where that makes sense actually have to do with multi- aent setups as well so what I've done here is I have one agent right
telegram this agent right under agents you can see I only have one now technically You can have other ones as well. An agent is a fully scoped brain.
well. An agent is a fully scoped brain.
So that workspace and the state, some state and session store, but you can also have a multi- aent setup with multiple agents. So I would say if
multiple agents. So I would say if you're power user, this is something that you may want to consider. You could
have an agent for coding, let's say, and then you have an agent for design or an agent that is your actual AI assistant and that one may delegate it to a coding agent, right? So you can come up with
agent, right? So you can come up with some kind of interaction patterns between them. The other tip is to uh not
between them. The other tip is to uh not forget about this for/ new. So if you changed those context files, you may want to do / new so you have injection of the files. And if you're changing
topics in the conversation, you may also want to do / new so you're not taking all of that previous irrelevant context with you when you start talking about something that's completely different.
Now, if you're new, another tip would be to try using a VPS instead of doing it on your own computer. A VPS is separate.
It only has access to the things that you give it access to and the things that you should give it access to in my view should just be maybe some dummy data or some test accounts. It shouldn't
be sensitive data or sensitive accounts because of security, right? So, this is all very new. A lot of the security aspects still have to crystallize out a little bit. So, in the meantime, if you
little bit. So, in the meantime, if you just want to try it out, I would just go with a VPS at this point. And also, you may want to back up this workspace folder, right? So you you're going to
folder, right? So you you're going to have memory in here. It has those context files as well that you may have fine-tuned over time. So you can make it a private git uh repo for example and
periodically uh commit to there and keep it. Now the most important tip I think
it. Now the most important tip I think is simply that you do not have to do much configuration yourself. Right? So
as you talk with it, as you do things, you can sometimes just say something like, "Hey, read my last 30 messages.
Propose improvements to all of those files, soul.md, tools.m MD, heartbeat.
files, soul.md, tools.m MD, heartbeat.
MD, keep each under 25 lines. Show me
the differences." Right? So you do not have to write all of this stuff from scratch yourself. If you start
scratch yourself. If you start interacting with this over time, you build up a nice history and you can ask it to propose improvements for you.
Right? Same with chron jobs and heartbeat checks. after some
heartbeat checks. after some conversation you can just ask it suggest crunch jobs for me or heartbeat checks that would be genuinely useful for me and explain why they're worth the tokens right so you don't have to do much
configuration all by yourself all right so I must finish a few other things I think that are good to know about so there are also these nodes so you can sort of connect a companion device so
that it can do things on the device like like your camera on your mobile phone and Mac OS can also run in that node mode so you have a menu bar app that will connect to that gateway so that it
can do something with the local canvas or camera command. And there's also a Chrome extension which allows OpenCloud to drive your existing Chrome tabs. So
it can create its own uh browser and own um profile. But if you wanted to use
um profile. But if you wanted to use your existing Chrome tabs, you can try following this guide here. If you prefer talking instead of typing, there is also something called talk mode. you it can
listen for speech and it will transcribe it and then wait for the response and then it can speak back to you via well 11 labs on this page. So if you want some kind of text to speech uh
functionality uh you can try following this guide here as well. And actually I think we covered everything I wanted to cover in this video. So well done for making it all the way to the end. I
think it's actually a really exciting time to get into open claw right now because I think everybody is going to have an AI assistant and we are very early right now. So there will be a lot
of people required for understanding how it works under the hood, configuring things, setting things up, helping people with making it work for their lives and their businesses. So I think
there's going to be a whole ecosystem around this AI assistant type of tool. I
think it's great to be early. So well
done for finishing the video. And like I said, if you want to try it out on a VPS, I would really appreciate it if you do it with my coupon code here on Hostinger, which is all uppercase byte grat. You can check out the link in the
grat. You can check out the link in the description. In any case, thank you for
description. In any case, thank you for watching. I'll have more open clock
watching. I'll have more open clock content coming out soon as well, so make sure you subscribe. Have a nice day and bye.
Loading video analysis...