Engine Advanced
advancedSemantic neighbors, explorer, consolidation, diagnostics, configuration, and state management endpoints.
All endpoints below are under /v1/memory/ (not /v1/engine/).
Semantic neighbors
/v1/memory/semantic/neighborsFind semantically similar patterns in the memory space around a given embedding.
keyarray[number]requiredPattern embedding vector.
top_kintegerDefault: 5Number of neighbors to return (1-50).
{
"neighbors": [
{
"pattern_id": "pat_def456",
"similarity": 0.82,
"metadata": {
"category": "geography"
}
}
]
}Semantic composition score
/v1/memory/semantic/composition-scoreScore how well two patterns compose relative to a query.
queryarray[number]requiredQuery embedding.
key_aarray[number]requiredFirst component pattern embedding.
key_barray[number]requiredSecond component pattern embedding.
{
"composition_score": 0.78,
"individual_scores": {
"a": 0.65,
"b": 0.71
}
}Semantic similarity (vectors)
/v1/memory/semantic/similarityCompute cosine similarity between two embedding vectors.
key_aarray[number]requiredFirst embedding vector.
key_barray[number]requiredSecond embedding vector.
{
"similarity": 0.87
}Semantic clusters
/v1/memory/semantic/clustersGet the current cluster structure of the semantic space.
{
"clusters": [
{
"id": 0,
"size": 42,
"centroid_pattern_id": "pat_abc"
},
{
"id": 1,
"size": 28,
"centroid_pattern_id": "pat_def"
}
],
"total_patterns": 142
}Semantic rerank
/v1/memory/semantic/rerankRe-rank a list of candidates by semantic relevance to a query.
queryarray[number]requiredQuery embedding.
candidatesarrayrequiredArray of candidate objects to rerank.
Semantic pre-liaison
/v1/memory/semantic/pre-liaisonCreate a semantic pre-liaison between two text patterns.
key_astringrequiredFirst pattern (text, auto-embedded).
key_bstringrequiredSecond pattern (text, auto-embedded).
strengthnumberDefault: 0.8Link strength (0.0 to 1.0).
Semantic stats
/v1/memory/semantic/statsGet statistics about the semantic layer.
{
"total_patterns": 142,
"avg_similarity": 0.34,
"clusters": 5
}Explorer: Entropy
/v1/memory/explorer/entropyMeasure the entropy (information diversity) of your memory space.
{
"entropy": 0.78,
"max_possible": 1,
"pattern_count": 142
}Explorer: Select next
/v1/memory/explorer/select-nextSelect the next most informative pattern pair to explore (entropy-maximizing).
max_candidatesintegerDefault: 20Max candidate pairs to consider (1-100).
{
"selected": {
"pattern_a": "pat_abc",
"pattern_b": "pat_def",
"expected_information_gain": 0.34
}
}Explorer: Batch
/v1/memory/explorer/batchRun batch exploration across memory space.
batch_sizeintegerDefault: 5Number of explorations to run (1-20).
{
"explored": 5,
"compositions_found": 3,
"entropy_after": 0.82
}Consolidation: Preview
/v1/memory/consolidation/previewPreview what a consolidation cycle would do without executing it.
{
"merge_candidates": 12,
"estimated_patterns_after": 130
}Consolidation: Merge candidates
/v1/memory/consolidation/merge-candidatesList patterns that are candidates for merging (high similarity duplicates).
{
"candidates": [
{
"pattern_a": "pat_abc",
"pattern_b": "pat_def",
"similarity": 0.94
}
]
}Consolidation: Merge duplicates
/v1/memory/consolidation/merge-duplicatesExecute duplicate merging.
thresholdnumberDefault: 0.85Similarity threshold for merging (0.0 to 1.0).
{
"merged": 5,
"patterns_before": 142,
"patterns_after": 137
}Consolidation: Sleep
/v1/memory/consolidation/sleepTrigger a sleep consolidation cycle (LTD eviction, strengthening, reorganization).
modestringDefault: fullSleep mode: full or light.
protect_categoriesarray | nullCategories to protect from LTD eviction (e.g. ["identity", "health"]).
{
"status": "completed",
"evicted": 3,
"strengthened": 12,
"duration_ms": 2340
}Consolidation: Wake
/v1/memory/consolidation/wakeWake from sleep mode — reactivate normal operations after sleep consolidation.
{
"status": "awake"
}Consolidation: Status
/v1/memory/consolidation/statusGet the current consolidation status.
{
"status": "idle",
"last_run": "2026-01-14T03:00:00Z",
"next_scheduled": null
}Consolidation: Importance
/v1/memory/consolidation/importanceGet importance rankings for all patterns.
Consolidation: Protected
/v1/memory/consolidation/protectedList patterns protected from consolidation.
Consolidation: Sleep stats
/v1/memory/consolidation/sleep-statsStatistics about past sleep cycles.
{
"total_cycles": 42,
"last_cycle": {
"started_at": "2026-01-20T03:00:00Z",
"duration_ms": 4200,
"evicted": 3,
"strengthened": 12
}
}Diagnostics: Structure
/v1/memory/diagnostics/structureInspect the internal structure of the memory engine.
Diagnostics: Prefetch
/v1/memory/diagnostics/prefetchGet prefetch cache diagnostics.
Diagnostics: Warmup
/v1/memory/diagnostics/prefetch/warmupWarm up the prefetch cache around a query embedding.
queryarray[number]requiredQuery embedding to prefetch around.
Diagnostics: Invalidate
/v1/memory/diagnostics/prefetch/invalidateInvalidate the prefetch cache.
Configuration
/v1/memory/configRetrieve current engine configuration for your tenant.
{
"engine_version": "0.5.0",
"embedding_dim": 384,
"max_patterns": 5000,
"consolidation_enabled": true
}State: Save
/v1/memory/state/saveSave a snapshot of the current engine state.
{
"snapshot_id": "snap_abc123",
"patterns_count": 142,
"created_at": "2026-01-15T10:00:00Z"
}State: Restore
/v1/memory/state/restoreRestore the engine to a previously saved snapshot.
{
"restored": true,
"snapshot_id": "snap_abc123",
"patterns_restored": 142
}Restoring a snapshot is irreversible. All patterns stored after the snapshot was taken will be permanently lost.
Next steps
- Memory Core — Text-level memory operations
- Consolidation Guide — Best practices
- Errors — Error codes