Mem Search
Researchmem-searchMem Search is an Agent Skill for research published in the softspark/ai-toolkit repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Search past coding sessions using natural language. Finds relevant observations, decisions, and context from previous work.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/softspark/ai-toolkit/blob/HEAD/app/plugins/memory-pack/skills/mem-search/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/mem-search, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Search Session Memory
Search the persistent memory database for past coding observations, decisions, and context.
$ARGUMENTS
How It Works
This skill queries the SQLite FTS5 full-text search index at ~/.softspark/ai-toolkit/memory.db to find relevant observations from past sessions.
Instructions
-
Parse the search query from
$ARGUMENTS. If empty, prompt the user for a query. -
Initialize the database if it does not exist:
python3 "$HOME/.softspark/ai-toolkit/hooks/../plugins/memory-pack/scripts/init_db.py" 2>/dev/null || true -
Run the FTS5 search against the observations table:
sqlite3 ~/.softspark/ai-toolkit/memory.db " SELECT o.id, o.session_id, o.tool_name, o.content, o.created_at, s.project_dir, s.summary FROM observations_fts fts JOIN observations o ON o.id = fts.rowid LEFT JOIN sessions s ON s.session_id = o.session_id WHERE observations_fts MATCH '<query>' ORDER BY rank LIMIT 10; "Replace
<query>with the user's search terms. Escape single quotes by doubling them. -
Progressive disclosure -- present results in two stages:
Stage 1: Summary view (show first)
## Memory Search: "<query>" Found N results across M sessions. | # | Session | Project | Tool | Time | Preview | |---|---------|---------|------|------|---------| | 1 | abc123 | /path | Edit | 2025-01-15 | First 80 chars... |Stage 2: Detail view (on request) Show the full observation content, session summary, and related observations from the same session.
-
If no results found, suggest:
- Trying broader search terms
- Checking if memory-pack hooks are installed
- Running
init-db.shif the database is missing
Query Tips
- Use simple keywords:
mem-search database migration - FTS5 supports prefix matching:
migrat*matches "migration", "migrate" - Boolean operators:
database AND NOT test - Column filters:
tool_name:Editto search only Edit tool observations