Skip to content

Recall

Recall uses semantic search combined with temporal filtering and graph traversal to find relevant memories.

Query Text
[1. Generate Embedding] → 1536-dim vector (OpenAI)
[2. Vector Similarity Search] → Qdrant, returns (MemoryID, score)
[3. Fetch Full Memories] → XTDB
[4. Apply Filters] → layer, entity, temporal (as_of)
[5. Temporal Re-ranking] → superseded memories get 30% penalty
[6. Fetch Relationships] → returned as metadata
RecallResponse { memories, usage }
ModeContext ReturnedUse Case
SemanticSearchNoneFast, simple queries
ContextualSearchParent + children + relatedUnderstanding context
TemporalSearchEntity historyTime-based queries
ParameterTypeRequiredDescription
querystringYesNatural language search query
limitintNoMaximum results (default: 5)
layerint (0-3)NoFilter by semantic layer
as_ofISO 8601NoQuery as of a specific point in time
expand_graphboolNoInclude relationships and ancestors

Superseded memories (those with valid_to set) receive a 30% score penalty:

adjusted_score = original_score × 0.7 (superseded)
adjusted_score = original_score × 1.0 (current)

Current information ranks higher, but historical data still surfaces if highly relevant.

Terminal window
curl "https://api.memlayer.dev/api/v1/recall?query=programming+language&limit=5&expand_graph=true"

Response includes ranked memories with similarity scores and optional graph context (relationships, ancestors).