search
Search memories by keyword. The query must use vocabulary that appears in stored labels, descriptions, or tags — not intent summaries or paraphrases. Pass node_kind (space-separated) to list or search within specific kinds — unrelated kinds that happen to match query text are excluded. Omit query with node_kind set to list matching kinds ordered by most-recently-updated. Default limit: 10. Use exact=true for identifiers (ticket numbers, short codes with hyphens) — FTS tokenises hyphens away so 'PROJ-042' is not found by default. If search returns zero or truncated results, use orient (with domain) to browse all memories, then recall by ID, then follow connections from a known memory. Returns lean results only — id, label, and a truncated why_matters excerpt; call recall(id) for full content. When a list or section has 2 or more results, each is rendered as a single compact text line — "[id] label — excerpt (domain, node_kind)" — instead of a JSON object; exactly one result is returned as a full object. exact=true is exempt — it always returns full objects, regardless of result count. state (space-separated union) post-filters results to memories with any of the given lifecycle states: none | resolved | superseded | contested. Response always includes semantic_attempted (bool: true when embed() succeeded and the vector path was entered) and semantic_best_dist (float|null: cosine distance of the top result after filtering, null when no vector rows were returned). Use these to diagnose whether Bedrock was available and how close the best match was. On failure, content[0].text is JSON: {"error_class": "retryable|forbidden|internal", "message": "..."}. Switch on error_class: retry on retryable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exact | No | When true, use label substring (ILIKE) matching instead of FTS. Results are ordered by updated_at DESC with no semantic_distance. Use for identifiers like ticket numbers or short codes where FTS tokenisation loses the match. | |
| limit | No | Maximum results to return. Default: 10. If truncated is true in the response, raise the limit or narrow the query. | |
| query | No | Words to match against stored labels, descriptions, and tags. Use vocabulary from the stored content — if zero results, try words that are likely in the stored text rather than intent or paraphrase. | |
| scope | No | Scope of the search. workspace (default): own workspace only. followed: own workspace plus all declared workspace follows — foreign results include source_workspace_id and layer fields; results are always full objects (no digest compression) so provenance fields are preserved. org: future use (currently behaves like workspace). Invalid values are rejected with a validation error. | |
| state | No | ||
| domain | No | ||
| memory_id | No | Restrict search to nodes directly connected to this memory ID. Useful for searching within a workstream. Applied before FTS/exact scoring, not as a post-filter. When omitted, all nodes in the workspace (or domain) are searched. | |
| node_kind | No | Optional filter: space-separated node kinds (union match, same convention as tags). E.g. 'option standing' returns memories whose node_kind is option OR standing. Negation and wildcards are not supported. | |
| max_distance | No | When set (e.g. 0.35), only vector-search results whose semantic_distance is at or below this value are returned. Absent (or 0) means no distance filtering — all ranked results up to limit are returned. Use this from hooks to suppress low-relevance injections (STORY-315). |