curl -X POST "https://api.memchat.io/v1/memories" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": "I just got promoted to Senior Software Engineer at Google! I'll be working on their ML infrastructure team." }, { "role": "assistant", "content": "Congratulations on your promotion! That's a significant achievement. Working on ML infrastructure at Google must be exciting." }, { "role": "user", "content": "Thanks! I'm really excited. I'll be leading a team of 5 engineers and working on scaling their recommendation systems." } ], "agent_id": "career-advisor-bot", "thread_id": "conversation-2024-001", "source": "chat", "metadata": { "timestamp": "2024-03-20T10:00:00Z", "platform": "web-app", "session_id": "session-abc123" } }'
Copy
{ "success": true, "memories_created": 3, "processing_time": "1.8s", "categories_detected": ["career", "identity"], "memories": [ { "id": "mem_789abc", "memory": "Recently promoted to Senior Software Engineer at Google", "categories": ["career"], "type": "episodic", "created_at": "2024-03-20T10:00:15Z" }, { "id": "mem_456def", "memory": "Works on ML infrastructure team at Google", "categories": ["career"], "type": "semantic", "created_at": "2024-03-20T10:00:15Z" }, { "id": "mem_123ghi", "memory": "Leads a team of 5 engineers working on recommendation systems", "categories": ["career"], "type": "episodic", "created_at": "2024-03-20T10:00:15Z" } ]}
Memory Management
Store Memories
Extract and store memories from conversation messages
POST
/
v1
/
memories
Copy
curl -X POST "https://api.memchat.io/v1/memories" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": "I just got promoted to Senior Software Engineer at Google! I'll be working on their ML infrastructure team." }, { "role": "assistant", "content": "Congratulations on your promotion! That's a significant achievement. Working on ML infrastructure at Google must be exciting." }, { "role": "user", "content": "Thanks! I'm really excited. I'll be leading a team of 5 engineers and working on scaling their recommendation systems." } ], "agent_id": "career-advisor-bot", "thread_id": "conversation-2024-001", "source": "chat", "metadata": { "timestamp": "2024-03-20T10:00:00Z", "platform": "web-app", "session_id": "session-abc123" } }'
Copy
{ "success": true, "memories_created": 3, "processing_time": "1.8s", "categories_detected": ["career", "identity"], "memories": [ { "id": "mem_789abc", "memory": "Recently promoted to Senior Software Engineer at Google", "categories": ["career"], "type": "episodic", "created_at": "2024-03-20T10:00:15Z" }, { "id": "mem_456def", "memory": "Works on ML infrastructure team at Google", "categories": ["career"], "type": "semantic", "created_at": "2024-03-20T10:00:15Z" }, { "id": "mem_123ghi", "memory": "Leads a team of 5 engineers working on recommendation systems", "categories": ["career"], "type": "episodic", "created_at": "2024-03-20T10:00:15Z" } ]}
Store and process conversation messages to extract meaningful memories. MemSync will automatically analyze the conversation, extract facts, categorize them, and store them as searchable memories.
Array of memory categories detected in the conversation
Copy
curl -X POST "https://api.memchat.io/v1/memories" \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": "I just got promoted to Senior Software Engineer at Google! I'll be working on their ML infrastructure team." }, { "role": "assistant", "content": "Congratulations on your promotion! That's a significant achievement. Working on ML infrastructure at Google must be exciting." }, { "role": "user", "content": "Thanks! I'm really excited. I'll be leading a team of 5 engineers and working on scaling their recommendation systems." } ], "agent_id": "career-advisor-bot", "thread_id": "conversation-2024-001", "source": "chat", "metadata": { "timestamp": "2024-03-20T10:00:00Z", "platform": "web-app", "session_id": "session-abc123" } }'
Copy
{ "success": true, "memories_created": 3, "processing_time": "1.8s", "categories_detected": ["career", "identity"], "memories": [ { "id": "mem_789abc", "memory": "Recently promoted to Senior Software Engineer at Google", "categories": ["career"], "type": "episodic", "created_at": "2024-03-20T10:00:15Z" }, { "id": "mem_456def", "memory": "Works on ML infrastructure team at Google", "categories": ["career"], "type": "semantic", "created_at": "2024-03-20T10:00:15Z" }, { "id": "mem_123ghi", "memory": "Leads a team of 5 engineers working on recommendation systems", "categories": ["career"], "type": "episodic", "created_at": "2024-03-20T10:00:15Z" } ]}
{ "messages": [ { "role": "user", "content": "I'm a software engineer who loves hiking and photography" }, { "role": "assistant", "content": "That's a great combination! Do you have any favorite hiking spots where you like to take photos?" }, { "role": "user", "content": "Yes! I love going to Yosemite National Park. I've been there 5 times in the past 2 years." } ]}