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
The content to store in memory. This is the actual memory data.
Associate memory with a specific user or conversation.
Group memories by session for context management.
Additional metadata to attach to the memory for filtering and organization.
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"
}