PUT
/
api
/
v1
/
memories
/
update
/
{memory_id}
Update Memory
curl --request PUT \
  --url https://api.agent-mind.com/api/v1/memories/update/{memory_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "<string>",
  "category": "<string>",
  "tags": [
    {}
  ],
  "importance": 123,
  "confidence": 123,
  "source": "<string>",
  "user_id": "<string>",
  "session_id": "<string>",
  "metadata": {}
}'

Overview

Update an existing memory’s content and metadata. This endpoint allows you to modify any aspect of a stored memory.

Path Parameters

memory_id
string
required
The unique identifier of the memory to update.

Request Body

content
string
Updated content for the memory.
category
string
Category classification for the memory.
tags
array
Array of tags to associate with the memory.
importance
number
Importance score (0-1) for memory prioritization.
confidence
number
Confidence score (0-1) for the memory’s accuracy.
source
string
Source of the memory information.
user_id
string
Updated user association for the memory.
session_id
string
Updated session association for the memory.
metadata
object
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()

Update Metadata and Tags

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"
}