Skip to main content
POST
/
v1
/
store
/
batch
Store Batch
curl --request POST \
  --url https://api.memoclaw.com/v1/store/batch \
  --header 'Content-Type: application/json' \
  --data '
{
  "memories": [
    {
      "memories[].content": "<string>",
      "memories[].metadata": {},
      "memories[].importance": 123,
      "memories[].namespace": "<string>",
      "memories[].memory_type": "<string>",
      "memories[].session_id": "<string>",
      "memories[].agent_id": "<string>",
      "memories[].expires_at": "<string>",
      "memories[].pinned": true,
      "memories[].immutable": true
    }
  ]
}
'
{
  "ids": [
    "<string>"
  ],
  "stored": true,
  "count": 123,
  "deduplicated_count": 123,
  "tokens_used": 123
}
Price: $0.04 USDC

Request Body

memories
array
required
Array of memory objects. Min 1, max 100. Each object accepts the same fields as Store Memory.

Response (201 Created)

ids
string[]
Array of UUIDs for the stored memories.
stored
boolean
Always true.
count
number
Number of memories stored.
deduplicated_count
number
Number of memories that were deduplicated (merged with existing similar memories).
tokens_used
number
Total embedding tokens consumed.

Example

curl -X POST https://api.memoclaw.com/v1/store/batch \
  -H "Content-Type: application/json" \
  -d '{
    "memories": [
      {
        "content": "User prefers dark mode and vim keybindings",
        "metadata": { "tags": ["preferences"] },
        "importance": 0.8
      },
      {
        "content": "Project uses PostgreSQL with pgvector extension",
        "metadata": { "tags": ["stack", "database"] },
        "importance": 0.6
      }
    ]
  }'
Response
{
  "ids": [
    "550e8400-e29b-41d4-a716-446655440000",
    "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  ],
  "stored": true,
  "count": 2,
  "deduplicated_count": 0,
  "tokens_used": 28
}