search_memory
Search indexed memories by semantic relevance and return ranked results, with optional time-based filters. Use at task start, during debugging, or when past work is referenced.
Instructions
Search indexed memories by semantic relevance (vector search + reranking; BM25 keyword fusion runs only when retrieval.mode is "hybrid", and the default is vector-only) and return ranked results with optional temporal filtering. With the default mode there is no keyword channel, so exact identifiers such as commit hashes or variable names may not surface — use a raw-text search for those. The shown score is a fused ranking score (0-100%), NOT pure cosine similarity — read it as relative ranking within this result set, not as match confidence. Read-only, but may fire stored reminders as a side effect. Use proactively at the start of tasks, when debugging, writing, or when the user references past work.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | Filter memories stored after this date (ISO format YYYY-MM-DD, or relative like '最近30天', 'last 7 days') | |
| graph | No | Enable KG graph traversal (PPR) for relationship-aware search. Use when query involves entity relationships (e.g. 'what tools does Alice use', 'Bob的朋友'). | |
| limit | No | Max results to return | |
| query | Yes | Search query — natural language or keywords | |
| scope | No | Explicit scope; reuse Scope returned by resume_context. May be omitted when sessionId or configured environment supplies a scope, or allScopes=true explicitly requests cross-scope search. Omission alone does not mean global search. | |
| before | No | Filter memories stored before this date (ISO format YYYY-MM-DD, or relative) | |
| render | No | Result rendering mode: verbatim (default, original order) or highlight (reorder by contextual relevance to query) | verbatim |
| profile | No | Retrieval profile | |
| validAt | No | Query memories valid at a specific point in time (ISO date, e.g. '2025-06-15'). Returns only memories whose validity window covers this date. | |
| category | No | Filter by memory category: profile (identity/background), preferences (habits/style), entities (projects/tools/people), events (past happenings), cases (problem-solution pairs), patterns (reusable workflows) | |
| topicTag | No | Filter by topic tag (e.g. 'auth', 'deploy', 'testing'). Only returns memories tagged with this topic. | |
| allScopes | No | When true, explicitly allow cross-scope search | |
| sessionId | No | Optional session identifier to infer session:<id> scope | |
| reconstruct | No | Return LLM-synthesized reconstruction alongside raw results. Requires RECALLNEST_CONSTRUCTIVE_RETRIEVAL=true. | |
| detail_level | No | Result detail level: normal (default — the full text of each hit, in rank order. One entry is capped at 2400 chars. Full text is handed out until an 8k-token budget is used up; hits past that point get a query-aware snippet instead of being dropped, so a long list can run past 8k by one snippet per remaining hit, and each related-scope block has its own budget. Any shortened entry says how much of it is shown and gives the id for memory_drill_down), brief (ID+score+one-liner), full (table with 120-char snippets plus extra metadata), adaptive (full text only for hits scoring above the threshold, query-aware snippet for the rest, 8k-token budget) | normal |
| includeExpired | No | When true, include expired memories in results (demoted 80%). Default: only active/non-expired. | |
| includeArchived | No | When true, also return archived/superseded/consolidated memories (default: only active) | |
| includeRelatedScopes | No | When true, also query configured related scopes from scopeRelations and show them in a separate sidecar section. Requires an explicit or inferred scoped search; never changes the main result ranking. |