IA al Día
the efficient way to stay informed
Back to archive
Tools June 12, 2026 explainer 8 min read

Memory that doesn't forget: how Xiaomi's MiMo-Code is changing coding agents

Xiaomi launched MiMo-Code, a coding agent with persistent cross-session memory based on markdown files and SQLite search. With "dream" and "distill" commands, the agent learns, compacts, and auto-extracts skills every 7 days. Here's what it means for the future of coding agents.

Memory that doesn't forget: how Xiaomi's MiMo-Code is changing coding agents
By IA al Día

If you use AI coding assistants, you know the frustration. You finish a long session — debugging, refactors, exploring a new codebase — and the next day the agent opens a blank terminal. It remembers nothing. It doesn’t know what you decided about the architecture, what rules you agreed on for the project, or why you discarded that library after two hours of testing.

Every session starts from scratch.

That problem — the blank slate — is the Achilles’ heel of today’s coding agents. And Xiaomi just released something that takes it head-on.

The memory problem in coding agents

The most well-known code assistants work with ephemeral context. You open a conversation, the agent receives the current project state and a few previous messages, but as soon as you close the terminal, everything is lost. The model has nowhere to store what it learned.

There are partial solutions — instruction files, per-project rules, predefined prompt systems — but none allow the agent to accumulate knowledge organically as it works. Everything it discovers in a long session (which modules have coupling issues, what pattern you decided to follow, which functions are deprecated but still in use) disappears when the context expires.

Xiaomi asked: what if the agent could write its own memory?

How MiMo-Code works

MiMo-Code is a terminal-native coding agent that Xiaomi released as open source (MIT license) on June 10, 2026, based on a fork of OpenCode. Its core idea is simple but powerful: instead of relying only on the model’s context window, the agent persistently writes to markdown files inside the project repository and uses them to reconstruct its state when it comes back to work.

The system has three types of memory:

MEMORY.md — the main file. Here the agent stores persistent project knowledge: architecture decisions, style rules, details about how the code is organized, important dependencies, warnings. It’s what the agent “knows” about the project and shouldn’t forget between sessions. It’s designed to be human-readable — you can open it and see exactly what information your agent retains.

checkpoint.md — a structured snapshot of the current session state. A checkpoint writer subagent decides when to save based on the model’s context size. When you resume a session, the agent reconstructs context from the most recent checkpoint, combining it with MEMORY.md, task progress, and recent retained messages.

notes.md — a temporary notes area the agent uses for quick memos during a session. It’s not designed to persist across projects, but to give the agent a scratchpad where it can jot down ideas without cluttering permanent memory.

Tasks (tasks/<id>/progress.md) — progress logs per individual task, allowing the agent to resume half-finished work knowing exactly where it left off.

All of this information is indexed with SQLite FTS5 (Full-Text Search), enabling the agent to efficiently search its own memory when it needs to retrieve a specific detail. And everything is readable markdown — you can open the files, edit them by hand if you want to correct something, or simply read what the agent has learned about your project.

The key is intelligent injection: MiMo-Code doesn’t stuff all the memory into every model call. It uses a token budget to control how much checkpoint, memory, and notes content enters context, prioritizing what’s most relevant based on the current task.

Dream: the agent that dreams every 7 days

The name sounds poetic, but “dream” is a fairly practical maintenance mechanism.

Every 7 days — automatically, without the user asking — MiMo-Code launches an independent agent that reviews recent session history and the current memory file. What it does is essentially cleanup and compaction:

  • Deduplicates: if there’s repeated information across several memory entries, it merges them into one.
  • Validates paths: if any file or directory references have changed (due to refactors, moves, renames), it updates them.
  • Compresses: reduces memory verbosity, keeping only what’s relevant and discarding noise from past sessions.
  • Extracts persistence: identifies which information from recent sessions deserves to move into MEMORY.md and which should be discarded.

It’s like the agent “sleeps” on what it has learned, consolidates its memories, and discards the superfluous. No manual intervention. The result is that memory doesn’t grow indefinitely — it stays compact, relevant, and up to date.

