Guide · Agent skill
How to use the Memory Search (SQLite Trajectory DB) agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The memory-search skill lets an AI coding agent run read-only SQL queries against the local database where MiMo Code stores its past sessions, including tool calls, errors and messages. It is for developers who use the MiMo Code CLI and want the agent to analyse its own history in ways plain text search cannot. After this guide you will know what the skill does, how to install it, how to ask for it in plain language, and what to watch for.
Quick start
- 1Get the ZIP. Download the memory-search ZIP from this page.
- 2Unzip the skill. Unzip the archive so that the memory-search folder with SKILL.md is in place.
- 3Copy it to a skills folder. Place the folder in ~/.claude/skills/ for personal use, or in your project's .claude/skills/ folder.
- 4Confirm sqlite3 and the database. Make sure the sqlite3 tool is installed and that the mimocode database exists at the default path or at the MIMOCODE_DB location.
- 5Ask a natural question. Describe the analysis you want, such as counting repeated errors or verifying a past command.
- 6Review the query. Check that the agent's SQL is read-only and uses LIMIT or a session or time filter before you accept the results.
What is an agent skill and what does memory-search do?
An agent skill is a folder containing a SKILL.md file that gives an AI agent extra instructions and resources for a specific kind of task. The agent reads the skill's description and loads the full instructions when a request matches it.
The memory-search skill is for cases where the built-in memory and history tools are not enough. Those tools search curated markdown and raw messages as text. This skill gives the agent the database schema and ready-made SQL templates so it can count repeated failures, group tool calls by pattern, view the full execution chain of a session, and check what was actually executed against what it remembers.
Install the memory-search skill
Download the ZIP for this skill from this page and unzip it. For a personal install, place the skill folder in ~/.claude/skills/. For a single project, place it in that project's .claude/skills/ folder.
In the Claude apps you can instead upload the skill under Settings → Capabilities → Skills.
- Personal install: ~/.claude/skills/memory-search
- Project install: <your-project>/.claude/skills/memory-search
Check the requirements before you start
The skill needs the sqlite3 command-line tool and a local mimocode database. By default the database is at ~/.local/share/mimocode/mimocode.db. If you set the MIMOCODE_DB environment variable, the skill uses that path instead.
The skill is specific to MiMo Code. If you do not run MiMo Code, the database path and schema will not match your data.
- sqlite3 command-line tool installed
- Local mimocode database at ~/.local/share/mimocode/mimocode.db, or the path in MIMOCODE_DB
sqlite3 -readonly ~/.local/share/mimocode/mimocode.db ".tables"How to trigger the skill with natural requests
You do not need to name the skill. Ask for the kind of analysis you want across sessions, and the agent will match the request to the skill's description. Requests that involve counting, grouping, filtering by tool or status, or verifying a past command tend to work best.
If the agent answers from memory and you want it checked, say so directly, for example by asking it to verify the claim against the database.
- Which tool has failed most often in the last week?
- Find every session where I said I wanted a rule about formatting.
- Show me the full tool sequence from session ses_xxx.
- Did we actually run the migration command, or only talk about it?
- Group the repeated bash errors from the past 7 days.
What the query templates cover
The skill includes templates for listing recent sessions for a project, finding user messages containing a keyword, finding tool calls by tool name, viewing a session's full execution chain, and finding repeated errors from bash calls or from any tool over the last 7 days. It also lists search strategies for goals such as finding a stated preference, a design decision, or a recurring workflow.
The templates use json_extract() because message and part data are stored as JSON text. Tool failures are recorded with status error and the message in the error field, so they are queried differently from completed calls.
- Recent sessions for a project
- Messages containing a keyword
- Tool calls by tool name, with status and result preview
- Full execution chain for one session
- Repeated bash output errors and repeated tool failures over 7 days
Safety, privacy and performance notes
The skill asks the agent to use sqlite3 -readonly or SELECT queries only, and never to modify the database. It also says the database can be several gigabytes, so queries should use LIMIT and filter by session_id or a time range.
The skill runs scripts, which means the agent executes sqlite3 commands on your machine. It does not use the network. Raw trajectories contain everything the user typed and may include secrets printed in tool output, so do not point the agent at sensitive projects if that content should stay out of its context.
- Runs scripts: yes (sqlite3 queries on your machine)
- Uses network: no
- Read-only by design; it is not a tool for cleaning up or editing history
What people use it for
- Finding which tool fails most often across recent sessions
- Grouping repeated bash error output to spot a recurring environment problem
- Checking whether a command the agent remembers running was actually executed
- Pulling the full tool sequence of one past session to review what happened
- Locating a rule or design decision you stated earlier in a session
Frequently asked questions
How do I install the memory-search agent skill?
Download the ZIP from this page and unzip it. Put the memory-search folder in ~/.claude/skills/ for personal use, or in your project's .claude/skills/ folder. In the Claude apps, you can upload it under Settings → Capabilities → Skills.
What does the memory-search skill require?
It requires the sqlite3 command-line tool and a local mimocode database. The default path is ~/.local/share/mimocode/mimocode.db, or you can set the MIMOCODE_DB environment variable to point elsewhere.
Is the memory-search skill free?
The skill is listed under the MIT licence. The source does not state any price, so check the licence text in the repository for the terms.
Can the skill change or delete my session history?
No. The skill tells the agent to use sqlite3 -readonly or SELECT queries only and never to modify the database. It is for analysis, not for managing or cleaning up stored history.
Does memory-search work with tools other than MiMo Code?
Not as written. The database path and schema are specific to MiMo Code, so the skill will not match data from other tools.
Why does the agent say the database query failed or returned nothing?
Check that sqlite3 is installed, that the database exists at ~/.local/share/mimocode/mimocode.db or at your MIMOCODE_DB path, and that session or time filters are not excluding your data. The skill also expects the JSON fields described in its schema notes.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use memory-search if you run MiMo Code and want the agent to analyse its own past sessions with read-only SQL, such as counting recurring failures or verifying what was really executed. Skip it if you do not use MiMo Code, want to edit or clean up history, or work on projects where past session content, including any secrets printed in tool output, should not be read by an agent.
Download the skill