I Fixed OpenClaw's AI Memory Loss Problem

By Beau Johnson · · 15 min · 1.3K views

About this video

I do 4 live bootcamps every week in Shipping Skool! Full courses on OpenClaw and Claude Code! Join Here ⬇️ https://www.shippingskool.com/ Get the weekly AI builder newsletter 📕 https://substack.com/@buildnpublic Follow Me On X - https://x.com/BeauJohnson89

Transcript

Read the full transcript

0:00I almost quit using OpenClaw and I want to talk a little bit about why. Not because the agents didn't work and not because the automations were breaking. I quit because every single morning my AI woke up and had no idea who I was. I was spending 12 hours a day getting everything perfected from the cron jobs to the daily morning briefing, yet to wake up the next day and my main agent didn't even know what we had worked on and who I even was. How depressing. So, I'm going to talk about why this happened and how I went about fixing it over these last 30 days. Like I said, I would spend 12 hours building out a simple feature, getting an agent dialed in and tweaking the prompts and all that, like trying to get it as perfect as possible. And then the next day it

0:46would literally just look at me like it never met me. Gone, all of it. And I know I'm not the only one experiencing this because I just got off a coaching call in our school community and this was the number one complaint. Everybody was dealing with this. So, in this video I'm going to be breaking down how I actually fixed the memory problem in OpenClaw and the newest release 3.8 also deals with this issue. This isn't just a theory, this is not just what the docs say as well. It's what I actually did that's been working for me because there's a lot of confusion around this and I think most people are just overcomplicating it or just don't know where to start. Let me start by why the memory breaks to begin with. It's because once you understand this, the fix itself makes a lot more sense. OpenClaw stores your memory in what is

1:32called a markdown file. You've got a memory markdown file, which is like your agent's long-term memory. You've got daily files in a memory folder. The agent reads these files every time you send a message, every time. So, if your memory file is 5,000 lines, it is reading all 5,000 lines on every single prompt. That can eat tokens up like crazy. But here's where the problem gets interesting is Open Claw does a thing called compaction. So, when your context window gets too full, it actually summarizes those older messages to make room for new ones. And in that summarization process, it loses all of the details, which can be kind of important. It's like if someone asked you what you did last Tuesday, and you

2:17go, "I don't know. I worked on some stuff." I've been there before. That's compaction. The general idea is there, but it's just like all the specifics are gone, and it's really frustrating at times. And it's those specifics that actually matter when you're talking and building with LLMs. The API key you set up, the database table that got created, the exact prompt that finally worked. All of this gets compressed into some vague summary, and then your agent acts confused because it literally just doesn't remember those details. So, here's how I fixed it. I used three layers of memory, and I know that sounds like overkill, and it sounds like a lot to most people, but it's much easier to set up than you think. Each layer does something different, and then together they basically make my agent not ever forget anything. Layer one is that local

3:03markdown file. This is what Open Claw gives you right out of the box. It's that local memory markdown file. So, for the big picture stuff, that works great. And for small simple setups, like one two automations, I think that's fine. But, when you're starting to build something a little bit more robust, you want this to go much deeper. So, the memory markdown file really deals with like who I am, what I'm building, the key decisions, and those preferences. Think of this as like your long-term memory, the stuff you always know about yourself. And then, I have like daily files, like memory/2026.md, where the agent logs what happened that day. So, the raw notes, raw conversations, what we built, what broke, and what fixed. This is more of like a log, but the key here is keeping like the memory markdown file curated

3:49with the the stuff. Don't just dump everything in there. So, I treat it like a resume for my agent, only the important stuff. Decisions, preferences, project contacts, lessons learned, and all of that stuff. If it's just a log of what happened, it goes into the daily memory, not the memory markdown file. So, it gets like a date stored away as a markdown file. That's what the logs for the day were. Because remember, it reads every file every single time. You don't want it going through all the logs of all the things that broke for the day. You want to keep that as clean as possible. So, if it's like a bloated markdown file, you're wasting a ton of tokens, and the agent gets confused by irrelevant old stuff that happened. Layer two is a database backup, and I didn't do this until about a week into the build. So, I've been a really big

