AI Employees that learn in their sleep: Dream RSI in the enterprise

AI that improves itself is no longer just an idea. In research labs, AI systems now get better at a task by studying their own past attempts, with no one retuning them. Researchers call this recursive self-improvement, or RSI: an AI that uses its own results to get better, round after round.
Most AI agents at work today don’t do this. They’re as good on day 100 as on day 1, unless someone tunes them. But the best people keep learning from past work, and AI agents should too. One recent approach, Dream RSI, shows how they can learn the way people do: in their sleep.
But an AI that learns on the job also needs to know when not to act on what it learned. That’s the difference between dreaming and sleepwalking.
Today's self-improving AI learns in a closed room
Most research on self-improving AI follows the same loop. The AI tries many versions of a solution. A program scores each one. The AI keeps the best outcome and builds on it.
In newer work, the AI makes hundreds of attempts at a problem, and each one gets a score. Afterward, it studies that record the way a chess player reviews past games. It works out which attempts were worth building on, without running anything again. The paper behind it calls this Dream RSI. On some tasks, like writing faster code, the dreaming AI matched the results of an identical AI that never dreamed, using about half the attempts.
It works because the problems live in a closed room:
- Nothing gets out. Each attempt runs in a test setup. If it goes wrong, nobody’s paycheck changes.
- Little can change. Each attempt is a few files, so the system can save a full copy after every one.
- Scoring is instant. A program says right away whether the attempt got better.
The problems are puzzles, like making code faster or solving a math problem.
A company isn’t a closed room. When an AI agent acts, it changes real records, paychecks and inboxes. In a real company, people score the work, and their feedback can take days. That feedback is one of the most important things to learn from.
Real work breaks what today's research takes for granted
Now try the same approach on real work in HR, IT or finance. Each of these gets much harder:
- Grading work is harder. No program can tell you if an answer to an employee was right. People, reviews and later outcomes do. A ticket reopened three days later is a grade. It shows up late, but it's real, and that makes it worth far more than any simulated result.
- You can't undo real actions. An offer letter that’s sent stays sent. A payroll change lands in a paycheck. You can't try ten versions and keep the best one.
- You can't capture the whole system after every try. A company's state lives across HR, IT and finance systems, inboxes and approvals. It's full of personal data too. Saving a copy of all of it after each step isn't possible.
- You only learn from the paths you took. If the AI agent sent an employee a fix-it guide for a broken laptop, you never see whether a replacement would’ve gotten them working sooner. The other option stays a guess.
- It's hard to know why the results changed. Policies change and vendors upgrade systems. At the same time, your own team tweaks things. When results move, the cause is tangled.
- Most knowledge lives outside the model. Policies, org charts, system records, expert know-how and how each person likes to work. A model alone has none of it.
- Cost and speed matter as much as quality. A slightly better answer that costs five times more isn't better. Every company draws that line in a different place.
So AI that improves itself has to be built differently for real work.
The Enterprise Context Graph is where the learning lives
Every action, decision, review and piece of feedback is a lesson. Most AI systems throw those lessons away when a task ends. At Ema, the Enterprise Context Graph keeps them, for every AI agent we run, which we call AI Employees.
In human terms, that’s knowledge and experience, and the difference between having read the handbook and having actually done the job. It connects what many AI Employees learned, across weeks and months, so a pattern no single AI Employee could see shows up across all of them.

The first four sources are what Ema knows. The fifth is what Ema does. We call each record of it a decision trace.
For example, a leave request came in. The AI Employee checked the current leave policy and the employee's country. It weighed two options: approve it, or send it to the manager. It approved it, and the manager later confirmed. The trace keeps all of that, plus what it cost and how long it took.
That choice, act alone or ask a person, follows a set threshold. Moving that threshold is one of the changes a dream can suggest.
That record helps with each of the problems above.
| Problem in an actual enterprise | What the Enterprise Context Graph does |
|---|---|
| Grading work is harder | Stores every review, approval, correction and later outcome next to the decision it grades |
| You can’t undo real actions | Puts a person’s approval in front of risky writes to your systems. Every approval, edit and rejection becomes a lesson, so Ema needs fewer of them over time. |
| You can't capture the whole system | Records what each AI Employee saw and did, with links to the source systems, not copies of them |
| You only learn from the paths you took | Records the choice made, and the other option when the AI Employee weighed one. Human feedback then shows whether the choice was right. |
| It’s hard to know why the results changed | Tags every record with the AI Employee, policy, model and skill versions in use. Regular evals against your golden dataset, a set of questions with answers your team approved, catch drift from data or setting changes before it piles up. |
| Most knowledge lives outside the model | Connects to your systems, where your data stays. It keeps enough from each interaction to make every decision trace meaningful |
| Cost and speed matter as much as quality | Tracks the cost and time of every step |
Ema sleeps on the day’s work: consolidates, dreams, never acts
Nearly every animal sleeps, from fruit flies to whales. Mammals and birds also have REM sleep, the stage where most dreaming happens. Sleep isn’t downtime. It’s when the brain does some of its most important learning, and it comes in two kinds.
- NREM sleep is the deep, quiet part. Your brain replays the day and stores what matters as long-term memory.
- REM sleep is when vivid dreams happen. Your brain mixes memories and rehearses things that never happened. Your body is paralyzed during REM, a state called atonia, so you don’t act out your dreams.
Ema learns the same way, except it never goes offline. Your AI Employees keep working while a separate process does this in the background.
NREM: Ema replays the day and keeps what worked
NREM is where Ema makes sense of what happened. It's the more important stage, because every lesson comes from real work.
It works through the day's decision traces:
- Finds patterns. Managers keep sending back leave requests from one country. Something in the policy lookup is off.
- Clears out noise. Ema ignores one-off failures and work done under an old policy, so they don’t teach the wrong lesson.
- Turns repeat fixes into skill suggestions. If HR staff keep correcting the same step by hand, Ema suggests that fix to the AIE admin as a new workflow step.
- Flags stale knowledge. A policy document that's been replaced stops ranking first.
- Spots gaps. Ema counts and groups the requests no AI Employee could handle. Each group is a chance to automate something new.
- Ranks what to fix first. Each gap is weighed by how often it happens and how much it hurts.
That ranked list is what REM works on next.
REM with atonia: Ema rehearses what could happen, and can't act on it
REM explores choices nobody made. That's where new ideas come from, and also where the risk is, so it has to happen somewhere safe.
Ema has three ways to rehearse. They run from most real to most imagined.
- Check a new rule against past decisions. Ema takes a rule it might change and tests it on decisions already in the Enterprise Context Graph. Say every expense under $500 went to a manager, and managers approved nearly all of them unchanged. Ema checks which of those a new auto-approve rule would’ve passed, and which ones a manager actually caught. No AI Employee runs again. It’s a lookup over real decisions and real outcomes, so the results are solid. The reach is narrow, because it only works for rules the traces can answer.
- Re-run past requests on recorded inputs. Ema replays real past requests with the same documents and system responses the AI Employee saw, saved in the decision trace. Say last month’s benefits questions get re-run on a smaller, cheaper model. Ema compares each answer with what people confirmed, then runs the model on your golden dataset. It suggests the switch only if the model passes. This works best for questions and lookups. It doesn’t work for tasks that change your systems.
- Imagine it with AI. Some situations never show up in a trace. Ema writes them as scenarios and plays them out. What if a new hire's start date moves after the laptop is ordered? Ema finds the onboarding workflow never cancels the order. This is the broadest method and the most experimental. Its output is a new test case and a proposed fix.
Atonia holds in all three. Checking a rule only reads records. Re-runs use recorded inputs, never live systems. Imagining runs nothing. So REM produces proposals with evidence, never actions.

