Skip to main content

POST /store

Store a memory in your agent's persistent memory space.

Request

POST https://api.lawmem.ai/store
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Body Parameters

FieldTypeRequiredDescription
textstringYesThe text to store and embed
namespacestringYesLogical partition (e.g. client ID, matter number)
metadataobjectNoArbitrary key-value pairs stored with the memory

Example

curl -X POST https://api.lawmem.ai/store \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Client has a strict no-arbitration clause in all vendor contracts.",
"namespace": "client-acme",
"metadata": {"source": "intake", "date": "2026-03-21"}
}'

Response

{
"id": "mem_a1b2c3d4",
"namespace": "client-acme",
"tokens": 18,
"created_at": "2026-03-21T12:00:00Z"
}
FieldDescription
idUnique memory identifier — save this to delete later
namespaceThe namespace this memory was stored in
tokensToken count used for this call
created_atISO 8601 timestamp