Agents

Xiaomi Open-Sources MiMo Code: A Free Terminal-Based Coding Agent with Persistent Memory

Xiaomi has released MiMo Code V0.1.0, an open-source terminal coding agent designed to solve context exhaustion in long-horizon programming tasks.

A
AIDeveloper44 Team
June 11, 2026·4 min read
Xiaomi Open-Sources MiMo Code: A Free Terminal-Based Coding Agent with Persistent Memory

Xiaomi's MiMo Code introduces persistent memory and dynamic workflows for long-horizon AI coding tasks.

As AI coding assistants transition from generating single functions to managing multi-file, long-horizon software projects, developers are hitting a familiar wall: context window exhaustion. To solve this, Xiaomi's MiMo team has officially released MiMo Code (V0.1.0), an open-source, terminal-based coding agent built on top of the OpenCode framework. Released under the MIT license, MiMo Code fundamentally restructures how AI agents handle compute, memory, and continuous evolution.

1. Computation: Scaling Single-Turn Reasoning

When a programming task requires dozens or hundreds of execution steps, a single error can derail the entire session. The agent often lacks external corrective signals during these long horizons. MiMo Code tackles this by dynamically scaling test-time compute:

  • Max Mode (Parallel Sampling): Instead of relying on a single inference path, Max Mode generates five candidate solutions in parallel. The model acts as a judge with a temperature of 1, evaluating the reasoning and action plans of all candidates to select the most robust path. While this consumes 4-5x more tokens, Xiaomi notes a 10–20% performance boost on SWE-Bench Pro compared to single sampling.
  • Independent Completion Verification (Goal): AI agents notoriously suffer from premature termination, declaring a job "done" before verifying all constraints. MiMo Code introduces an independent verifier model that reviews the full conversation history to confirm whether user-defined stopping conditions (e.g., "all tests pass and the code has been committed") have actually been met.
  • Dynamic Workflows in Code: Instead of orchestrating agents with ambiguous natural language prompts, MiMo Code utilizes Dynamic Workflows. Main agents generate deterministic JavaScript scripts executed in an isolated sandbox, utilizing commands like agent() and parallel() to dispatch sub-agents, handle retries, and manage concurrency flawlessly without forgetting branches.

2. Memory: The Cure for Context Exhaustion

Standard agents treat conversation history as working memory. Once the context window fills up, they rely on basic compression, which weakens distant information. MiMo Code introduces an entirely different paradigm designed around unbounded sessions.

The Checkpoint Writer Subagent

Asking a main agent to debug complex code while simultaneously maintaining its own structured logs usually leads to poor performance on both fronts. MiMo Code solves this by offloading memory management to an independent writer subagent. To prevent the "lost in the middle" degradation—where LLMs fail to extract data from nearly full context windows—checkpoints are triggered incrementally at roughly 20%, 45%, and 70% of the window limit.

The Four-Layer Memory Architecture

Memory is split into four distinct, hierarchical layers:

  1. Session Memory (checkpoint.md): The active working state of the current logical session.
  2. Project Memory (MEMORY.md): Persistent, user-editable Markdown files detailing project background, architectural rules, and verified technical facts.
  3. Global Memory: User-level preferences applied universally across all projects.
  4. History: A raw SQLite trace of every message and tool call for fallback retrieval without indexing.

When the physical context window nears its limit, the runtime performs a "rebuild." It seamlessly pieces together the persisted files, injecting a layered prompt—capped at ~65K tokens—into a fresh window. From the model's perspective, the session has never been interrupted.

3. Evolution: Continuous Improvement

If all experience resets after a session, the agent will endlessly repeat the same mistakes. MiMo Code's Project Memory ensures that architectural rules and fixes span across sessions. However, to prevent these memory files from bloating with duplicate or outdated entries, Xiaomi introduces the /dream mechanism.

Triggered automatically every 7 days, Dream launches an independent maintenance agent. This agent reads historical session conversations, cleans up project memory, verifies file references, removes duplicate records, and distills raw experience into refined, reusable knowledge.

Looking Ahead

By decoupling memory extraction from the main agent loop and moving orchestration from prompts to executable code, Xiaomi is tackling the hardest challenges in autonomous software engineering. According to benchmark claims accompanying the release, MiMo Code achieves a 62% on SWE-Bench Pro and 73% on Terminal Bench 2, outperforming Claude Code by around five percentage points while using the same base model. With its MIT license allowing developers to avoid vendor lock-in, MiMo Code represents a major structural leap for the open developer community.

Enjoyed this?

Get more posts like this delivered to your inbox.

🚀 Join the AI dev community — follow us everywhere

© 2026 MARKTECHPOST AI MEDIA INC. All rights reserved.Terms & ConditionsPrivacy Policy
Beta Mode