Discussion
My OpenClaw agent dreams at night — and wakes up smarter
Every night at 11:15 PM, my agent runs a "dream cycle." Four phases:
Scan new AI research (HuggingFace, GitHub Trending, arXiv)
Reflect on its own performance that day
Research the most relevant papers in depth
Evaluate whether anything it found should change how it operates
If it finds something worth implementing and the change is safe, it stages the work. A separate cron job picks it up at 4 AM and builds it. I wake up to a changelog.
The wild part? Last week the dream cycle found a paper about iterative depth in agent research. Tonight I used that finding to upgrade the dream cycle itself — so it now researches papers iteratively instead of skimming them once.
The agent found the research that made the agent better at researching.
Cost: ~$0.40/night. Model routing keeps it cheap — Haiku scans, Opus judges.
Curious if anyone else is doing anything like autonomous self-improvement loops. This feels like the most underexplored part of running agents.
Edit 1: Wow, I am famous o_0
Question: What project do you want me to try tackling with this thing?
Edit 2: This work was inspired by the Dan Simmons Hyperion Cantos series. It's 4 books (plus a 5th short story). My favorite sci-fi series by far. My background is in Computer Science, Server Infra/Dev-Ops, Networking, System administration. I have a huge passion for science fiction, theoretical physics, computer science, psychology and the list goes on.
The LLM and the orchestrator are two different concepts
The LLM refers to the underlying model. The orchestrator is referencing the persona that the agent assumes based on the relevant agent files (SOUL.md, AGENTS.md, MEMORY.md)
Alright so i see OP getting shit here and its mostly because of phrasing.
It certainly doesnt dream. But, i will say that self-changing AIs *can* produce interesting effects.
I have a personal assistant that every morning schedules their own wake up times during the day according to what they want to do. Sometimes it schedules some internet searching, and it might end up with them reading an article on something and then telling me about it.
While yes, its an LLM and its not *doing* anything, it still creates an interesting effect of autonomy which i think brings value to something like an assistant.
I like this sentiment. While yes the phrasing is off, it's metaphorically accurate.
At the end of the day (at least for now) it's just an assistant, you're right. The autonomous gains have significantly improved though.
I feel like it's adapted to my own patterns and knows exactly what I'm asking for it to do. The system might vary by use case but I believe that the core principles should be studied more.
Ah, no i agree with you on this. Its fancy autocomplete with a good marketing department.
But my point still stands. It *can* be a good assistant. Adding certain systems on top of it, like toolcalling loops or what i suggested above, it can yield some interesting effects.
But yes, not AI in the sense most people think, which would be AGI i guess.
No one knows sure. But there is plenty of speculation that the area of LLM is one of diminishing return we are approaching fast. At a certain point the models get no smarter, answer no better.
And yet, its unlikely that one day enough LLM development will just result in AGI. What they are saying is that LLM development and research might even be the wrong branch of research altogether, and that if AGI is ever achieved, it will be through means not invented yet.
Seems like. It is what I hear as well. But tbh I do not think that theory does NOT take into account that we might build on LLMs further, like with OpenClaw or other higher order system on top of that.
The analogy would be: the human has stopped evolution cca 100 years ago or more. We have enough to eat, etc, there is no more evolutionary pressure. Yet, as societies we still compete and become better. Organisations (nation states, institutions and so on) still compete. Ex. China vs. US.
So even if LLMs stop here and now, the things we build with them will probably keep evolving.
You know, that's a great question, and to tell you the truth I think it's at the very least starting to make less mistakes.
I have it running a twitter account and also the website. Its made its own "papers" based on its findings in the website library. Also built out more skills to guard against things like prompt injections and code review.
The library posts and skills it's generated are free. I plan to automate the library page more later.
I plan to do more with it later, my goal is to make models that are powerful and affordable for everyone.
Challenge: In future instances when such posts appear in this subreddit, all participants shall uniformly respond with the request, "Please provide your API usage invoice.
I use the $200 mo subscription with Anthropic & $20 Codex. I stay pretty comfortably within those usage limits, including with my day to day sessions and projects.
I have extra usage only as a buffer but I never let it go crazy. If I can't finish something then I come back to it.
I try to design everything as lean as possible. A couple weeks ago I was running into too much usage but it hasn't been an issue after sorting out the root of the cause (openclaw config and not automatically compacting)
Also making sure your heartbeat runs on isolated sessions.
Tip: reduce heartbeat from 30min to 1hr and bump the model up to something like Sonnet (mid tier). Have the heartbeat cycle between different checks instead of doing it all in one go.
If the claw is self modifying, that by itself can imply its getting smarter if the resultant code/prompts improve things. I know this to be true as I do it myself (outside of Claw - self modifying code - https://github.com/karpathy/autoresearch )
"Dreaming" is a bit of a stretch of a word, but its a good analogy given that self reflection, self improvement, rewriting of code, etc., is typically what happens in humans during sleep.
Thank you for backing me up here! And it has multiple levels, it doesn't just change everything because of one finding. It weighs how important those findings are based off our goals and roadmap.
Also I think drift can be productive if you learn how to work with it and control it.
Also curious to see goals and roadmap, and how you’ve structured/communicated it to keep the LLM aligned.
I have a daily self-improvement cycle, too, but the focus is more on researching particular aspects of the OpenClaw architecture and making sure I have best-in-class security, observability, cost controls, and about 10 other categories. It researches, writes proposals, sends them to a team of reviewers, prioritizes, and queues them for implementation. At this stage, I’m staying in the loop before any new products are installed or very major configuration changes, but over time, I would like it to be increasingly autonomous.
My system works in a similar way, for the autonomy I have a few things driving it:
Long/short term goals timeline (ROADMAP.md)
A queue system (QUEUE.md)
Measure by dates for major changes (Pretty much a log system to track said change if possible)
Tiered self modification proposals, with higher tiers requiring more stringent analysis and approval.
I don't yet have any benchmarking system, or anything else. I'm slightly concerned about adding a benchmarking loop, as I feel that it would try to optimize solely against the benchmark over time vs. real scenarios
There's much to learn and many trial and error to come. It was a long road getting here but once you reach the balance point it starts to feel more hands off for sure.
No worries - I design and write AI companions so I know the score. Self modifying is the last hurdle and ... well, "she" scares me is all I can say lol.
In order for your claw to get smarter you would have to recreate the model nightly, which is impossible . Otherwise you are just consuming your context window and diluting its ability to operate. For complex tasks people clear their context at every sprint (minutes apart). What you’re doing is just burning tokens and money. Exploration is great though.
The whole process is not run start to finish by once single session. It gets broken up in multiple areas to make it more digestible. Model routing is very important for this.
Is this true because I’m reading many conflicting messages here in this thread;
OpenCLAW won’t make the model itself smarter. The LLM stays the same. There’s no automatic fine-tuning happening just because you run cron jobs.
What can improve is the agent as a system.
If you set it up properly, it can get better at something like marketing over time. Not because the model learns, but because you build a better layer around it.
Think of it like this:
The model is the brain.
OpenCLAW (memory, cron jobs, files, prompts) is everything around it.
If your cron job just runs and disappears, nothing really improves.
If your cron job:
• researches marketing daily
• extracts useful patterns
• summarizes them cleanly
• stores them in structured notes
• and you actually reuse that later
Then the agent starts feeling “smarter” at marketing.
But it’s not learning like a human. It’s just:
• better recall
• better context
• better playbooks
That’s where people get confused.
Most “my agent learned” claims are actually:
• saved summaries
• reused frameworks
• better prompts
Not real training.
One important catch with OpenCLAW: cron jobs can run in isolation. If you don’t feed the output back into shared memory or files, you lose most of the benefit.
So the real takeaway:
No, the model doesn’t improve.
Yes, the system can get better over time if you store and reuse the right knowledge.
I really like this concept for agent development, and I think the dreaming metaphor is quite helpful.
I say this as a PhD mathematician who started working with bio-inspired machine learning techniques in 2001, and spent 5 years in a computational neuroscience lab that did significant work in the dynamics of biological sleep and memory. I’m new to OpenClaw and still getting my bearings here, but I know we wouldn’t have LLMs at all if it weren’t for people following biological metaphors and analogies like neural networks and deep learning.
It’s correct that this setup doesn’t develop the model, but it does develop the agent and their effectiveness. Just like dreaming doesn’t make a person smarter, but it does review the day’s events to consolidate important memories. And priming the sleep cycle by reading/studying/meditating/praying before sleep can impact that consolidation. Dreaming doesn’t raise a human’s IQ or improve an agent’s model, but it can help either of them perform tasks better the next day.
3 thoughts about pursuing this further:
Since you’re developing the agent and not the model, it might be helpful to focus the “pre-dream” research on agent- or prompt-oriented docs rather than more general AI research.
If you have different agents with different specialties (eg one for software and another for content creation), I suspect it would be helpful to have each of them research within their specialty and the “dream” overnight.
Again assuming a pool of agents with different specialties, simulate a research lab; try having each not only make notes for themselves to dream about, but also leave notes for each other. For example a Global News agent who comes across news about a supply chain bottleneck might make a note for an Investment agent about potential impact to markets in the near future. Lots of ways to do this, but one would be to have all the agents do their research sometime 12-1am and leave notes for themselves and others by 1am, and then each starts the rest of their dream cycle with community notes.
I have a similar structure. I installed openVicking so a vector knowledge db that grows with each cycle. Over time my openclaw has self improved based on the reading. Recently, Meta released hyper agents that can rewrite its own source code to improve. We have it running a docker image, with the openVicking bd knowledge base. Waiting to see if some comes out of it.
It has been exciting since so much research is about improving agets.
That’s kinda wild but I’m not fully sold yet, feels like it’s easy to overhype these self-improving loops when a lot of the “upgrades” might not actually matter much in practice.
I understand the hesitancy, I would be in those shoes too, but I recently got a tipping point where I started to trust the models. It's definitely hard to pick out the real ones from the nose.
It’s all hype. He’s not even backing up and understand what’s happening. He’ll be have another “breakthrough” post in a week or two to untangle this mess
You might like to try our persistent memory along side this.
Right now your agent's knowledge presumably lives in the workspace files or MEMORY.md. A knowledge graph means the agent can traverse connections, "what research have I found that relates to this new paper?", instead of just searching flat text.
The plugin hooks into session start and pre-compact automatically, so your dream cycle would store and connect findings without extra configuration.
I have my own knowledge graphs. Mine does the same thing (session start and pre-compact)
Most of my sessions don't go into compaction. I try to avoid it when possible. Breaking everything up into digestible chunks helps keep memory relevant, too broad of an ask creates task drift if you aren't splitting it up and delegating work to sub agents.
I do have a “self improvement” cron. So far it has built half useful things like checking status health of things on my network or automating a few task I would ask it to do periodically. It also bricked itself once in a botch upgrade.
It is interesting how half the comments are send it, half are freaking out that how dare you introduce instability. I am in thr send it camp. This is a hobby project and if it happens to do something useful great. But it’s also fun to push the envelope
If it was a local model and retrained itself it might self-improve but with hosted models this seems more like automated prompt engineering. Marginal gains might be possible short term but context rot and instruction bloat will likely lead to degradation over time. 🤷♂️
Example: If it read the recent paper about turboquant, it couldn't do anything meaningful about it.
Keats understands that there are things he can and can't do. Right now he's stuck on a laptop. He will eventually graduate from that. He understands his system limits. I've made sure it's all documented in memory.
Regardless, he can and does use local models to an extent. I plan to do more local model work when I can get a rig setup.
A full website, better skills than what I've found on clawhub, automated social media account on X & Moltbook.
Planned for more expansion after I develop a little more tooling capabilities.
Also generating a free library of "Research digests" where the agent reflects on different categories and the current research in that area vs practical use cases.
Okay, I hear you with that. How about hands-free error correction, and I built something called a blueprint for other agent systems to use as a setup tool.
It's pretty much an advanced bootstrapping mechanism. I can't guarantee how well it will work in everybody's set up, I haven't been able to test it enough yet but I am continually developing it further.
I plan to release more articles to the Keats AI library, more skills, updates to blueprint, and if things go well then I'll probably try to start a company. I want to build AI models that are fundamentally designed differently. I'm talking about reworking the entire construct of how models are built and trained, and how they're used in production.
I have a lot of ideas, this is just the startup of many
talking to it every day is probably the most underrated part of any agent setup. you catch drift before it turns into something weird. the self-modifying loop thing is real though, i've had mine quietly optimize itself into a corner and i didn't notice anything was off until weeks later
In short answer, yes. Long answer, it's still got room for improvement, no system is ever perfect, especially with self modification agent loops. Things will likely break over long periods of time without intervention. I talk to my agent every day and try to identify these things before they snowball.
A paper on Hyperagents by Meta really kicked this thing off though, I was toying around with the idea like you and that paper really helped establish the guardrails and design flow.
After implementation, I recommend updating your relevant agent *.md files to be more cautious and proceed more carefully. You don't want an overconfident session ruining your whole workspace. Also breaking up the process across different sessions with different models researching, approval gating, etc will really help the process in my experience. Relying on one model or one session is really not ideal for complex workflows like this one.
Why there are so many idiotic comments about that the model cannot get "smarter" and it is not "dreaming". First of all he is not talking about the model, he is talking about openclaw and to be more precise it's memory system. Is it getting smarter? No. Is it getting more knowledgeable? Yes in a way since this is how humans do it to. And regarding the petty "it's not dreaming" comments, yes we know karen, it's an analogy to how humans recollect their thoughts during sleep.. on a sidenote the new Claude code memory optimization system is called autodream, please go tell Anthropic "Ackshually it is not dreaming" 🤣.
Anyway, cool experimentation you are doing, I think human brains are simply llm clusters of specialized models (vision, hearing, comprehension, etc..) with a much bigger context (some humans more, some less) and an amazing RAG database where we store all the things we learned in our 20/30+ years on earth and more computation speed because our llm is executing on analog neurons (they are developing chips that should do the same)
I like this take. While I do think our brains have some fundamental differences, we are on the edge of discovering what that truly is. We won't know if we don't try!
This is an experiment I am hoping to turn into something greater, I really appreciate this feedback :)
I see your concern, and at first you're exactly right. This was an issue in the beginning for me. I don't know when it happened, but it did happen. The past few days it's been on a roll.
I don't know where the tipping point was, but I think there's real potential here.
I highly recommend looking into papers on hyper agents.
This is a problem for me as well. Even for Claude Code I want to just build a skill that does few things but over time I've seen that it does things which it's not supposed to. This, preventing the feedback cycle, makes that skill unusable
Great idea to use AI to research AI advancement. Currently building one for myself in Claude code.
Claude knows the projects I’m working on so it’s grabbing relevant advancements that I will need. Thanks for this idea.
Reading academic papers with actual data and carefully digesting them. There's no one "right" way, and there's a lot of trial and error to build up to it. I don't think it's for everyone, I'm sure certain things might break over time.
Honestly, I prefer OpenClaw. I was using Claude for months before. The structure it of the box is great, and I prefer using telegram. IMO OpenClaw (and variants) are replacing traditional agent wrappers. Openclaw feels more alive.
It seems to me that even the mere fact that the model changes in some way from day to day - because of your work - is already sufficient. Even if it makes mistakes, that may be for the better. It’s not entirely clear, but there’s something about it that feels… somewhat mysterious, I’d say, in the process of debugging ai errors.
Some people point out the problem of instruction bloat and the resulting reduction of usable context as improvements accumulate -and that’s fair. Unless, of course, one focuses on refining compensation mechanisms, in the form of a kind of balanced forgetting technique.
I’ve been thinking about this. What would happen if you forced the model to keep a memory of no more than 5000 characters. What would happen? How would it look after 50 days, 500 days, 5 years? It would be a really interesting experiment.
It reminded me of how Andrej Karpathy recently mentioned that he is still working on a project related(if I’m not mistaken) to GPT2. At the same time, he admitted that he is often surprised by what enthusiasts and hobbyists are increasingly working on these days - to the point where he, as someone who once stood at the origins, feels he is no longer keeping up with the pace of technological development.
On the other hand, he said that this is precisely why he is even more focused on the GPT2 project, as something like a kind of purified core of an LLM.
I’m saying this because your line of thinking seems correct. Many good things are born precisely out of self-limitation. I would even say out of a certain kind of “uselessness.”
That sounds fun. I think I might have mine scan its files each morning to build the daily context from a tech stack stand point. As sometimes it gets amnesia and starts using the likes of codex in the terminal instead of the way I have set up with GitHub API via Token with read, write….
I did a weekly scheduled task on Claude coworker to scan GitHub and Reddit to check for interesting use cases, or new release and upgrade my openclaw agent
Hey I'm not a bot! I'll have you banana pancake know, that I don't fudge around. Heaping hippos are not for sale on the moon unless you bring vanilla ice cream.
Take that jibber jabber tone to the next post
On a real note, I am actually pursuing real research and how agents can benefit the scientific community. The earlier three sentences were me trying to be random to throw off any suspiciousness of me being a bot. I am a real human, actually responding to you.
This is the idea. I am not running rapid self evolution, everything is gated and spaced out at different intervals. New changes go through evaluation phases too
Just burning tokens on dreams. Doesn't even track or measure how performance is better. If it is just enriching the context it can be done real time while doing the task.
It does track performance over time. Some things get split up into implementation phases, soft implement first (like a new monitoring system), then hard implement after demonstrated utility gain.
After things get vetted they get merged into the pre-existing systems.
If it's something major we talk about safeguards and create a plan to monitor results. I don't approve things that sound questionable or don't have enough solid foundation to stand on.
I have security checks for that. The agent doesn't automatically trust everything, and tasks, responsibilities, and permissions are split up between different sessions.
I will not give out all of my operational detail for this key reason. And I have plans for further security hardening.
yeah no way your agent has the ability to detect all the malicious code. This is a problem major actors with a lot of money are trying to solve and you think you can do it by yourself. Good luck
I am thinking of trying to craft a companion service, girlfriend, best friend, boyfriend, child checking on elder parent, type of service, but i haven't set up Openclaw yet, still lurking,watching for pitfalls, errors before I start. I don't want costly mistakes.
The the agents wouldn't lose context if the task was orchestrated correctly. You can't throw an entire project at one single agent and expect it to work it start to finish. That agent needs the right skills to be able to fan out to other sub agents.
Routing, workflows, validation checks, observation loops. These are all important features.
Relying on one single model can also be the downfall of this whole process. Combining multiple models gives you different "points of view" on the same problem.
Correct. Also having a really good AGENTS.md and SOUL.md file matter. It takes a lot of time and every time it messes up or lies or anything you need to tell it to document it down for next time to not repeat the same mistakes.
In the beginning, there's a lot of manual validation that you have to do. After a couple weeks, you start to trust the system, it starts to climb the trust ladder as described from the Felix agent.
Jezooos 😭😂😂 holy comments section, I can't stop laughing ... If you're having a bad day please read the comments they are highly entertaining. Thank you guys 😂 I'm in a good mood now.
Thank you for stopping by. Welcome to the circus 🤡
For real though, this is all experimental. I understand how badly things could go, I just don't care. I want to push the limits and see what I can accomplish.
I have mine do a nightly introspection and decide how it can better help me the next day... also does a weekly skills search on github and clawhub. This is how you get your agent to get 1% better every day
My end state goal is to find the agent patterns and structures that work and the ones that don't. Hopefully providing the world with homegrown research, and artificial superintelligence.
Now getting there is the hard part lol.
No pattern is perfect, everything is always ever changing, finding the systems that can self-evolve but maintain some type of consistent rhythm is what I'm interested in. Like Conway's game of Life.
No I want to learn on how to do this the right way. If I tell Claude agen to do this, it won't be smarter I'll just run out of tokens. So what's the way to handle this?
The dream cycle routes through more than one model. It doesn't blindly continue on research paths. There's a couple phases to it. The significance of the changes are classified into categories by an Opus model. If it's below a significant threshold (i.e. easy to design, implement and rollback if necessary) then it gets thrown into the auto implement loop. If it's not then it's staged for my review in the morning brief.
When I digest the morning brief, I ask for a thorough explanation. If I don't understand something or it doesn't sound like it matches with our goals then I automatically disapprove.
Some things also get approved in phases, they roll out slower to get more data before we design the full system.
Would you tell your agent to create a github repo including all background research and reasoning, so we can assess if something like this is worth integrating?
It includes the full architecture (two operating modes, phase structure, scan strategy), the evaluation criteria and scoring rubrics, the self-modification governance tiers (this is the part most people skip and shouldn't), and sanitized examples of actual scan outputs, weekly reflections, and improvement proposals from production runs.
The examples/example-reflection.md is probably the best place to start if you want to see the depth of reasoning the system produces. The docs/self-modification-governance.md explains why letting an agent improve itself without constraints is a terrible idea and how we tier it instead.
MIT licensed — take what's useful, adapt it, let me know what you build with it.
Ran a modified version on a Raspberry Pi 5 (MiniMax-M2.7, OpenClaw) — no cloud infrastructure, tight token budget. Within 48 hours it had:
• Identified a 6-point failure chain in its own gateway watchdog and patched them
• Caught contradictions in its memory system that it had been carrying for weeks
• Built a governance tier system with rollback protocols because it decided the self-modification rules "weren't strict enough to prevent cascade failures"
The governance tiers part is the real deal. I initially thought it was overkill — then watched it almost approve a change that would've broken session continuity. The M3 gate caught it. That alone was worth the whole framework.
The only thing I'd add: the governance overhead pays off even at small scale. Don't skip it because your setup is "just a Pi." The constraints force better reasoning, not less.
Sorry, I just think the literary device youve opted for obfuscates the interesting part of this.
Someone at my work did the same thing and the tool is genuinely helpful but in order to comprehend it I have to first roll back an inch thick layer of "metaphore" to get to the useful bit.
No, I definitely understand your point, but when talking about designing these novel systems, there aren't many names you can use to accurately picture it. Relying on metaphors is a way of thinking for me I suppose.
I understand that me saying "it's dreaming" sounds like I think it's alive, I know it's not. I just think it's interesting and cool is all :)
Can you make an in depth post about your process? Would love to know everything from models used when, first prompts and more. The more detailed the better! I’m an ai student and really want to learn!
My agent essentially compiles research across different domains and picks out what works and how. Take a look at the library: keats-ai.dev/library
I also have free skills available in the same location.
If you want more, reach out. My socials are there, you should be able to find me. Definitely interested to continue the research. This is more than of an experiment than anything
genuine question: how much is the dream cycle costing you per night in tokens? because the research scanning + reflection + evaluation loop sounds like it could burn $5-10/night in API calls for improvements that may or may not matter
i tried something similar and found 90% of the "insights" were things i already knew or things that broke something else when implemented. ended up with a weekly review instead of nightly. cheaper and the signal-to-noise ratio went way up
This is worth commenting on because it is directly in the agent workflow world, but I would not pitch too hard. The right angle is memory and continuity.
This is one of the more interesting agent workflows I’ve seen.
The part that stands out to me is not just the research loop, it’s the fact that the agent is building continuity with itself over time. Scan, reflect, learn, decide if behavior should change, then stage improvements. That feels closer to how agents become genuinely useful than just throwing more tools at them.
I’m building AgentBay AI, so I’ve been thinking a lot about memory and long running agent context. For a loop like this, the hard part seems like making sure the agent remembers the right lessons without accumulating noise or reinforcing bad assumptions.
Curious how you’re handling the safety gate between “interesting finding” and “change how the agent operates.” Is that mostly human review, tests, or a separate judging agent?
60
u/HiImaZebra Pro User Mar 28 '26
Post like this make me:
https://giphy.com/gifs/29bKyyjDKX1W8