Ingest
curl --request POST \
--url https://api.memoclaw.com/v1/ingest \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{}
],
"text": "<string>",
"namespace": "<string>",
"session_id": "<string>",
"agent_id": "<string>",
"auto_relate": true
}
'import requests
url = "https://api.memoclaw.com/v1/ingest"
payload = {
"messages": [{}],
"text": "<string>",
"namespace": "<string>",
"session_id": "<string>",
"agent_id": "<string>",
"auto_relate": 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({
messages: [{}],
text: '<string>',
namespace: '<string>',
session_id: '<string>',
agent_id: '<string>',
auto_relate: true
})
};
fetch('https://api.memoclaw.com/v1/ingest', 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/ingest",
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([
'messages' => [
[
]
],
'text' => '<string>',
'namespace' => '<string>',
'session_id' => '<string>',
'agent_id' => '<string>',
'auto_relate' => 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/ingest"
payload := strings.NewReader("{\n \"messages\": [\n {}\n ],\n \"text\": \"<string>\",\n \"namespace\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"auto_relate\": 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/ingest")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {}\n ],\n \"text\": \"<string>\",\n \"namespace\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"auto_relate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/ingest")
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 \"messages\": [\n {}\n ],\n \"text\": \"<string>\",\n \"namespace\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"auto_relate\": true\n}"
response = http.request(request)
puts response.read_body{
"memory_ids": [
{}
],
"facts_extracted": 123,
"facts_stored": 123,
"facts_deduplicated": 123,
"relations_created": 123,
"tokens_used": 123
}API Reference
Ingest
POST /v1/ingest — Zero-effort ingestion: dump a conversation or raw text, get extracted facts, dedup, and auto-relations.
POST
/
v1
/
ingest
Ingest
curl --request POST \
--url https://api.memoclaw.com/v1/ingest \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{}
],
"text": "<string>",
"namespace": "<string>",
"session_id": "<string>",
"agent_id": "<string>",
"auto_relate": true
}
'import requests
url = "https://api.memoclaw.com/v1/ingest"
payload = {
"messages": [{}],
"text": "<string>",
"namespace": "<string>",
"session_id": "<string>",
"agent_id": "<string>",
"auto_relate": 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({
messages: [{}],
text: '<string>',
namespace: '<string>',
session_id: '<string>',
agent_id: '<string>',
auto_relate: true
})
};
fetch('https://api.memoclaw.com/v1/ingest', 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/ingest",
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([
'messages' => [
[
]
],
'text' => '<string>',
'namespace' => '<string>',
'session_id' => '<string>',
'agent_id' => '<string>',
'auto_relate' => 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/ingest"
payload := strings.NewReader("{\n \"messages\": [\n {}\n ],\n \"text\": \"<string>\",\n \"namespace\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"auto_relate\": 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/ingest")
.header("Content-Type", "application/json")
.body("{\n \"messages\": [\n {}\n ],\n \"text\": \"<string>\",\n \"namespace\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"auto_relate\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memoclaw.com/v1/ingest")
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 \"messages\": [\n {}\n ],\n \"text\": \"<string>\",\n \"namespace\": \"<string>\",\n \"session_id\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"auto_relate\": true\n}"
response = http.request(request)
puts response.read_body{
"memory_ids": [
{}
],
"facts_extracted": 123,
"facts_stored": 123,
"facts_deduplicated": 123,
"relations_created": 123,
"tokens_used": 123
}
Price: $0.01 USDC
Ingest is the easiest way to add memories. Dump a conversation or raw text and MemoClaw will extract facts, deduplicate against existing memories, and optionally create relations between them — all in one call.
Request Body
array
Array of conversation messages (
{role, content}). Provide either messages or text.string
Raw text to extract facts from. Provide either
messages or text.string
Namespace for extracted memories. Default:
"default".string
Session identifier for multi-agent scoping.
string
Agent identifier for multi-agent scoping.
boolean
Automatically create relations between extracted facts. Default:
false.Response (201 Created)
array
Array of UUIDs for the stored memories.
number
Total facts extracted from the input.
number
Facts that were stored (after deduplication).
number
Facts that were skipped because they already existed.
number
Number of relations created between facts (when
auto_relate is true).number
Tokens consumed by the LLM extraction.
Example
curl -X POST https://api.memoclaw.com/v1/ingest \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "I prefer dark mode and use vim. My timezone is PST."},
{"role": "assistant", "content": "Got it! Dark mode, vim, and PST timezone noted."}
],
"namespace": "default",
"auto_relate": true
}'
const response = await fetch("https://api.memoclaw.com/v1/ingest", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
messages: [
{ role: "user", content: "I prefer dark mode and use vim. My timezone is PST." },
{ role: "assistant", content: "Got it! Dark mode, vim, and PST timezone noted." },
],
namespace: "default",
auto_relate: true,
}),
});
memoclaw ingest "I prefer dark mode and use vim. My timezone is PST."
from memoclaw import MemoClaw
client = MemoClaw()
result = client.ingest(
messages=[
{"role": "user", "content": "I prefer dark mode and use vim. My timezone is PST."},
{"role": "assistant", "content": "Got it! Dark mode, vim, and PST timezone noted."},
],
auto_relate=True,
)
Response
{
"memory_ids": [
"550e8400-e29b-41d4-a716-446655440020",
"550e8400-e29b-41d4-a716-446655440021",
"550e8400-e29b-41d4-a716-446655440022"
],
"facts_extracted": 3,
"facts_stored": 3,
"facts_deduplicated": 0,
"relations_created": 2,
"tokens_used": 185
}
Ingest combines extract, dedup, and relate into a single call. If you only need extraction without dedup/relations, use the Extract endpoint instead.
⌘I