Price: $0.01 USDC (includes LLM processing)
Extract automatically identifies and stores important facts from a conversation. The LLM parses the messages and creates individual memories for each distinct fact, with automatic deduplication.
Request Body
Array of conversation messages. Each message must have role (string) and content (string). Max 100 messages, 8,192 characters per message.
Namespace for extracted memories. Default: "default".
Associate extracted memories with a session.
Associate extracted memories with an agent.
Response (201 Created)
UUIDs of the stored memories (includes both new and deduplicated).
Total facts identified by the LLM.
New facts stored (not duplicates).
Facts that matched existing memories (skipped).
Total tokens consumed (LLM + embeddings).
Example
curl -X POST https://api.memoclaw.com/v1/memories/extract \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "I prefer dark mode in all my apps. Also, my timezone is PST."},
{"role": "assistant", "content": "Got it! I will remember your preferences."}
]
}'
{
"memory_ids": [
"550e8400-e29b-41d4-a716-446655440010",
"550e8400-e29b-41d4-a716-446655440011"
],
"facts_extracted": 2,
"facts_stored": 2,
"facts_deduplicated": 0,
"tokens_used": 185
}
The LLM automatically assigns importance and memory type based on the content. Corrections and preferences get higher importance; observations get lower. Each fact is deduplicated against existing memories.