Overview
Update an existing memory’s content and metadata. This endpoint allows you to modify any aspect of a stored memory.
Path Parameters
The unique identifier of the memory to update.
Request Body
Updated content for the memory.
Category classification for the memory.
Array of tags to associate with the memory.
Importance score (0-1) for memory prioritization.
Confidence score (0-1) for the memory’s accuracy.
Source of the memory information.
Updated user association for the memory.
Updated session association for the memory.
Additional metadata to attach or update.
Response
Returns the updated memory object with all current values.
Examples
Update Memory Content
import requests
memory_id = "mem_abc123"
url = f"https://api.agent-mind.com/api/v1/memories/update/{memory_id}"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"content": "User strongly prefers email over phone calls",
"importance": 0.9
}
response = requests.put(url, json=data, headers=headers)
updated_memory = response.json()
data = {
"category": "customer_preferences",
"tags": ["communication", "high_priority", "verified"],
"confidence": 1.0,
"metadata": {
"last_verified": "2024-03-20",
"verified_by": "support_team",
"notes": "Confirmed directly with customer"
}
}
response = requests.put(url, json=data, headers=headers)
Complete Update
data = {
"content": "Customer has enterprise account with 500+ users",
"category": "account_info",
"tags": ["enterprise", "vip", "high_value"],
"importance": 1.0,
"confidence": 1.0,
"source": "sales_crm",
"user_id": "enterprise_customer_001",
"session_id": "q1_2024_review",
"metadata": {
"account_type": "enterprise",
"user_count": 523,
"contract_value": 150000,
"renewal_date": "2024-12-31"
}
}
response = requests.put(url, json=data, headers=headers)
Response Example
{
"id": "mem_abc123",
"content": "Customer has enterprise account with 500+ users",
"category": "account_info",
"tags": ["enterprise", "vip", "high_value"],
"importance": 1.0,
"confidence": 1.0,
"source": "sales_crm",
"user_id": "enterprise_customer_001",
"session_id": "q1_2024_review",
"metadata": {
"account_type": "enterprise",
"user_count": 523,
"contract_value": 150000,
"renewal_date": "2024-12-31"
},
"created_at": "2024-03-15T10:30:00Z",
"updated_at": "2024-03-20T14:45:00Z",
"status": "success"
}
Error Responses
400 Bad Request
{
"error": "Invalid update parameters"
}
401 Unauthorized
{
"error": "Invalid or missing API key"
}
404 Not Found
{
"error": "Memory not found or not owned by user"
}
500 Internal Server Error
{
"error": "Failed to update memory"
}