memory_search
Search memories by meaning and keywords using hybrid, semantic, or keyword modes; filter results by type, agent, user, scope, or conversation, and retrieve past states with time-travel queries.
Instructions
Find memories by meaning and keywords: hybrid by default; search_mode semantic (vector only) or keyword (lexical only). Returns the top k matches, ranked, with their ids; grade the ones you use with memory_grade. Narrow with type_filter, agent_filter, user_id, scope or conversation_id; as_of searches the store as it was at a past time. Use chatlog_search for captured chat turns and files_search for indexed files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Max results (1-100). | |
| as_of | No | ISO-8601 time-travel cutoff. | |
| query | Yes | Search query. | |
| scope | No | Filter by isolation scope. | |
| store | No | Named store for this call only: main, or a [stores.<name>] in m3_config.toml. | |
| explain | No | Attach a per-result `_explanation` block (vector/bm25/title_overlap/importance/recency/temporal score breakdown) plus a human-readable `reason` string explaining why each row matched. Same breakdown memory_suggest shows, on the primary search path. | |
| timeout | No | Per-call timeout in seconds; <=0 disables. | |
| user_id | No | Filter by data subject. | |
| variant | No | Ingest-pipeline filter. '' = real user data only (default, equivalent to IS NULL). Pass a specific variant name (e.g. 'heuristic_c1c4') to scope to that bench ingest. | |
| database | No | SQLite file for this call only (legacy; prefer store). SQLite backend only. | |
| adaptive_k | No | Auto-trim results at the score drop-off point. WARNING: regresses on temporal-reasoning, knowledge-update, and multi-session queries; safe only for sharp-curve queries where most retrievals would be noise. Prefer `auto_route=True` on memory_search_routed for safer multi-signal routing. | |
| as_records | No | Return structured records (JSON) instead of the display string. Default false keeps the human-readable output unchanged. | |
| search_mode | No | Retrieval mode. | hybrid |
| type_filter | No | Restrict to a memory type. | |
| agent_filter | No | Restrict to an agent id. | |
| recency_bias | No | Boost newer items (0.0=off, 0.1-0.2=moderate, higher=aggressive). Useful for 'current' or 'latest' queries. | |
| conversation_id | No | Restrict to a conversation / team session. | |
| requesting_agent | No | Calling agent's id. When set, ENFORCES cross-agent isolation: private (scope='agent') rows from OTHER agents are excluded; the caller still sees its own private rows plus all shared scopes (org/user/session). Empty = no enforcement (sees all, back-compat). | |
| include_bench_data | No | Opt in to LOCOMO / LongMemEval bench rows. Default False hides any row with a variant tag. | |
| include_scratchpad | No | Include ephemeral scratchpad items. |