POST
/
api
/
v1
/
memories
/
remember
Remember
curl --request POST \
  --url https://api.agent-mind.com/api/v1/memories/remember \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "content": "<string>",
  "user_id": "<string>",
  "session_id": "<string>",
  "metadata": {},
  "ttl": 123
}'

Overview

Store a new memory entry in your agent’s memory bank. The content can be any JSON-serializable data including strings, dictionaries, lists, or complex nested structures.

Request Body

content
string
required
The content to store in memory. This is the actual memory data.
user_id
string
Associate memory with a specific user or conversation.
session_id
string
Group memories by session for context management.
metadata
object
Additional metadata to attach to the memory for filtering and organization.
ttl
integer
Time-to-live in seconds. Memory will auto-expire after this duration.

Response

Returns an object with the stored memory details.

Examples

Basic Memory Storage

import requests

url = "https://api.agent-mind.com/api/v1/memories/remember"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "content": "User prefers dark mode and email notifications",
    "user_id": "user_123",
    "metadata": {
        "category": "preferences"
    }
}

response = requests.post(url, json=data, headers=headers)
print(response.json())

With Session Context

data = {
    "content": "Customer is interested in premium plan features",
    "user_id": "customer_456",
    "session_id": "session_789",
    "metadata": {
        "type": "sales_interaction",
        "priority": "high"
    },
    "ttl": 86400  # Expires in 24 hours
}

response = requests.post(url, json=data, headers=headers)

Error Responses

400 Bad Request

{
  "error": "Invalid request body"
}

401 Unauthorized

{
  "error": "Invalid or missing API key"
}

500 Internal Server Error

{
  "error": "Failed to store memory"
}