Skip to main content
Glama

search_memory

Read-onlyIdempotent

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

NameRequiredDescriptionDefault
modeNoSearch 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_ofNo**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.
queryYesSearch query string
top_kNoMaximum number of results to return
api_keyNoAPI key for agent authentication (required if agent has a registered key)
agent_idNoID 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_scoreNoDrop 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".
namespaceNoFilter by namespace
occurred_toNoEvent-time window, inclusive upper bound. See `occurred_from`.
type_filterNoFilter by memory type
occurred_fromNo**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_filterNoFilter by priority
expand_relationsNoAttach each result's one-hop relation neighborhood (semantic graph expansion, C5). Default off.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.7.2
    • changedInput schema / properties / agent_id / description
      Previous value: -"ID of the requesting agent"New value: +"ID of the requesting agent, for authentication and audit — **not a\nresult filter**. §13.3: every agent searches the same shared corpus, and\nper-agent differentiation happens at injection time via `inject_rules`,\nnever in the store. Use `namespace` to scope a search."
    • addedInput schema / properties / as_of
      Added value: +{
      +  "default": null,
      +  "description": "**Point-in-time query (valid-time).** RFC3339 timestamp, e.g.\n`2026-08-01T00:00:00Z`. Restricts results to memories that were in\neffect at that instant and returns each one reconstructed to the state\nit held then, rather than its current state.\n\nThis is a third time axis, not a variant of the others: `occurred_at`\nis when the remembered fact happened, `created_at` is when MemVault\ningested it, and `as_of` is \"what did MemVault believe at T\".\n\n**Recall covers the historical index too**: a memory reworded since\n`as_of` is still found by the words it had *then*, and such hits carry\n`hist-kw#N` provenance so \"matched today\" and \"matched then\" stay\ndistinguishable. Keyword path only — the vector path still embeds current\ntext, so a reworded memory is reachable by its old words but not by its\nold meaning. Each result carries `as_of_source` saying whether its state\ncame from the live row or a reconstructed history snapshot.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / occurred_from
      Added value: +{
      +  "default": null,
      +  "description": "**Event-time window** (RFC3339), inclusive lower bound: keep only memories\nwhose `occurred_at` is at or after this instant. Answers \"what happened in\nMarch\" — a different question from `as_of`'s \"what did MemVault believe in\nMarch\", and the two are never folded together. Memories with no\n`occurred_at` never match a window, so this only selects among memories\nthat were saved with a date.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • addedInput schema / properties / occurred_to
      Added value: +{
      +  "default": null,
      +  "description": "Event-time window, inclusive upper bound. See `occurred_from`.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. Changed1 schema field changedv0.6.10
    • changedInput schema / properties / mode / description
      Previous value: -"Search mode: \"keyword\" (default), \"semantic\" (vector), or \"hybrid\" (both)"New value: +"Search mode: \"hybrid\" (default; keyword + vector via RRF), \"keyword\"\n(text-only), or \"semantic\" (vector-only). Semantic/hybrid fall back to\nkeyword when embeddings are unavailable."
  3. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint and openWorldHint=false, so the closing 'Read-only; does not mutate memories' is redundant rather than informative. The description does add real behavioral context beyond the annotations: graceful fallback to keyword when embeddings are unavailable, per-result search_mode='keyword' reporting, and hist-kw#N provenance tagging. A 3 reflects solid additions layered onto already-covering annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded: mode and fallback come first, then the time-axis warning, then filters. The all-caps 'TWO INDEPENDENT TIME AXES' framing earns its emphasis given how easily those parameters are conflated. Minor redundancy with the schema's own as_of prose keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter tool with no output schema, the description covers the risky parts: mode fallback, time-axis semantics, reconstruction behavior, and result-level signals (search_mode, hist-kw#N). Authentication parameters (api_key, agent_id) are left entirely to the schema, and overall return shape is only partially sketched, which is the main remaining gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every one of the 13 parameters is already documented in the schema — the baseline is 3. The description usefully surfaces the as_of-vs-occurred_* distinction and the top_k/expand_relations behavior at the top level, but it largely restates what the schema fields already say in near-identical language.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('Search stored memories') and immediately characterizes the retrieval semantics (hybrid RRF, keyword-only, semantic-only). It never names a sibling tool, so an agent must infer from sibling names alone that get_memory_evidence or list_inbox are different operations, which keeps it below a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states which mode to expect by default and what each mode does, plus the decisive warning that as_of and occurred_from/occurred_to 'answer different questions and are not interchangeable' — that is genuine when-to-use guidance for the two most confusable parameters. It offers no tool-level exclusions or alternatives, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.