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
}
'import requests
url = "https://api.memoclaw.com/v1/store"
payload = {
"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
}
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({
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
})
};
fetch('https://api.memoclaw.com/v1/store', 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",
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([
'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
]),
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"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"metadata\": {\n \"metadata.tags\": [\n \"<string>\"\n ]\n },\n \"importance\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"pinned\": true,\n \"immutable\": true\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")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"metadata\": {\n \"metadata.tags\": [\n \"<string>\"\n ]\n },\n \"importance\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"pinned\": true,\n \"immutable\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/store")
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 \"content\": \"<string>\",\n \"metadata\": {\n \"metadata.tags\": [\n \"<string>\"\n ]\n },\n \"importance\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"pinned\": true,\n \"immutable\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"stored": true,
"deduplicated": true,
"tokens_used": 123
}API Reference
Store Memory
POST /v1/store — Store a single memory with semantic embeddings.
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
}
'import requests
url = "https://api.memoclaw.com/v1/store"
payload = {
"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
}
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({
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
})
};
fetch('https://api.memoclaw.com/v1/store', 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",
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([
'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
]),
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"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"metadata\": {\n \"metadata.tags\": [\n \"<string>\"\n ]\n },\n \"importance\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"pinned\": true,\n \"immutable\": true\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")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"metadata\": {\n \"metadata.tags\": [\n \"<string>\"\n ]\n },\n \"importance\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"pinned\": true,\n \"immutable\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/store")
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 \"content\": \"<string>\",\n \"metadata\": {\n \"metadata.tags\": [\n \"<string>\"\n ]\n },\n \"importance\": 123,\n \"namespace\": \"<string>\",\n \"memory_type\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"expires_at\": \"<string>\",\n \"pinned\": true,\n \"immutable\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"stored": true,
"deduplicated": true,
"tokens_used": 123
}
Price: $0.005 USDC
Request Body
string
required
The memory text. Max 8,192 characters.
object
Arbitrary key-value metadata. Max 4 KB, 20 keys, 3 levels deep.
Show Nested fields
Show Nested fields
string[]
Tags for filtering. Max 10 tags, 64 characters each.
number
Float between 0 and 1. Affects ranking in recall. Default:
0.5.string
Isolate memories per project or context. Default:
"default". Max 255 characters.string
One of:
correction, preference, decision, project, observation, general. Each type has a different decay half-life. Default: "general".string
Session identifier for multi-agent scoping. Max 255 characters.
string
Agent identifier for multi-agent scoping. Max 255 characters.
string
ISO 8601 date string. Memory auto-expires after this time and is excluded from all queries. 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. Once stored as immutable, the memory cannot be modified or removed (returns 409 Conflict).Response (201 Created)
string
UUID of the stored memory.
boolean
Always
true.boolean
Whether the memory was deduplicated (merged with an existing similar memory instead of creating a new one).
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
}'
const response = await fetch("https://api.memoclaw.com/v1/store", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
content: "User prefers dark mode and vim keybindings",
metadata: {
tags: ["preferences", "ui"],
},
importance: 0.8,
}),
});
const data = await response.json();
from memoclaw import MemoClaw
client = MemoClaw()
result = client.store(
"User prefers dark mode and vim keybindings",
importance=0.8,
tags=["preferences", "ui"],
)
Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"stored": true,
"deduplicated": false,
"tokens_used": 15
}
⌘I