Memory & RAG
Search Memories
Hybrid semantic + keyword search with cross-encoder reranking
POST
Search memories in a collection using hybrid retrieval. Combines vector similarity (semantic) with BM25 keyword scoring, with optional cross-encoder reranking for higher precision. Optionally returns graph relationships.
Request
Headers
string
required
Bearer token with your API key
string
required
application/json
Body
string
required
Search query text. Max 2,000 characters.
string
Collection to search. Defaults to the caller’s personal collection.
string
default:"fast"
Search mode:
fast— single-query dense retrieval (~100-200ms). Best for simple lookups.thinking— fetches a wider candidate pool and applies cross-encoder reranking for higher precision (~200-400ms). Best for complex or multi-faceted questions.
integer
default:"10"
Maximum number of results. Capped at 50.
number
default:"0.8"
Weight of semantic search (0-1).
0 = keyword only, 1 = semantic only.number
default:"0.0"
Weight given to newer memories (0-1).
boolean
default:"false"
Include knowledge-graph relationships in the response.
Advanced reranker knobs
These parameters override server-side defaults for the cross-encoder reranker. Omit to use the deployment default.integer
Max candidates the cross-encoder reranks (1-500). Default: server setting (30).
integer
Hard timeout for the rerank call in milliseconds (50-5000). Default: server setting (500).
number
Drop results with rerank score below this threshold (0-1). Default: server setting (0.25).
integer
In
thinking mode, fetch N x max_results candidates before reranking (1-10). Default: server setting (3).Response
array
Raw chunk-level search results with scores. Each chunk includes:
score— dense vector similarity score (0-1)rerank_score— cross-encoder rerank score (0-1, present when reranker is active, null otherwise)
array
Deduplicated source memories (one per unique memory_id)
object
Graph nodes, edges, and triplets (only if
graph_context: true)integer
Total number of chunks returned
number
Search latency in milliseconds
object
Per-query diagnostic trace including stage timings, reranker meta, and active flag snapshot. Useful for debugging search quality.
Example
Billing
Flat **3. Every successful request returns:
On
402 INSUFFICIENT_CREDITS, the response includes details.shortfall so you can prompt the user to top up. See Pricing & Billing.