curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v2/projects/proj-a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/memories' \ -H 'Authorization: Bearer sk_xxxxxx' \ -H 'Content-Type: application/json' \ -d '{ "messages": [ {"role": "user", "content": "What restaurants do you recommend in Hangzhou?"}, {"role": "assistant", "content": "I recommend trying Grandma'\''s Kitchen for Hangzhou cuisine and Green Tea Restaurant for a modern take on local dishes."} ], "user_id": "user-abc123", "chat_session_id": "session-abc123", "infer": true }'
{ "success": true, "message": "Operation completed successfully", "data": { "results": [ { "message": "Memory processing has been queued for background execution", "status": "PENDING", "event_id": "97ba056d-df1b-4236-886a-4db825f29227" } ] }}
Memories
Add Memory
Submit a conversation to extract and store memories
POST /openapi/memorylake/api/v2/projects/{id}/memories
Submits a user–assistant conversation to the project. Structured memories are automatically extracted from the messages and stored asynchronously. The response includes an event ID that can be used to track processing progress.
curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v2/projects/proj-a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6/memories' \ -H 'Authorization: Bearer sk_xxxxxx' \ -H 'Content-Type: application/json' \ -d '{ "messages": [ {"role": "user", "content": "What restaurants do you recommend in Hangzhou?"}, {"role": "assistant", "content": "I recommend trying Grandma'\''s Kitchen for Hangzhou cuisine and Green Tea Restaurant for a modern take on local dishes."} ], "user_id": "user-abc123", "chat_session_id": "session-abc123", "infer": true }'