Skip to main content

Endpoint

POST /v1/memory

Request Body

{
  "type": "semantic",
  "key": "facts/project-alpha",
  "content": "Project Alpha uses Rust for the backend.",
  "pinned": false,
  "importance": 0.8,
  "expiresIn": "30d",
  "embedding": [0.1, 0.2, 0.3],
  "metadata": {
    "tags": ["project", "architecture"],
    "visibility": "private"
  }
}

Parameters

FieldTypeRequiredDescription
typestringBuilt-in type or custom:*
keystringUnique key within this type
contentstringThe memory content (max 10 MB)
expiresInstringTTL: {n}{unit}. Default: 30d
pinnedbooleanImmune to TTL cleanup. Default: false
importancenumber0.01.0. Default: 0.5
embeddingnumber[]Float array for vector search
metadataobjecttags (string[]) and visibility
blobFilenamestringCustom blob name
blobExtensionstringFile extension (e.g. ".pdf")
mimeTypestringMIME type for binary content
encryptionProviderstringe.g. "engram-aes-256-gcm"
encryptionMetaobject{ iv, tag } for encrypted content

Response (201)

{
  "id": "7cf4b433-4bb2-4522-980e-ad3ee4f270b9",
  "type": "semantic",
  "key": "facts/project-alpha",
  "version": 1,
  "blobName": "memory/semantic/facts/project-alpha/v1",
  "sizeBytes": 42,
  "pinned": false,
  "importance": 0.8,
  "isCompressed": false,
  "encryptionProvider": null,
  "createdAt": "2026-03-23T19:29:58.023Z"
}

Credit Cost

This operation costs 5 credits (memory.write).

Errors

StatusReason
400Missing/invalid fields
409Key already exists (use PUT to update)
413Content too large or quota exceeded
422Credentials detected in shared content