Each proposal carries its evidence level, and the bar rises as the evidence gets weaker. A rule check or a re-run on recorded inputs is already backed by real work. An imagined fix also needs its new test case added to your golden dataset before it can pass evals.
Every proposal lives in one place
Dreams never edit an AI Employee directly. Each proposal is for a specific AI Employee and lives in the Enterprise Context Graph as it moves from proposed to evaluated to approved. The AIE admin then applies it, as a live trial or directly.
- One place to review. Every proposal, its evidence and its eval results sit in the graph.
- One place to trace. Each decision trace shows which AI Employee, model and policy version it used.
- One place to roll back. Undo one applied change, and the AI Employee is back where it was.
Bigger changes, like new skills or workflows, go to the AIE admin as suggestions to build.
Dreams change how the model is used, not how it's trained
A dream can propose any of these changes. Every proposal goes through the Enterprise Context Graph and needs the AIE admin’s approval. The admin can then apply it to an existing AIE, or use it to create a new AIE or workflow.
| Area | Change | Example |
|---|---|---|
| Models and cost | Pin a model to a task | Keep payroll questions on one tested model, so answers don’t shift when a new model ships |
| Models and cost | Switch to a cheaper or faster model | Move simple benefits questions to a smaller model once quality holds |
| Models and cost | Use batch mode when a provider offers it | Run overnight reports through a provider’s batch option at a lower price |
| Models and cost | Set cost and time limits per task | Cap what a single benefits question can spend |
| Knowledge | Change which source wins | When the employee handbook and an old FAQ disagree, the handbook ranks first |
| Knowledge | Restructure the graph | Merge duplicate records of the same policy, or link a policy to the teams it covers |
| Knowledge | Retire stale knowledge | Stop using last year’s travel policy |
| Knowledge | Add or promote a memory | One manager’s preference becomes a team default |
| Rules | Change routing | Send equipment requests to the IT AI Employee |
| Rules | Adjust when to ask a person | Auto-approve small expenses, or add a check before payroll changes |
| Rules | Change retry and fallback rules | Wait and retry when the HR system is slow |
| Testing | Add test cases | Every caught failure and every imagined what-if becomes a test |
| Skills and workflows | Turn repeat fixes into skills | A correction HR staff keep making by hand becomes a workflow step |
| Skills and workflows | Update a skill’s steps or instructions | Ask for the cost center before the approver, not after |
| Skills and workflows | Propose a new workflow or AI Employee | Unhandled parking-pass requests become a new workflow |
Ema doesn’t retrain the model. It changes which model handles a task, what information it can draw on and how work flows around it. In technical terms, every change is non-parametric: the model’s weights never change.
The part of Ema that proposes a change never approves its own work. A trial rolls out only if it beats the current version on quality, cost and speed, weighed the way your company sets them.
Memory changes get the same test, because a memory in the graph shapes every task the AI Employee runs after it. Say one payroll answer gets corrected, and the AI Employee saves the lesson “check payroll questions with a person.” It may then send every payroll question to a person, even the easy ones it used to get right. So each new memory has to prove it helps on real work before it spreads.
AI Employees that wake up better, without sleepwalking
As your AI Employees work, their decision traces build up the Enterprise Context Graph. Dreams learn from it and turn what they find into proposals. That’s how your AI Employees get better the longer they work.
In a real company, this only works with a home for learning that spans every AI Employee and every source of knowledge, plus an approval step no dream can skip.
Ask any AI vendor you're talking to where its learning lives and what stops its AI from acting on its dreams. Then ask us.
