OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Feature]: Add a MiMo / MiMoCode ingest harness source

Open zhangzhangco opened this issue 2 months ago • 0 comments

Observed or reproduced in a real environment.

Problem Statement

Xiaomi MiMo Desktop / MiMoCode stores conversations in a local SQLite database (~/.local/share/mimocode/mimocode.db, WAL), not in append-only JSONL. There is currently no ingest harness source for it, so MiMo sessions cannot be replayed into OpenViking memory.

Schema (MiMoCode desktop-5198ff5, still OpenCode-family):

  • session(id, title, directory, version, time_created, …)
  • message(id, session_id, agent_id, time_created, data JSON)
  • part(id, message_id, session_id, time_created, data JSON)

message.time_created is epoch milliseconds. Conversation text lives in part rows with type == "text".

Three pollution traps on a real corpus that a naive adapter hits:

  1. Every user message.data carries a full system prompt in system (~28 KB).
  2. Host-injected context is written as part rows with type=text and synthetic=true (runtime notes, MCP tool lists, skill bodies).
  3. Residual <system-reminder>…</system-reminder> can still appear inside a non-synthetic text block.

Proposed Solution

Add a mimo harness source based on the existing SqliteLogSource base (same (time_created, id) cursor model as opencode):

  • discover sessions from session
  • read message rows with agent_id = 'main'
  • reassemble text from non-synthetic part.type == "text" only
  • strip residual <system-reminder> blocks
  • treat an assistant row as complete only when time.completed or finish is set
  • default path ~/.local/share/mimocode/mimocode.db

Register it in openviking/ingest/sources/__init__.py and document it in docs/{en,zh}/agent-integrations/09-log-ingestion.md.

Expected config:

{
  "ingest": {
    "enabled": true,
    "harnesses": {
      "mimo": { "enabled": true, "mode": "both" }
    }
  }
}

Alternatives Considered

  • Manual add-memory / remember only — not automatic, does not cover history.
  • Treating the DB as a generic SQLite dump without filtering synthetic parts — archives host system prompts as memory.

Feature Area

Session Management

Use Case

A MiMo Desktop / MiMoCode user enables ingest.harnesses.mimo and backfills local sessions so OpenViking can extract long-term memory from those conversations, then watches for new turns.

Example API (Optional)

No public API change. New registry name mimo only (IngestConfig.harnesses is already a free-form dict).

Additional Context

Local dry-run against a real MiMoCode DB: 4 sessions / 48 messages; after stripping, 0 messages retained host system-prompt or system-reminder text. Assistant peer shape matches existing convention ({harness}__{provider}__{model}).

Contribution

  • [x] I am willing to contribute to implementing this feature

zhangzhangco avatar Sep 17 '26 08:09 zhangzhangco