Skip to main content
POST
https://api.memoclaw.com
/
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
}
'
{
  "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

messages
array
Array of conversation messages ({role, content}). Provide either messages or text.
text
string
Raw text to extract facts from. Provide either messages or text.
namespace
string
Namespace for extracted memories. Default: "default".
session_id
string
Session identifier for multi-agent scoping.
agent_id
string
Agent identifier for multi-agent scoping.
auto_relate
boolean
Automatically create relations between extracted facts. Default: false.

Response (201 Created)

memory_ids
array
Array of UUIDs for the stored memories.
facts_extracted
number
Total facts extracted from the input.
facts_stored
number
Facts that were stored (after deduplication).
facts_deduplicated
number
Facts that were skipped because they already existed.
relations_created
number
Number of relations created between facts (when auto_relate is true).
tokens_used
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
  }'
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.