search_memories
Search saved memories in a workspace to locate context you don't know the file for. Uses ranked full-text search when available, with a deterministic grep fallback for pattern matching.
Instructions
Search saved memories for a workspace.
When the FTS5 memory index is available and fresh, returns ranked hits (by relevance, with a bonus for user-authored memories) annotated source=memory-fts. Otherwise falls back to a deterministic grep over the markdown files, returning each match with the memory name and line. Smart-case (case-insensitive if 'pattern' is all lowercase) unless 'case_sensitive' is set; 'use_regex' forces the grep path. 'mode' (auto|fts|grep) overrides the choice; default auto.
Memory-only corpus with a deterministic grep fallback — for ranked discovery across code, docs, AND memories in one call, use workspace_search instead. Useful when you don't know which memory contains a piece of context — much faster than reading every memory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Search strategy. auto (default): ranked FTS when the index is fresh, falling back to grep when the index is stale OR FTS finds no hits (FTS matches whole tokens, grep matches substrings). fts: force ranked FTS (reindex if stale; keeps an empty result). grep: force literal/regex grep. | |
| pattern | No | Text or regex pattern to search for. | |
| use_regex | No | Treat pattern as a regex. Forces the grep path (FTS is not regex). | |
| workspace | No | Absolute workspace path. Defaults to the daemon's resolved workspace. | |
| case_sensitive | No | Default: smart-case. Setting this forces the grep path (FTS is case-insensitive). |