Skip to content

Add Memory

Ingest unstructured data into the Memory Cluster.

The ingestion API operates on an asynchronous, event-driven model. Requests are validated and acknowledged immediately (202 Accepted), then offloaded to a background worker queue. The data undergoes a specific transformation sequence before becoming searchable:

  • Shift-Left Temporal Resolution: The pipeline scans source.content for relative time references (e.g., “next Friday”, “in three days”). These are resolved into absolute ISO 8601 timestamps at the moment of ingestion, creating a deterministic temporal index.
  • Semantic Enrichment: The system applies bidirectional expansion, injecting implicit context (themes, synonyms) to maximize vector overlap.
  • Dual-Write Persistence: Data is synchronously committed to both the Metadata Store and Vector Database.
  • Centroid Calibration: Finally, the user’s semantic centroid is recalculated to reflect the new memory distribution, influencing future adaptive search modes.
Memory ingestion pipeline

Submit a text-based memory payload.

FieldTypeStatusDescription
source.typeStringREQUIREDMust be text.
source.contentStringREQUIREDThe raw text to ingest. This field is parsed for automatic relative date resolution (Shift-Left).
userContextStringOPTIONALAdditional meta-context (e.g., “Slack Message”, “Email from CEO”) used to guide the enrichment engine.
Terminal window
curl -X POST "https://api.memorymodel.dev/v1/memory" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-end-user-id: user_123" \
-d '{
"source": {
"type": "text",
"content": "The project deadline has been moved to next Friday."
},
"userContext": "Slack message from Project Manager"
}'
{
"status": "Accepted",
"jobId": "job_1700000000000_user_123"
}

Submit an image for multimodal processing. The system extracts visual features and semantic context, integrating them into the memory graph alongside text nodes.

FieldTypeStatusDescription
imageDataStringREQUIREDBase64-encoded image string.
userContextStringOPTIONALContext to anchor the visual analysis (e.g., “Screenshot of error logs”).
Terminal window
curl -X POST "https://api.memorymodel.dev/v1/memory/image" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"imageData": "iVBORw0KGgoAAAANSUhEUgAAAAE...",
"userContext": "Screenshot of the error message"
}'
{
"status": "Accepted",
"jobId": "img_job_1700000000000_user_123",
"previewUrl": "https://storage.googleapis.com/..."
}

Submit a PDF document for automatic processing and ingestion. The system accepts PDF files via multipart/form-data, queues them, extracts text from each page, and links them logically within the Memory Graph.

FieldTypeStatusDescription
fileFile (Binary)REQUIREDThe PDF file to be uploaded. Must be application/pdf.
Terminal window
curl -X POST "https://api.memorymodel.dev/v1/ingest/document/upload" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-end-user-id: user_123" \
-F "file=@/path/to/your/document.pdf"
{
"status": "Accepted",
"jobId": "doc_job_1700000000000_user_123",
"storagePath": "projects/memorymodel/docs/user_123/document.pdf"
}