search
Retrieve stored memories for AI agents by keyword query across content, tags, and domains, with type and scope filters.
Instructions
Keyword search over memory content+tags+domain: FTS5 BM25.
Each result is annotated with match_source ("fts", or "uid" for the row a pasted identifier names) and fts_rank (bm25, lower = better). The search only widens the candidate set -- judge the returned candidates yourself.
SPEND TERMS FREELY. Every space-separated term is asked for separately and a row matching more of them ranks higher, so piling on synonyms, the identifier, the routine name and the plain-language phrasing into one query costs one call and finds strictly more. Twenty terms beat ten. Write a sentence if that is what you have -- common words score near zero and cost nothing, so there is nothing to strip.
Only active memories by default.
Returns {"results": [...], "est_tokens": N}. Content is
snippet-truncated per result -- call get_memory(uid) for the full
record; a result's est_tokens estimates what that full record costs,
and the top-level est_tokens is the sum over the results.
Two annotations worth acting on. succeeded_by means something in the
store supersedes this memory: read that one instead. collapsed lists
near-identical results folded into this one, so a fact written five
times spends one slot -- raise limit if you want the copies.
A memory marked confidence='contradicted' sorts behind everything that still holds, but it does come back: knowing a claim was ruled out is worth a slot, and it is what stops it being written again.
A diagram ranks like any other memory: it comes back when it matches the query, in the position its score earns. Nothing lifts a type to the top, so a flow in the results is a flow this query actually hit -- and when one does show up it is worth opening first, because it states a whole routine the surrounding notes only annotate.
type filters (one writer each): 'note', 'reasoning', 'checkpoint', 'anti_pattern', 'handoff', 'diagram'. Ask for type='diagram' to sweep the documented flows on purpose. To recall note()'d knowledge specifically, recall() is the sugar for search(type='note') -- which also means recall() never surfaces a diagram; use search() for that.
domain scopes to a path AND everything under it: domain='acme/x100'
searches the module and each of its routines. Give more of the path to
narrow it. A domain naming only the deep end of a path ('p200') is
resolved to the branches it sits in -- every result carries its real
domain, which is where to read what the filter actually covered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | ||
| limit | No | ||
| query | Yes | ||
| domain | No |