Distill: turning repetitive work into skills

If dream is the passive consolidation process, distill is the active extraction of reusable knowledge.

Distill is a command you invoke manually. Its job is to analyze the agent’s recent work, detect recurring patterns (manual workflows you do often, command sequences you always run together, configurations you set again and again) and package them as reusable skills.

Specifically, distill can generate three types of output:

  • Skills: capabilities the agent can execute on demand, encapsulating repetitive steps into a single instruction.
  • Subagents: specialized agents created to handle complete recurring tasks.
  • Custom commands: shortcuts for action sequences that previously required multiple manual steps.

The promise here is that an agent you use for weeks or months becomes more efficient over time — not because the underlying model improves, but because it accumulates an ever-richer repertoire of knowledge artifacts specific to how you work.

What the 65% effectiveness really means

Xiaomi published results from a double-blind A/B study with 576 developers across 474 private repositories, comparing MiMo-Code with Claude Code. The numbers are interesting:

On tasks under 200 execution steps, both agents perform practically the same — around 50% preference for each. That makes sense: on short tasks, ephemeral context is sufficient. You don’t need persistent memory to fix a small bug or write a function.

But when tasks exceed 200 execution steps, the scales tip: MiMo-Code wins with over 65% preference. That’s a significant jump, directly attributable to cross-session memory. When work stretches across hours or days, remembering what was already done and what was learned makes all the difference.

It’s important to put this in context: the study is from Xiaomi (self-reported) and the tool has barely been public for days. There’s no independent replication yet. But the methodology — double-blind, with human judges, on real repositories — is solid, and the sample size (576 developers) is respectable.

There’s also a complementary metric: SWE-bench reports 57.2% for MiMo-Code, a respectable but not revolutionary number. The 65% isn’t a standard benchmark, but a measurement of human preference on real-world tasks — which is ultimately what matters.

Connection to the open source ecosystem

MiMo-Code didn’t come from nowhere. It’s a fork of OpenCode, an existing open-source coding agent. Xiaomi took that foundation and added the memory system, dream/distill commands, the subagent system, and three operation modes (build, plan, compose).

This matters for two reasons.

First, because OpenCode already had a community and a battle-tested codebase. Xiaomi didn’t reinvent the wheel — it integrated persistent memory into a functional agent and released it back to the community as MIT. Any project derived from OpenCode can potentially benefit from these ideas.

Second, because this move validates a strategy: instead of competing on the base model (where the barrier to entry is astronomical), you can compete on the agent architecture — how it manages context, how it persists knowledge, how it automates its own maintenance. It’s a promising direction for the ecosystem.

What this means for the future

MiMo-Code signals a clear direction for coding agents: persistent, self-managed memory is going to be a key differentiator.

Today, most code assistants are “dumb” between sessions. Tomorrow, agents that learn and retain knowledge will have a qualitative advantage on large projects. Not because the model is smarter, but because the system around it is more sophisticated.

Some implications worth watching:

Long-lived projects, agents that age well: an agent that works on the same project for months accumulates contextual knowledge that no initial prompt can match. It knows where the antipatterns are, what conventions are used, which parts of the code are fragile.

More natural human-agent collaboration: when the agent remembers past conversations, the interaction feels more like working with a colleague than querying a search engine every time. You don’t have to repeat context.

Maintenance automation: dream and distill show that agents can maintain their own memory without human intervention. The direction toward more autonomous agents runs through here.

Risk of memory debt: there’s also a less bright side. If memory gets corrupted (incorrect information persisting through dream cycles), grows without control, or if the agent relies too much on outdated recollections, it can create new problems. Memory quality management will be an important area.

For now, MiMo-Code has just been born. But it has put a marker on the map: coding agents that remember are going to be the norm, not the exception. And Xiaomi’s “dream” every 7 days might be the first step toward agents that truly learn from experience.


Main source: Xiaomi — MiMo-Code GitHub

More in this category