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
}
]
}
'import requests
url = "https://api.memoclaw.com/v1/store/batch"
payload = { "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
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
}
]
})
};
fetch('https://api.memoclaw.com/v1/store/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.memoclaw.com/v1/store/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.memoclaw.com/v1/store/batch"
payload := strings.NewReader("{\n \"memories\": [\n {\n \"memories[].content\": \"<string>\",\n \"memories[].metadata\": {},\n \"memories[].importance\": 123,\n \"memories[].namespace\": \"<string>\",\n \"memories[].memory_type\": \"<string>\",\n \"memories[].session_id\": \"<string>\",\n \"memories[].agent_id\": \"<string>\",\n \"memories[].expires_at\": \"<string>\",\n \"memories[].pinned\": true,\n \"memories[].immutable\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.memoclaw.com/v1/store/batch")
.header("Content-Type", "application/json")
.body("{\n \"memories\": [\n {\n \"memories[].content\": \"<string>\",\n \"memories[].metadata\": {},\n \"memories[].importance\": 123,\n \"memories[].namespace\": \"<string>\",\n \"memories[].memory_type\": \"<string>\",\n \"memories[].session_id\": \"<string>\",\n \"memories[].agent_id\": \"<string>\",\n \"memories[].expires_at\": \"<string>\",\n \"memories[].pinned\": true,\n \"memories[].immutable\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/store/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"memories\": [\n {\n \"memories[].content\": \"<string>\",\n \"memories[].metadata\": {},\n \"memories[].importance\": 123,\n \"memories[].namespace\": \"<string>\",\n \"memories[].memory_type\": \"<string>\",\n \"memories[].session_id\": \"<string>\",\n \"memories[].agent_id\": \"<string>\",\n \"memories[].expires_at\": \"<string>\",\n \"memories[].pinned\": true,\n \"memories[].immutable\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ids": [
"<string>"
],
"stored": true,
"count": 123,
"deduplicated_count": 123,
"tokens_used": 123
}API Reference
Store Batch
POST /v1/store/batch — Store up to 100 memories in a single request.
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
}
]
}
'import requests
url = "https://api.memoclaw.com/v1/store/batch"
payload = { "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
}
] }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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
}
]
})
};
fetch('https://api.memoclaw.com/v1/store/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.memoclaw.com/v1/store/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.memoclaw.com/v1/store/batch"
payload := strings.NewReader("{\n \"memories\": [\n {\n \"memories[].content\": \"<string>\",\n \"memories[].metadata\": {},\n \"memories[].importance\": 123,\n \"memories[].namespace\": \"<string>\",\n \"memories[].memory_type\": \"<string>\",\n \"memories[].session_id\": \"<string>\",\n \"memories[].agent_id\": \"<string>\",\n \"memories[].expires_at\": \"<string>\",\n \"memories[].pinned\": true,\n \"memories[].immutable\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.memoclaw.com/v1/store/batch")
.header("Content-Type", "application/json")
.body("{\n \"memories\": [\n {\n \"memories[].content\": \"<string>\",\n \"memories[].metadata\": {},\n \"memories[].importance\": 123,\n \"memories[].namespace\": \"<string>\",\n \"memories[].memory_type\": \"<string>\",\n \"memories[].session_id\": \"<string>\",\n \"memories[].agent_id\": \"<string>\",\n \"memories[].expires_at\": \"<string>\",\n \"memories[].pinned\": true,\n \"memories[].immutable\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/store/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"memories\": [\n {\n \"memories[].content\": \"<string>\",\n \"memories[].metadata\": {},\n \"memories[].importance\": 123,\n \"memories[].namespace\": \"<string>\",\n \"memories[].memory_type\": \"<string>\",\n \"memories[].session_id\": \"<string>\",\n \"memories[].agent_id\": \"<string>\",\n \"memories[].expires_at\": \"<string>\",\n \"memories[].pinned\": true,\n \"memories[].immutable\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"ids": [
"<string>"
],
"stored": true,
"count": 123,
"deduplicated_count": 123,
"tokens_used": 123
}
Price: $0.04 USDC
Request Body
array
required
Array of memory objects. Min 1, max 100. Each object accepts the same fields as Store Memory.
Show Memory object fields
Show Memory object fields
string
required
The memory text. Max 8,192 characters.
object
Arbitrary key-value metadata. Max 4 KB, 20 keys, 3 levels deep.
number
Float between 0 and 1. Default:
0.5.string
Namespace to isolate memories. Default:
"default". Max 255 characters.string
One of:
correction, preference, decision, project, observation, general. Default: "general".string
Session identifier. Max 255 characters.
string
Agent identifier. Max 255 characters.
string
ISO 8601 date string. Must be in the future.
boolean
Pin this memory to exempt it from decay. Default:
false.boolean
Lock the memory from future updates and deletes. Default:
false.Response (201 Created)
string[]
Array of UUIDs for the stored memories.
boolean
Always
true.number
Number of memories stored.
number
Number of memories that were deduplicated (merged with existing similar memories).
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
}
]
}'
const response = await fetch("https://api.memoclaw.com/v1/store/batch", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
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,
},
],
}),
});
const data = await response.json();
from memoclaw import MemoClaw
client = MemoClaw()
result = client.store_batch([
{"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
}
⌘I