4:35proponent of using Neon Postgresql because it's just what I know, and it's what I use. You can use Superbase, you could use Notion, whatever. But, that's how my Mission Control operates is we have that database to store a lot of the information. So, I push a lot of that memory there, too. Every hour, a cron job will kick off and take everything I've done in that hour and update the database. I have that cron job that takes whatever's new in that memory file, and then just syncs it to the database. So, even if my markdown file gets corrupted or compacted weird or something breaks, the database has a clean copy. And this comes in clutch if things do break, and things have because, you know, there has been times that just happens where Open Claw's compaction basically ate something

5:20important from my local files. But, because it's in the database, I can tell my agent, "Hey, you don't remember this." And you will know when it doesn't remember things. Go check the database, and then it pulls it right back. So, it's basically like having a backup brain. And that kind of opened my eyes to having more backups for storage, when especially when you're dealing with bigger automations. So, you don't have to use Neon, um you can use Superbase, that's fine, whatever your preference is. Um the point is to just having a second backup where your memory lives that isn't dependent on Open Claw's local file system. Layer three is super memory, and I came across this in just a local tweet that I had seen just the other day. Super memory, this one's the one where it kind of really levels up.

6:06Supermemory.ai is basically cloud memory service that you push your context to and it stores and deduplicates it and makes it searchable. It's just 20 bucks a month, and honestly, it's been worth every many every penny just to have that kind of security knowing that I have three backups of what I did today. So, what I do every time my daily memory file gets updated, it automatically pushes to super memory with that custom ID. The custom ID is important because it means super memory only processes what's new. So, you're not deduplicating anything. You're not wasting API calls. It just files it. So, now my agent has three places to check. Local files first because that's the fastest. If something's not there, it checks the

6:52database. And if it's not there, then it can call the super memory API. And the cool thing is is I set up once it's set up once, it just runs in the background. I don't need to think about it anymore. So, here's where it gets more interesting is Open Claw just dropped the latest 3.8 version, and they completely changed how memory works under the hood. They added something called LCM, which stands for lossless context management. It uses graph structure instead of just flat text files. So, what this means in practice is that instead of linearly summarizing old messages and losing detail, it creates a graph of connected summaries. So, it can then traverse back through the conversation history and find specific details even from weeks ago. Pretty impressive. So, it's like

7:37basically having, you know, instead of reading a book from front to back, you have an index. It can jump straight to the page you need. So, I've been running 3.8 since its release, and the difference is pretty noticeable. My agent remembers a lot more It remembers the project details from 5 days ago that would have literally been completely gone on an earlier version. It's not perfect. Nothing ever is when you're building with AI, but it is a massive improvement. So, if you're still on 3.7 Open Claw or even earlier, seriously just go and update. It's super easy. So, it is the probably the biggest quality jump in the whole Open Claw sphere since they've been, you know, making updates to the repository. Just make the update. So, I'll give you a real example of why this matters. I have an agent called the

8:22Rizza, and yes, all my agents are named after Wu-Tang Clan. Whatever. Basically, the Rizza runs every morning at 6:00 a.m. It scrapes the trending AI topics. It writes the copy, the newsletter, the blog. It also generates the thumbnails through Nano Banana. It creates the blog posts and all that. So, automatically while I'm sleeping, 6:00 a.m., it's all done. So, before I fixed the memory situation, the Rizza would sometimes write the copy about topics I already covered, and that was getting annoying. So, because it forgot, it would just use the same phrases, just regurgitated in a different way. And that's just because it forgot. It I mean, I'm not blaming it. It would just miss like my style preferences. It would miss my call to action format. It would miss basically everything. So, I'd wake up to, you know, copy that I just

9:07couldn't use, and I was just wasting tokens. So, after setting up the three-layer memory system, the Rizza checks the database for every video I've ever made before it writes anything. Ah, thanks. So, it knows my voice. It knows my style. It remembers the anti-slop rules I set up weeks ago. No anti-slop. No em dashes. No quotations. And stop using AI slop wording. Come on. So, the copy that we actually write are usable. Gets me about 80-90% there. I still need to add in some more character and some more of me into it, but this has changed significantly and it's all because the agent has full context of what it's supposed to be That's the difference. It went from an intern who shows up every day with amnesia and

