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

Request Body

content
string
required
The memory text. Max 8,192 characters.
metadata
object
Arbitrary key-value metadata. Max 4 KB, 20 keys, 3 levels deep.
importance
number
Float between 0 and 1. Affects ranking in recall. Default: 0.5.
namespace
string
Isolate memories per project or context. Default: "default". Max 255 characters.
memory_type
string
One of: correction, preference, decision, project, observation, general. Each type has a different decay half-life. Default: "general".
session_id
string
Session identifier for multi-agent scoping. Max 255 characters.
agent_id
string
Agent identifier for multi-agent scoping. Max 255 characters.
expires_at
string
ISO 8601 date string. Memory auto-expires after this time and is excluded from all queries. Must be in the future.
pinned
boolean
Pin this memory to exempt it from decay. Default: false.
immutable
boolean
Lock the memory from future updates and deletes. Default: false. Once stored as immutable, the memory cannot be modified or removed (returns 409 Conflict).

Response (201 Created)

id
string
UUID of the stored memory.
stored
boolean
Always true.
deduplicated
boolean
Whether the memory was deduplicated (merged with an existing similar memory instead of creating a new one).
tokens_used
number
Embedding tokens consumed.

Example

curl -X POST https://api.memoclaw.com/v1/store \
  -H "Content-Type: application/json" \
  -d '{
    "content": "User prefers dark mode and vim keybindings",
    "metadata": {
      "tags": ["preferences", "ui"]
    },
    "importance": 0.8
  }'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "stored": true,
  "deduplicated": false,
  "tokens_used": 15
}