Skip to main content
Searches memories using a combination of semantic vector search and BM25 full-text search. Returns results ranked by a combined score (semantic similarity, keyword match, recency, salience). Always call this before add_memory to check for duplicates.

Parameters

query
string
required
Search query. Can be natural language ("how does authentication work?") or keywords ("jwt token validation"). Semantic search finds conceptually similar content even without exact keyword matches.
limit
number
default:"10"
Maximum results to return (1-100). Default 10 is usually sufficient. Increase to 20-50 for comprehensive knowledge review.
layers
string[]
Filter by specific layers. Omit to search all layers. Example: ["rule"] for rules only, ["working", "long_term"] to exclude rules.
scope
string
default:"project"
Search scope.
ValueDescription
projectCurrent project + global memories (default)
globalGlobal memories only
allAll projects without filtering

Example

{
  "query": "authentication setup",
  "limit": 5,
  "layers": ["rule", "long_term"],
  "scope": "project"
}

Scoring

Each result includes a hybrid score and breakdown:
score = semantic × 0.4 + bm25 × 0.3 + recency × 0.2 + salience × 0.1
See Search & Scoring for details.

Returns

Sorted list of results with score breakdown:
1. [memory] (score: 0.847) This project uses React 19 with TypeScript
   semantic: 0.92, bm25: 0.85, recency: 0.78, salience: 0.65