9:52Alzheimer's to an employee who actually remembers the job at hand. So, let me talk about some of the mistakes I made that you can avoid because I definitely learned this the hard way and I don't want you to waste time. The say the first mistake is putting too much in your memory markdown file. I had this thing at like 500 lines at one point with every little detail in there, the API keys, the project configuration, random notes. And my agent was slow and confused because it was reading all that every single time. Trim it down. Keep it under 200 lines of truly essential context. Everything else can go in your daily files or in the database. I would say the second mistake and learning lesson is using weak models for orchestration. I know it's tempting and it's so cool to use open source models, but I don't want you to waste time. I

10:37cannot stress this enough. If you're using GPT or one of the smaller models like Kimmy K2 or Mini Max as your main agent, you're going to have memory problems regardless of what you do. These models can't handle complex context as well as Opus or a Sonnet 4-6. I had a member on our call today who was using GPT as his main orchestration model and everything was breaking. I told him to switch to Opus 4-6 and I guaranteed his experience got better immediately. Opus 4-6 handles the long context much better. It follows instructions more reliably. It actually reads and uses the memory files that you give it instead of just vibing out and ignoring them. Yes, it costs more. I pay $200 a month for the Claude subscription, but if you think about it this way, that's $200 a month for

11:23basically a full-time employee that runs 24/7. That's nothing. Mistake number three is not using sub agents. This was a big one for me because if you have one agent doing everything like the research, the writing, the posting, and database management, its context window will be cooked. And this is when the compaction kicks in and then you lose all your stuff. So, what I do now is I have a separate agent for separate jobs. We got the Rizza, of course, that does the content. We got Inspect the Deck who does the X outreach and the X post. We got Ghostface Killah does the intel gathering and each one has a focused job with focused context window. They don't need to know about each others work and because they're isolated, they don't pollute each others memory. So, if you can think of it of like employees at a

12:08company, you wouldn't have one person doing HR and marketing and engineering and accounting, right? It just doesn't make sense. You'd have specialists. Same thing with your agents. Mistake number four, I would say is not backing up before big changes. I broke my Open Claw setup not just once, but thousands of times. And last night it also broke again and I was just trying to test out a new pipeline and if I didn't have a database or super memory as backups, I would have lost days of context. Always have a backup. Always. It just takes 5 minutes to set up a cron job that pushes your memory to a database. Do it before you wish you had. So, let me give you the actual setup in just a few minutes. If you want to do this yourself, here's the move. Step one, clean up your memory markdown file. Only keep the stuff your agent needs for every single

12:53conversation. Go look at it yourself. What's in there? So, basically your name, your project, your preferences, the key decisions That's it. Everything else can go into daily memory markdown files. I would say step two would be setting up a database. I use Neon because it's free to start. It's Postgres SQL which works with everything. Create a simple table for memory entries and then timestamp the content, source it, and then you're done. Step three would be like creating a cron job in Open Claw that runs every hour, every 2 hours, however often you're using it, and it will read your latest memory files and then push everything to the database. So, this is your safety net. Step four would be the final step, but you don't you know, these last few steps, you know, are optional. If you want a third layer, you can sign up for Super Memory and push

13:39your memory markdown file and daily files there with custom IDs for deduplication. Now you've got cloud backup that your agent can query at any time. I would say in addition to that, do the latest update. Update Open Claw 3.8 if you haven't already, the LCM graph memory is a huge upgrade to previous ones. So, you can do it all in just an afternoon, less than that, like an hour, and I promise you the experience of using Open Claw after you set this up versus before is going to be night and day on your experience. And if you want to learn how to build stuff like this and set it up on your own and build your own AI agent pipeline, you could join Shipping School link down below. We do four live calls a week and I literally walk you through this thinking this kind of way and going through this step by step. This was from

14:24today's call. People were asking about it, memory, and this is what I told them. I just got off a call with 14 members in the group, and this is the main thing that people keep bringing up is the memory, the memory. It seems like Open Claw has Alzheimer's. Well, I wanted to make this video for people like yourself so you could fix this issue, and if you haven't subscribed already, do so because we're releasing updates all the time. We'll see you in the next one. Have a blessed day.

Build this with us, live

Shipping Skool is a free community with 4 live build sessions a week. Bring your idea.

Join Shipping Skool — Free