mem_search
Find specific memories by keyword or semantic similarity, even without knowing the memory ID. Supports filtering by scope, type, and status for precise results.
Instructions
Search memories by keyword or semantic similarity.
USE WHEN you need to find a specific memory and don't know its id. For session onboarding, use get_briefing instead (richer, ranked, budgeted).
SEARCH MODES: Literal (default): AND search across id, tags, and body — all tokens must match. Falls back to OR automatically if no AND results (partial match). Lexical rank (lexical_rank: true, semantic: false): Okapi-BM25-style scoring on the filtered corpus — good for phrase-like queries without embeddings. Semantic (semantic: true): embedding-based similarity — finds related memories even with different wording. Requires hivelore embeddings index to be built.
PARAMETERS: query — search terms or natural language question scope — filter by personal | team | module type — filter by convention | decision | gotcha | architecture | glossary semantic — true for embedding-based search (requires @hivelore/embeddings) lexical_rank — BM25-style ranking (ignored when semantic is true) limit — max results (default 10)
RETURNS: array of { id, type, scope, status, confidence, body, match_quality }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Restrict results to a memory type. session_recap is excluded by default — use type='session_recap' to include them. | |
| limit | No | Max results | |
| query | Yes | Substring matched against id, tags, and body | |
| scope | No | Restrict results to a single scope | |
| track | No | Increment read_count on returned memories (used for passive validation) | |
| module | No | Restrict results to a module | |
| status | No | Filter by a single status. Omit to return all statuses. | |
| semantic | No | Use semantic similarity from the embeddings index (requires `hivelore embeddings index`). | |
| min_score | No | Minimum cosine similarity (semantic mode only) | |
| lexical_rank | No | When true (and semantic is false), rank the filtered corpus with Okapi-BM25-style lexical scoring instead of literal AND/OR. Helps phrase-like queries without embeddings. | |
| exclude_rejected | No | When true, exclude memories with status=rejected from results. | |
| include_session_recap | No | Include session_recap memories in search results (excluded by default — they surface in get_briefing as last_session). |