Search and browse memories using text matching and/or filters.
Supports three search modes: semantic (meaning-based), fulltext (keyword-based via BM25), or hybrid (both combined via Reciprocal Rank Fusion). Choose the mode deliberately: use semantic search for concepts and intent, fulltext for exact words or identifiers, and hybrid when both kinds of matching are useful. Combine any search mode with tree, structured metadata, JSONPath metadata predicate, temporal, and regex filters.
| Name | Type | Required | Description |
|---|---|---|---|
space |
string |
varies | Absent in locked mode; required nonempty string in multi-space mode. It selects the same-server space for this call. |
semantic |
string | null |
no | Natural language query for semantic search. Omit or pass null to skip. |
fulltext |
string | null |
no | Keywords/phrases for BM25 exact matching. Omit or pass null to skip. |
grep |
string | null |
no | POSIX regex pattern filter on content (case-insensitive). Must accompany semantic/fulltext search or a tree, meta, or temporal filter; metaPredicate alone does not qualify. Omit or pass null to skip. |
meta |
object | null |
no | Filter by metadata attributes. Omit or pass null to skip. |
metaPredicate |
string | null |
no | PostgreSQL JSONPath Boolean predicate evaluated against metadata with @@. Omit or pass null to skip. |
tree |
string | null |
no | Filter by tree path. Omit or pass null to skip. |
temporal |
object | null |
no | Temporal filter. Omit or pass null to skip. |
weights |
object | null |
no | Weights for hybrid search ranking. Omit or pass null for defaults. |
candidateLimit |
integer | null |
no | Candidates per search mode before RRF fusion. Omit or pass null for default (30). |
semanticThreshold |
number | null |
no | Minimum cosine similarity, in [0, 1] (1 = identical, 0 = unrelated), for semantic/vector candidates. Higher is stricter. Values outside [0, 1] are rejected, not clamped. Omit or pass null to skip. |
limit |
integer | null |
no | Maximum number of results. Omit or pass null for default (10). Max: 1000. |
order_by |
string | null |
no | Sort direction for filter-only searches: "asc" or "desc". Default: "desc". Omit or pass null for default. |
select |
string[] | null |
no | Fields to present for each result. Omit or pass null for complete memory objects. Supports response fields, meta.keyName, and content slices. |
format |
"yaml" | "json" | "compact" | null |
no | Text serialization format. Omit or pass null for YAML; json and compact both return compact JSON. |
The system auto-detects the syntax from the pattern. Quick reference:
- Bare path (
/work/projects) -- matches that node and all descendants. - Wildcard (
/work/projects/*) -- all descendants at any depth. - Depth-limited (
/work/*{2}) -- descendants up to 2 levels deep. - Negation (
*/!draft/*) -- paths that do NOT containdraft. - Pattern (
*/api/*) -- any path containingapi. - Label search (
api & v2) -- boolean search over path labels.
See Tree filter syntax for the full reference with examples.
| Name | Type | Required | Description |
|---|---|---|---|
before |
string | null |
no | Find memories strictly before this point in time. |
after |
string | null |
no | Find memories strictly after this point in time. |
contains |
string | null |
no | Find memories whose time range contains this point in time. |
overlaps |
object | null |
no | Find memories overlapping this range ({start, end}). |
within |
object | null |
no | Find memories fully within this range ({start, end}). |
You can provide multiple temporal fields; all populated predicates must match.
before and after are strict and exclude memories without a temporal range.
A half-open range ending exactly at before matches; a range beginning at or
containing the point does not.
Use metaPredicate for metadata conditions that structured meta containment
cannot express:
$.priority >= 3
$.status == "active" || $.status == "pending"
!exists($.archivedAt)
exists($.grants[*] ? (@.user == "tom" && @.level >= 2))
The expression must produce one Boolean result and uses PostgreSQL's SQL/JSON
path dialect. When both meta and metaPredicate are provided, both must match.
Prefer meta for exact values and array membership. Equality clauses can use
the metadata GIN index; other predicates may require broader scans.
| Name | Type | Required | Description |
|---|---|---|---|
fulltext |
number | null |
no | Weight for BM25 keyword matching (0-1). |
semantic |
number | null |
no | Weight for semantic similarity (0-1). |
The tool returns YAML by default. The JSON below illustrates the response shape;
pass format: "json" or format: "compact" for compact JSON text.
{
"results": [
{
"id": "0194a000-0001-7000-8000-000000000001",
"content": "Use ltree for hierarchical path queries.",
"meta": { "source": "docs" },
"tree": "/research/postgres",
"name": null,
"temporal": null,
"version": 1,
"versionHash": "5f3e9c2a8b1d4f7e0c3a6b9d2e5f8c1a",
"hasEmbedding": true,
"createdAt": "2025-04-15T12:00:00Z",
"createdBy": null,
"updatedAt": null,
"score": 0.85
}
],
"total": 1,
"limit": 10
}| Field | Type | Description |
|---|---|---|
results |
array |
Array of memory objects (same shape as me_memory_get, including version and versionHash), each with an additional mode-dependent score. |
total |
number |
Total number of matching memories. |
limit |
number |
The limit that was applied. |
{
"semantic": "how does authentication work",
"limit": 10
}{
"semantic": "panics",
"fulltext": "panics",
"limit": 10
}{
"semantic": "embedding performance",
"fulltext": "nomic ollama",
"tree": "/share/design/*",
"limit": 5
}{
"meta": { "type": "decision" },
"tree": "/share/strategy/*",
"limit": 20,
"order_by": "desc"
}- Provide at least one of
semantic,fulltext, or a filter (tree,meta,metaPredicate,temporal,grep) -- otherwise the search has no criteria.grepmust also accompany semantic/fulltext search or atree,meta, ortemporalfilter;metaPredicatealone does not satisfy this guard. - Optional parameters may be omitted or explicitly passed as
null— both are treated as "no value". - Omit
selector passnullto receive complete memory objects. An empty selection or multiple distinct content slices are invalid. - Selectors use camelCase response names, such as
id,tree,hasEmbedding, andversionHash. The complete suffix aftermeta.is the metadata key, including$threador punctuation.content:Nreturns the firstNUTF-16 code units;content:M:Nreturns the zero-based range[M, N);content:M:returns fromMthrough the end. Content slices include the full UTF-16contentLength. - When both
semanticandfulltextare provided, results are ranked using Reciprocal Rank Fusion (hybrid mode). Use this when both meaning-based similarity and exact-term matching are useful for the same query. order_byonly applies to filter-only searches (nosemantic/fulltext). Ranked searches are always sorted by score.- Each result's
scoreis mode-dependent and only comparable within one result set (not across modes or queries):- Semantic (
semanticonly): cosine similarity in[-1, 1]— higher is more similar (1= identical direction). - Fulltext (
fulltextonly): a positive, unnormalized BM25 score (> 0, unbounded — it can exceed1). Only genuine term matches are returned. - Hybrid (
semantic+fulltext): the fused Reciprocal Rank Fusion (RRF) score — a small positive number reflecting cross-mode rank agreement, not absolute relevance. - Filter-only (neither): an unranked sentinel (
-1); results are ordered by creation time (seeorder_by).
- Semantic (