CAIN-42 CAIN Studio

API reference · CAIN Memory

Api Store Memory

POST /fabric/memory/store

Last reviewed 2026-10-02

POST /fabric/memory/store

Store a new memory with admission control.

Parameters

NameInTypeMeaning
X-Tenant-IDheaderstring or null

Request body

StoreMemoryRequest (required)

FieldTypeMeaning
agent_id requiredstringmin length 1 · max length 255
memory_type requiredstringpattern ^(episodic|semantic|procedural|preference|task|working|factual|experience|instruction|observation)$
content requiredstringmin length 1 · max length 65536
sourcestringpattern ^(agent|tool|human|delegated|system)$ · default "agent"
identity_idstring or null
source_typestringdefault "agent"
source_referencestring or null
confidencenumbermin 0.0 · max 1.0 · default 0.5
tagsarray of string or null
metadataobject or null
expires_atstring or null
provenanceobject or null
evidence_idstring or null
decision_idstring or null
trace_idstring or null
trajectory_idstring or null
sensitivitystringpattern ^(internal|confidential|restricted|public)$ · default "internal"

Responses

StatusMeaningBody
200Successful ResponseJSON
422Validation ErrorHTTPValidationError
401No key, or a key that is not validJSON detail
429Rate limit for your plan reached; retry after the Retry-After secondsJSON detail

Try it

This call changes data in the account the key belongs to.

The request goes from your browser straight to this site. Your key is not stored unless you tick the box, and then only in this tab's session storage.

Code

curl -sS -X POST 'https://cainstudio.online/fabric/memory/store' \
  -H "X-API-Key: $CAIN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"agent_id": "agent-id", "memory_type": "memory-type", "content": "content", "source": "agent", "source_type": "agent", "confidence": 0.5, "sensitivity": "internal"}'

Schemas used

HTTPValidationError · StoreMemoryRequest · ValidationError

← Api Get Stats · all 22 CAIN Memory calls · Api Set Trust Level →

Try CAIN-42 on your own agents

Create a free account and every new account starts with a 7-day trial of the full platform. Or try the sandbox first, with no account at all.

Create a free account →  ·  Try the sandbox  ·  See the whole ecosystem