
Memory Search
Query the raw trajectory SQLite database directly when the built-in memory and history...
Install
npx skills add XiaomiMiMo/MiMo-Code --skill memory-search -g -a claude-code -y- Repository
- XiaomiMiMo/MiMo-Code13.7k
- Category
- Data and ML
- Updated
- 3d ago
- License
- MIT
- Context cost
- Mediumabout 1,728 tokens
- Runs scripts
- No, instructions only
What it does
Query the raw trajectory SQLite database directly when the built-in memory and history tools are insufficient. Use when you need structured analysis across sessions: finding repeated errors, grouping tool calls by pattern, verifying what was actually executed, or locating specific past commands/decisions that text search cannot surface. Provides the database schema, ready-to-use SQL query templates, and per-goal strategies.
Memory Search: SQLite Trajectory Database
Direct SQL access to mimocode's trajectory database for structured analysis that the memory (BM25 over curated markdown) and history (FTS over raw messages) tools cannot perform, aggregation, filtering by tool/status/time, cross-session pattern detection, and execution chain inspection.
When to use
- You need to aggregate or count across sessions (e.g. "which tool fails most often?", "how many sessions touched file X?").
- You need to filter by structure, tool name, status, agent_id, time range, not just text content.
- You need to view a complete execution chain for a session (every tool call in order).
- You need to verify a memory claim against what actually happened (the DB is the source of truth).
- The
memoryandhistorytools returned nothing useful despite multiple query attempts.
Locating the database
# Typically at this path. MIMOCODE_DB env var overrides if set.
sqlite3 -readonly ~/.local/share/mimocode/mimocode.db ".tables"
Always use -readonly or only SELECT queries, never modify the database.
Schema
| Table | Purpose | Key columns |
|---|---|---|
session | Session metadata | id, project_id, title, time_created, parent_id |
message | User/assistant turns | id, session_id, agent_id, time_created, data (JSON: $.role) |
part | Message parts (text, tool calls, steps) | id, message_id, session_id, time_created, data (JSON) |
task | Task tree | id, session_id, summary, status |
task_event | Task state transitions | id, session_id, task_id, at, kind, summary |
actor_registry | Subagent/peer history | session_id, actor_id, agent, mode, status, description |
