Description
search_memory finds relevant memories using hybrid retrieval — combining vector similarity and PostgreSQL full-text search, merged with Reciprocal Rank Fusion (RRF). Both semantic queries and exact-match lookups work well.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | Natural language description of what to find. Full sentences produce the best results. |
limit | number | No | 5 | Number of results to return (1-10). Use higher values for broad topics. |
category | string | No | all | Filter to a single category: preference, fact, decision, or context. |
project | string | No | all | Filter to a specific project. Omit to search all memories (recommended for most searches). |
threshold | number | No | 0.6 | Maximum vector distance (0-1). Higher values return more results (broader search). |
Threshold guide
| Value | Use case |
|---|---|
0.2 - 0.4 | Strict, high-precision matching |
0.6 | Default — good balance of precision and recall |
0.7 - 0.8 | Broad recall — returns more results, including loosely related ones |
How search works
- Query variants are generated automatically to improve coverage
- Embeddings are created for the original query and all variants
- Vector search runs against all query forms
- PostgreSQL full-text search runs in parallel
- Results are merged with Reciprocal Rank Fusion (RRF)
Response
relevance score from 0 (least relevant) to 1 (most relevant).
Example
Query guidelines
- Good:
"What package manager does the user prefer?"(full sentence, clear intent) - Bad:
"package manager"(keywords alone reduce match quality)
