search_memory
Retrieve stored memories by keyword, semantic, or hybrid search, with point-in-time and event-time filters. Use it to recall past decisions, preferences, and context without changing stored data.
Instructions
Search stored memories. mode defaults to 'hybrid' (keyword + vector via RRF); 'keyword' is text-only and 'semantic' is vector-only. Semantic/hybrid need an embedding provider — when embeddings are unavailable the query falls back to keyword and each result reports search_mode='keyword'. Supports namespace, type_filter, priority_filter, top_k (default 10), min_score, and optional expand_relations for one-hop relation context. TWO INDEPENDENT TIME AXES: as_of is valid-time — 'what did MemVault believe at T' — and returns each hit reconstructed to the state it held then, recalling from the historical index too so a memory reworded since T is still found by the words it had (keyword path only; such hits are tagged hist-kw#N); occurred_from/occurred_to filter event-time — 'what happened in March' — and never match memories saved without a date. They answer different questions and are not interchangeable. Read-only; does not mutate memories.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "search_memory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Search mode: "hybrid" (default; keyword + vector via RRF), "keyword" (text-only), or "semantic" (vector-only). Semantic/hybrid fall back to keyword when embeddings are unavailable. | hybrid |
| as_of | No | **Point-in-time query (valid-time).** RFC3339 timestamp, e.g. `2026-08-01T00:00:00Z`. Restricts results to memories that were in effect at that instant and returns each one reconstructed to the state it held then, rather than its current state. This is a third time axis, not a variant of the others: `occurred_at` is when the remembered fact happened, `created_at` is when MemVault ingested it, and `as_of` is "what did MemVault believe at T". **Recall covers the historical index too**: a memory reworded since `as_of` is still found by the words it had *then*, and such hits carry `hist-kw#N` provenance so "matched today" and "matched then" stay distinguishable. Keyword path only — the vector path still embeds current text, so a reworded memory is reachable by its old words but not by its old meaning. Each result carries `as_of_source` saying whether its state came from the live row or a reconstructed history snapshot. | |
| query | Yes | Search query string | |
| top_k | No | Maximum number of results to return | |
| api_key | No | API key for agent authentication (required if agent has a registered key) | |
| agent_id | No | ID of the requesting agent, for authentication and audit — **not a result filter**. §13.3: every agent searches the same shared corpus, and per-agent differentiation happens at injection time via `inject_rules`, never in the store. Use `namespace` to scope a search. | |
| min_score | No | Drop results whose final (post-rerank) relevance score is below this threshold. Unset = return the full top_k regardless of score, the pre-existing behavior. Lets callers distinguish "no confident match" (empty result) from "weak matches padded to top_k". | |
| namespace | No | Filter by namespace | |
| occurred_to | No | Event-time window, inclusive upper bound. See `occurred_from`. | |
| type_filter | No | Filter by memory type | |
| occurred_from | No | **Event-time window** (RFC3339), inclusive lower bound: keep only memories whose `occurred_at` is at or after this instant. Answers "what happened in March" — a different question from `as_of`'s "what did MemVault believe in March", and the two are never folded together. Memories with no `occurred_at` never match a window, so this only selects among memories that were saved with a date. | |
| priority_filter | No | Filter by priority | |
| expand_relations | No | Attach each result's one-hop relation neighborhood (semantic graph expansion, C5). Default off. |