Skip to content

API Reference ​

Base URL: https://core.mnemoverse.com/api/v1

All endpoints require authentication via X-Api-Key header or Authorization: Bearer header.

Authentication ​

Include your API key in every request:

bash
# Option 1: X-Api-Key header (recommended)
curl -H "X-Api-Key: mk_live_YOUR_KEY" ...

# Option 2: Bearer token
curl -H "Authorization: Bearer mk_live_YOUR_KEY" ...

Endpoints ​

POST /memory/write ​

Store a single memory atom.

Request:

FieldTypeRequiredDescription
contentstringYesThe insight, pattern, or lesson to remember (1-10,000 chars)
conceptsstring[]NoKey concepts for Hebbian associations
domainstringNoNamespace: general, user:X, project:Z (default: general)
metadataobjectNoArbitrary key-value metadata
external_refstringNoClient-provided unique reference for idempotent writes

Response:

FieldTypeDescription
storedbooleanTrue if the atom passed the importance gate
atom_idUUIDUUID of the stored atom, or null if filtered
importancefloatComputed importance score [0, 1]
reasonstringWhy stored or filtered

POST /memory/write-batch ​

Store up to 500 atoms in one request.

Request:

FieldTypeRequiredDescription
itemsWriteRequest[]YesArray of write requests (1-500)

Response:

FieldTypeDescription
total_countintTotal atoms processed
stored_countintAtoms that passed importance gate
resultsobject[]Per-atom results with index, stored, atom_id, importance, error

POST /memory/read ​

Query memory with semantic search + Hebbian expansion.

Request:

FieldTypeRequiredDescription
querystringYesNatural language query (1-5,000 chars)
top_kintNoMax results (1-100, default: 10)
domainstringNoFilter by domain (null = all)
min_relevancefloatNoMinimum relevance threshold (0-1, default: 0.3)
include_associationsboolNoExpand via Hebbian associations (default: true)
conceptsstring[]NoConcept hints to bias search

Response:

FieldTypeDescription
itemsMemoryItem[]Matching memories, ordered by relevance
episodic_hitbooleanTrue if exact fingerprint match found
query_conceptsstring[]Concepts extracted from query
expanded_conceptsstring[]Concepts after Hebbian expansion
search_time_msfloatSearch duration in milliseconds

MemoryItem fields:

FieldTypeDescription
atom_idUUIDUnique identifier
contentstringStored text content
relevancefloatFinal score (similarity * valence modulation)
similarityfloatRaw cosine similarity
valencefloatOutcome polarity [-1, +1]
importancefloatImportance score [0, 1]
sourcestringHit source: episodic, semantic, or hebbian
conceptsstring[]Associated concepts
domainstringDomain namespace
metadataobjectArbitrary metadata

POST /memory/read-batch ​

Batch query up to 50 queries in one request.

Request:

FieldTypeRequiredDescription
queriesReadRequest[]YesArray of read requests (1-50)

Response:

FieldTypeDescription
resultsReadResponse[]Per-query results

POST /memory/query ​

Advanced query with multi-domain and metadata filtering.

Request:

FieldTypeRequiredDescription
querystringYesNatural language query
domainsstring[]NoFilter by multiple domains
metadata_filterFilter[]NoJSONB metadata conditions (eq, contains, in)
top_kintNoMax results (default: 10)
min_relevancefloatNoMin relevance (default: 0.3)
include_associationsboolNoHebbian expansion (default: true)
conceptsstring[]NoConcept hints

POST /memory/feedback ​

Report outcome (success/failure) for memories. Updates valence and Hebbian associations.

Request:

FieldTypeRequiredDescription
atom_idsUUID[]YesAtoms to update
outcomefloatYesOutcome signal: -1.0 (failure) to +1.0 (success)
conceptsstring[]NoConcepts to reinforce
query_conceptsstring[]NoOriginal query concepts (enables co-activation learning)
domainstringNoDomain for the feedback

Response:

FieldTypeDescription
updated_countintNumber of atoms updated
avg_valencefloatAverage valence after update
coactivation_edgesintHebbian edges created/updated

POST /memory/consolidate ​

Trigger sleep consolidation. Clusters similar memories into prototypes, protects distinctive ones as singletons.

Request:

FieldTypeRequiredDescription
domainstringNoDomain to consolidate (null = general)

Response:

FieldTypeDescription
domainstringDomain consolidated
atoms_beforeintAtom count before
atoms_afterintAtom count after
prototypes_createdintNew prototype atoms
singletons_protectedintVon Restorff protected atoms
compression_ratiofloatatoms_before / atoms_after
duration_msfloatDuration in milliseconds

GET /memory/stats ​

Get memory statistics for your tenant.

Response:

FieldTypeDescription
total_atomsintTotal atoms stored
episodesintEpisode-type atoms
prototypesintPrototype atoms (from consolidation)
singletonsintProtected singleton atoms
hebbian_edgesintConcept-concept association edges
domainsstring[]Active domain names
avg_valencefloatAverage outcome valence
avg_importancefloatAverage importance score

GET /health ​

Liveness probe. No authentication required.

Response: {"status": "ok", "database": true, "version": "1.0.0"}

GET /health/ready ​

Deep readiness check (database + engine + embedding model). No authentication required.

Response: {"ready": true, "checks": {"database": true, "engine": true, "embedding": true}, "version": "1.0.0"}


Error Responses ​

All errors follow a consistent format:

json
{
  "code": "UNAUTHORIZED",
  "message": "Invalid or missing API key",
  "requestId": "req_abc123",
  "retryable": false,
  "details": null
}
HTTP StatusCodeDescription
401UNAUTHORIZEDInvalid or missing API key
403FORBIDDENAPI key lacks permission
429RATE_LIMITEDToo many requests. Check Retry-After header
422VALIDATION_ERRORInvalid request body
500INTERNAL_ERRORServer error (retryable)

Rate Limits ​

Rate limits depend on your plan:

PlanRequests/minQueries/dayAtoms
Free601,00010,000
Pro60050,000500,000
Team3,000500,0005,000,000

Rate limit headers are included in every response:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1712345678