Search memories
Vector + filter search over the memory pool.
Filters use the standard DSL: per-field equality, $in / $ne
/ $exists / $gte / $lte operators, and AND / OR
/ NOT composition. type (or type: {$in: [...]})
restricts which memory kinds participate; the default mixes facts,
artifacts, and episodes ranked together by cosine similarity.
include opts into composed output:
"full_content"— populatedetails.full_contenton artifact rows (no-op for facts and episodes)."context_prompt"— run the retrieval-agent pipeline; the assembled markdown lands underextras.context_promptand a latency breakdown underextras.stage_timings. Requiresconv_idinfilters.
Documentation Index
Fetch the complete documentation index at: https://docs.mem.xtrace.ai/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Long-lived org API key. Alternative: Authorization: Bearer <key>.
Required alongside the API key (no key→org reverse index).
Headers
Body
POST /v1/memories/search — vector + filter search over the
unified memory pool. No mode flag; opt into composed output
via include.
filters is the full DSL (bare values, $in/$ne/$gte/
$lte, AND/OR/NOT). Empty/omitted filters mean
"all memories in this org".
Natural-language query text. Embedded server-side; cosine-similarity-ranked.
1"who likes thai food?"
Filter DSL. Top-level keys are implicit-AND. Supported operators on per-field values: bare value, null, $eq, $ne, $in, $nin, $exists, $gt/$gte/$lt/$lte, $between. Boolean composition: AND / OR / NOT. type (string or $in list) restricts which kb_types are scanned (default = all three).
{ "user_id": "alice" }{
"AND": [
{ "user_id": "alice" },
{ "agent_id": "bot-7" }
]
}{
"score_val": { "$gte": 0.5 },
"type": "fact"
}Maximum rows to return. 1–100, default 20.
1 <= x <= 100Opaque pagination cursor from a previous response's next_cursor. Tenant-scoped — using one from another org returns 422 cursor_mismatch.
Opt-in extras. full_content populates details.full_content on artifact rows (no-op for facts/episodes). context_prompt runs xmem's retrieval-agent pipeline; the assembled markdown lands under extras.context_prompt and requires both user_id and conv_id in filters.
full_content, context_prompt Response
Successful Response
Search response — list envelope + optional extras block.
Constant discriminator for the resource type.
"list"Ranked rows. Mixed kb_types are merged by raw cosine; score carries the similarity value.
Populated only when include opts in. null on a default search response.