curl -X PATCH 'https://api.memchat.io/memories/mem_123abc' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"updated_at": "2024-01-15T16:30:00Z"
},
"category": "learning"
}'
import requests
url = "https://api.memchat.io/memories/mem_123abc"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"updated_at": "2024-01-15T16:30:00Z"
},
"category": "learning"
}
response = requests.patch(url, headers=headers, json=data)
memory = response.json()
const response = await fetch('https://api.memchat.io/memories/mem_123abc', {
method: 'PATCH',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: 'Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.',
metadata: {
location: 'Stanford Medical Center',
participants: ['Sarah Johnson', 'Dr. Martinez'],
updated_at: '2024-01-15T16:30:00Z'
},
category: 'learning'
}),
});
const memory = await response.json();
{
"memory_id": "mem_123abc",
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"category": "learning",
"memory_type": "episodic",
"importance": 0.85,
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"source": "conversation",
"updated_at": "2024-01-15T16:30:00Z"
},
"embeddings": [0.123, -0.456, 0.789, ...],
"created_at": "2024-01-15T14:30:00Z",
"updated_at": "2024-01-15T16:30:00Z"
}
Memory Management
Update Memory
Update an existing memory entry with new content, metadata, or category classification
PATCH
/
memories
/
{memory_id}
curl -X PATCH 'https://api.memchat.io/memories/mem_123abc' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"updated_at": "2024-01-15T16:30:00Z"
},
"category": "learning"
}'
import requests
url = "https://api.memchat.io/memories/mem_123abc"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"updated_at": "2024-01-15T16:30:00Z"
},
"category": "learning"
}
response = requests.patch(url, headers=headers, json=data)
memory = response.json()
const response = await fetch('https://api.memchat.io/memories/mem_123abc', {
method: 'PATCH',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: 'Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.',
metadata: {
location: 'Stanford Medical Center',
participants: ['Sarah Johnson', 'Dr. Martinez'],
updated_at: '2024-01-15T16:30:00Z'
},
category: 'learning'
}),
});
const memory = await response.json();
{
"memory_id": "mem_123abc",
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"category": "learning",
"memory_type": "episodic",
"importance": 0.85,
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"source": "conversation",
"updated_at": "2024-01-15T16:30:00Z"
},
"embeddings": [0.123, -0.456, 0.789, ...],
"created_at": "2024-01-15T14:30:00Z",
"updated_at": "2024-01-15T16:30:00Z"
}
Updates a specific memory entry by ID. You can modify the memory content, metadata, category, or memory type.
curl -X PATCH 'https://api.memchat.io/memories/mem_123abc' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"updated_at": "2024-01-15T16:30:00Z"
},
"category": "learning"
}'
import requests
url = "https://api.memchat.io/memories/mem_123abc"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"updated_at": "2024-01-15T16:30:00Z"
},
"category": "learning"
}
response = requests.patch(url, headers=headers, json=data)
memory = response.json()
const response = await fetch('https://api.memchat.io/memories/mem_123abc', {
method: 'PATCH',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: 'Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.',
metadata: {
location: 'Stanford Medical Center',
participants: ['Sarah Johnson', 'Dr. Martinez'],
updated_at: '2024-01-15T16:30:00Z'
},
category: 'learning'
}),
});
const memory = await response.json();
Path Parameters
string
required
The unique identifier of the memory to update
Request Body
string
Updated text content of the memory
object
Additional metadata to update for the memory
string
Updated memory category. One of:
identity, career, interests, relationships, health, finance, learning, travel, productivity, privatestring
Updated memory type:
semantic or episodicnumber
Updated importance score between 0.0 and 1.0
Response
string
Unique identifier of the updated memory
string
Updated text content of the memory
string
Updated memory category
string
Updated memory type (semantic or episodic)
number
Updated importance score
object
Updated memory metadata
array
Vector embeddings for the updated content (if content was modified)
string
ISO 8601 timestamp when the memory was originally created
string
ISO 8601 timestamp when the memory was last updated
{
"memory_id": "mem_123abc",
"content": "Updated: Had an amazing conversation with Sarah about machine learning applications in healthcare. She mentioned some innovative approaches to medical imaging.",
"category": "learning",
"memory_type": "episodic",
"importance": 0.85,
"metadata": {
"location": "Stanford Medical Center",
"participants": ["Sarah Johnson", "Dr. Martinez"],
"source": "conversation",
"updated_at": "2024-01-15T16:30:00Z"
},
"embeddings": [0.123, -0.456, 0.789, ...],
"created_at": "2024-01-15T14:30:00Z",
"updated_at": "2024-01-15T16:30:00Z"
}
Error Responses
object
Memory not found
{
"error": "Memory not found",
"code": "MEMORY_NOT_FOUND",
"memory_id": "mem_123abc"
}
object
Invalid request data
{
"error": "Invalid category specified",
"code": "INVALID_CATEGORY",
"valid_categories": ["identity", "career", "interests", "relationships", "health", "finance", "learning", "travel", "productivity", "private"]
}
object
Unauthorized access
{
"error": "Invalid or expired API key",
"code": "UNAUTHORIZED"
}
object
Access denied - memory belongs to another user
{
"error": "Access denied",
"code": "FORBIDDEN"
}
Notes
- Only the fields provided in the request body will be updated
- If content is updated, new embeddings will be automatically generated
- Category changes may trigger re-classification and profile updates
- Memory type changes will affect how the memory is retrieved in searches
- All updates are versioned internally for audit purposes

