CAIN-42 MCPGate

API reference · CAIN Memory

Api Store Memory

POST /fabric/memory/store

Last reviewed 2026-11-06

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
401The X-API-Key header is missing, or the key is unknown, revoked or replaced.Error
403The key is valid but may not do this (for example an agent key approving its own held action).Error
422Validation ErrorHTTPValidationError
429Rate limit or monthly quota reached. Wait for the number of seconds in Retry-After when it is sent.Error

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

Error · 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 30-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