Skip to main content
Searches for memories using semantic similarity. Converts your query to an embedding and finds the most similar memories using cosine similarity.

Parameters

string
required
User identifier for memory isolation
string
required
Natural language search query. Will be converted to an embedding for semantic matching.
number
default:"10"
Maximum number of memories to return. Range: 1-100.
number
default:"0.7"
Minimum similarity score (0-1) for results. Higher values = stricter matching.
  • 0.9+: Very similar (almost exact matches)
  • 0.8-0.9: Highly relevant
  • 0.7-0.8: Relevant (default)
  • 0.6-0.7: Somewhat relevant
  • <0.6: Loosely related

Response

Returns an array of memories with similarity scores:
string
Memory UUID
string
Memory text content
number
Cosine similarity score (0-1). Higher = more similar.
string
User identifier
object
Custom metadata
string
ISO 8601 timestamp

Examples

Semantic Search Examples

Tuning Search Results

Adjusting Threshold

Start with the default threshold (0.7) and adjust based on your results. Lower for broader matches, higher for precision.

Performance

  • Latency: 10-50ms for typical datasets
  • Scalability: Handles millions of memories efficiently
  • Index: Uses pgvector IVFFlat for fast similarity search

Add Memory

Save new memories to search

Get All Memories

Retrieve all memories without search

How It Works

Learn about semantic search

Integration Guide

Use search in your app