Search
mor offers three ways to search, each suited to different needs.
Full-text search (find)
Section titled “Full-text search (find)”Uses SQLite FTS5 with the porter unicode61 tokenizer.
mor find "retry http"mor find "retry http" --json # JSON output with content- Stemming — “running” matches “run”, “runs”, “running”
- OR-ranked — multi-word queries match any term, ranked by how many match
- Unicode-aware — dots, hyphens, and other punctuation are token separators
- Scores — results are ranked 0.0 to 1.0, best match first. Results below threshold are filtered out (default 0.3, configurable via
-sorthresholdin config) - Access boost — frequently accessed memories get a small ranking boost (max ~5%), helping surface practical information over time
- JSON output —
--jsonreturns an array of{id, title, description, tags, score, content}for programmatic use (e.g. hooks, scripts)
When embeddings are configured, find merges FTS and vector results using Reciprocal Rank Fusion — no manual weight tuning needed.
Grep (grep)
Section titled “Grep (grep)”Searches by substring or regex.
mor grep "Retry-After" -imor grep -E "async\s+function" -i- Exact match — no stemming or tokenization (default)
- Regex — with
-Eflag, uses JavaScript regular expressions - Word match — with
-wflag, matches whole words only - Case-insensitive — with
-iflag - Line numbers — with
-nflag - Files only — with
-lflag, shows only memory titles - Context —
-A <n>after,-B <n>before,-C <n>both - Searches title and content — finds strings anywhere in the memory
Use grep for code identifiers, URLs, special characters, patterns, or anything FTS might tokenize away.
Query resolution (cat, edit, rm, etc.)
Section titled “Query resolution (cat, edit, rm, etc.)”Commands that take a <query> argument resolve it in order:
- Full UUID — exact match
- UUID prefix — 8+ character prefix, must be unique
- Filename — matches the
.mdfilename in the memory folder - FTS search — falls back to full-text search, returns the top hit
mor cat 405614a7 # UUID prefixmor cat retryWithBackoff # filename matchmor cat "retry backoff" # FTS searchFiltering
Section titled “Filtering”All search commands support filters that narrow results by metadata:
mor find "http" --tag "rxjs" # only rxjs-tagged memoriesmor grep "TODO" --type snippet # only snippetsmor ls --ext .fs # only F# filesmor ls --repo "github.com/org/*" # only from specific reposFilters use glob patterns — * matches anything, ? matches one character.