본문으로 건너뛰기
Skillpedia
에이전트14k · #11332

memory-search

하는 일

이 스킬은 저장된 코딩 세션 기록에 대해 읽기 전용 데이터베이스 질의를 실행하게 합니다. 일반 텍스트 검색으로는 보이지 않는 과거 작업의 패턴을 찾으려는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓여러 세션에서 어떤 도구나 명령이 몇 번 실패했는지 세고 싶을 때.
  • ✓과거의 특정 명령이나 결정을 찾아야 할 때.
  • ✓한 세션의 전체 작업 순서를 보고 싶은 경우.

스킬 링크

https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/memory-search/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/memory-search/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“지난 코딩 세션에서 어떤 도구가 가장 자주 실패했는지 알려 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 세션 데이터베이스를 읽기 전용 모드로 열고 테이블에 SQL 질의를 실행합니다. 결과로 질문에 답하며, 데이터는 절대 바꾸지 않습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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 memory and history tools 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

Part types in part.data

  • {"type":"text","text":"..."} — agent text output
  • {"type":"tool","tool":"<name>","callID":"...","state":{"status":"completed","input":{...},"output":"..."}} — completed tool call
  • {"type":"tool","tool":"<name>","callID":"...","state":{"status":"error","input":{...},"error":"..."}} — failed tool call (no output field; error message in $.state.error)
  • {"type":"step-start"} / {"type":"step-finish","tokens":...} — step boundaries
  • {"type":"compaction","auto":true/false} — compaction boundary
  • {"type":"checkpoint",...} — checkpoint/rebuild boundary

Key conventions

  • agent_id = 'main' = main agent; other values = subagent (e.g. "explore-1", "general-1").
  • $.state.output only exists when $.state.status = "completed". Failures store the message in $.state.error.
  • time_created is Unix milliseconds.

Query templates

List recent sessions for this project:

SELECT id, title, time_created,
       datetime(time_created/1000, 'unixepoch', 'localtime') as created
FROM session
WHERE project_id = '<PROJECT_ID>'
  AND parent_id IS NULL
ORDER BY time_created DESC
LIMIT 20;

Find user messages containing a keyword:

SELECT m.session_id, m.id,
       substr(json_extract(p.data, '$.text'), 1, 200) as preview
FROM message m
JOIN part p ON p.message_id = m.id AND p.session_id = m.session_id
WHERE json_extract(m.data, '$.role') = 'user'
  AND json_extract(p.data, '$.type') = 'text'
  AND json_extract(p.data, '$.text') LIKE '%keyword%'
ORDER BY m.time_created DESC
LIMIT 10;

Find tool calls by tool name:

SELECT m.session_id, m.id, m.agent_id,
       json_extract(p.data, '$.tool') as tool,
       json_extract(p.data, '$.state.status') as status,
       substr(COALESCE(json_extract(p.data, '$.state.output'), json_extract(p.data, '$.state.error')), 1, 300) as result_preview
FROM message m
JOIN part p ON p.message_id = m.id AND p.session_id = m.session_id
WHERE json_extract(m.data, '$.role') = 'assistant'
  AND json_extract(p.data, '$.type') = 'tool'
  AND json_extract(p.data, '$.tool') = '<TOOL_NAME>'
  AND m.session_id = '<SESSION_ID>'
ORDER BY m.time_created DESC
LIMIT 20;

View a session's full execution chain:

SELECT m.id, m.agent_id,
       json_extract(p.data, '$.type') as part_type,
       json_extract(p.data, '$.tool') as tool,
       substr(p.data, 1, 800) as preview
FROM message m
JOIN part p ON p.message_id = m.id AND p.session_id = m.session_id
WHERE m.session_id = '<SESSION_ID>'
  AND json_extract(m.data, '$.role') = 'assistant'
ORDER BY m.time_created, p.time_created;

**Find repeated stdout errors (completed bash calls, last

자주 묻는 질문

세션 데이터를 바꿀 수 있나요?

아니요. 스킬은 읽기 전용 접근이나 SELECT 질의만 사용하라고 안내합니다.

일반 메모리 검색보다 언제 나은가요?

도구나 상태별 필터링, 세션 비교, 개수 세기처럼 텍스트 검색이 잘하지 못하는 작업에 적합합니다.

데이터베이스는 어디에 있나요?

스킬은 일반적인 위치를 알려 주고, 환경 변수로 다른 경로를 가리킬 수 있다고 설명합니다.

상세 정보

작성자의 원본 설명

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.

repo: XiaomiMiMo/MiMo-Code

인기도

GitHub 스타
14k
순위
#11332
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