curl -X POST https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize \
-H "x-api-key: $ENGRAMME_API_KEY" \
-F "file=@meeting-notes.txt" \
-F "user_name=John Doe" \
-F "item_id=meeting-2025-01-15" \
-F "source_type=text"
import os
import requests
response = requests.post(
"https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize",
headers={"x-api-key": os.environ["ENGRAMME_API_KEY"]},
files={"file": open("meeting-notes.txt", "rb")},
data={
"user_name": "John Doe",
"item_id": "meeting-2025-01-15",
"source_type": "text"
}
)
print(response.json())
const apiKey = process.env.ENGRAMME_API_KEY;
const formData = new FormData();
formData.append('file', new Blob(['Meeting notes'], { type: 'text/plain' }), 'meeting-notes.txt');
formData.append('user_name', 'John Doe');
formData.append('item_id', 'meeting-2025-01-15');
formData.append('source_type', 'text');
const response = await fetch(
'https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize',
{
method: 'POST',
headers: { 'x-api-key': apiKey },
body: formData
}
);
{
"status": "success",
"user_id": "user_abc123",
"item_id": "meeting-2025-01-15",
"workflow_execution": "projects/engramme/locations/us-central1/workflows/realtime-memory-pipeline/executions/exec-abc123"
}
{
"detail": "File must be valid UTF-8 encoded text"
}
{
"detail": "UNAUTHORIZED: API key not valid. Please pass a valid API key."
}
{
"detail": "Item ID 'meeting-2025-01-15' already exists or is currently being processed"
}
API Reference
Train Document
Submit a document for LMM training
POST
/
v1
/
memorize
curl -X POST https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize \
-H "x-api-key: $ENGRAMME_API_KEY" \
-F "file=@meeting-notes.txt" \
-F "user_name=John Doe" \
-F "item_id=meeting-2025-01-15" \
-F "source_type=text"
import os
import requests
response = requests.post(
"https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize",
headers={"x-api-key": os.environ["ENGRAMME_API_KEY"]},
files={"file": open("meeting-notes.txt", "rb")},
data={
"user_name": "John Doe",
"item_id": "meeting-2025-01-15",
"source_type": "text"
}
)
print(response.json())
const apiKey = process.env.ENGRAMME_API_KEY;
const formData = new FormData();
formData.append('file', new Blob(['Meeting notes'], { type: 'text/plain' }), 'meeting-notes.txt');
formData.append('user_name', 'John Doe');
formData.append('item_id', 'meeting-2025-01-15');
formData.append('source_type', 'text');
const response = await fetch(
'https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize',
{
method: 'POST',
headers: { 'x-api-key': apiKey },
body: formData
}
);
{
"status": "success",
"user_id": "user_abc123",
"item_id": "meeting-2025-01-15",
"workflow_execution": "projects/engramme/locations/us-central1/workflows/realtime-memory-pipeline/executions/exec-abc123"
}
{
"detail": "File must be valid UTF-8 encoded text"
}
{
"detail": "UNAUTHORIZED: API key not valid. Please pass a valid API key."
}
{
"detail": "Item ID 'meeting-2025-01-15' already exists or is currently being processed"
}
Submit a document for LMM training. The response confirms that asynchronous training has started; memories may take a short time to become recallable.
The document file to train on. Text files are limited to 10MB. PDFs are limited to 20MB.
Optional unique identifier for this document. Auto-generated if not provided.
May contain word characters plus
-, _, =, !, and :. Max 500 characters.Source type for training and access control. See Source Types.
curl -X POST https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize \
-H "x-api-key: $ENGRAMME_API_KEY" \
-F "file=@meeting-notes.txt" \
-F "user_name=John Doe" \
-F "item_id=meeting-2025-01-15" \
-F "source_type=text"
import os
import requests
response = requests.post(
"https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize",
headers={"x-api-key": os.environ["ENGRAMME_API_KEY"]},
files={"file": open("meeting-notes.txt", "rb")},
data={
"user_name": "John Doe",
"item_id": "meeting-2025-01-15",
"source_type": "text"
}
)
print(response.json())
const apiKey = process.env.ENGRAMME_API_KEY;
const formData = new FormData();
formData.append('file', new Blob(['Meeting notes'], { type: 'text/plain' }), 'meeting-notes.txt');
formData.append('user_name', 'John Doe');
formData.append('item_id', 'meeting-2025-01-15');
formData.append('source_type', 'text');
const response = await fetch(
'https://memorymachines-gateway-prod-btf57kda.uc.gateway.dev/v1/memorize',
{
method: 'POST',
headers: { 'x-api-key': apiKey },
body: formData
}
);
{
"status": "success",
"user_id": "user_abc123",
"item_id": "meeting-2025-01-15",
"workflow_execution": "projects/engramme/locations/us-central1/workflows/realtime-memory-pipeline/executions/exec-abc123"
}
{
"detail": "File must be valid UTF-8 encoded text"
}
{
"detail": "UNAUTHORIZED: API key not valid. Please pass a valid API key."
}
{
"detail": "Item ID 'meeting-2025-01-15' already exists or is currently being processed"
}
Processing
workflow_execution is a backend training reference. Most clients do not need to call it directly.
If you provide an item_id, the API may return 409 while the same item is currently being trained. Use stable unique IDs when you want deduplication; omit item_id for simple training requests.
