Recall
Recall uses semantic search combined with temporal filtering and graph traversal to find relevant memories.
Data Flow
Section titled “Data Flow”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 }Recall Modes
Section titled “Recall Modes”| Mode | Context Returned | Use Case |
|---|---|---|
| SemanticSearch | None | Fast, simple queries |
| ContextualSearch | Parent + children + related | Understanding context |
| TemporalSearch | Entity history | Time-based queries |
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language search query |
limit | int | No | Maximum results (default: 5) |
layer | int (0-3) | No | Filter by semantic layer |
as_of | ISO 8601 | No | Query as of a specific point in time |
expand_graph | bool | No | Include relationships and ancestors |
Temporal Re-ranking
Section titled “Temporal Re-ranking”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.
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).