Skip to main content

Memory API Reference

Authentication​

All endpoints require the following headers:

x-api-key: <your-api-key>
x-api-secret: <your-api-secret>
Content-Type: application/json

Endpoints​

Get Agent Memory Settings

GET /agents/{agent_id}/memory-settings

Returns the current memory configuration for an agent.

Response example:

{
"memory_enabled": true,
"max_memories": 50,
"auto_approve": false,
"memory_types": ["preference", "fact", "context"]
}
Update Agent Memory Settings

PUT /agents/{agent_id}/memory-settings

Enables, disables, or updates memory configuration for an agent.

Request body:

{
"memory_enabled": true,
"max_memories": 50,
"auto_approve": false,
"memory_types": ["preference", "fact", "context"]
}

Response example:

{
"success": true,
"message": "Memory settings updated successfully",
"settings": {
"memory_enabled": true,
"max_memories": 50,
"auto_approve": false,
"memory_types": ["preference", "fact", "context"]
}
}
Get Approved Memories For an Agent

GET /agents/{agent_id}/memories

Returns all approved memories for an agent, grouped by user.

Response example:

{
"memories_by_user": {
"user_123": [
{
"id": "memory_abc",
"agent_id": "agent_123",
"user_id": "user_123",
"memory_content": "User prefers concise technical answers.",
"memory_type": "preference",
"confidence_score": 0.92,
"status": "approved",
"created_at": 1710000000,
"updated_at": 1710000100,
"approved_at": 1710000100,
"source_message_id": "msg_123"
}
]
},
"total_users": 1,
"total_memories": 1
}
Get Approved Memories For a Specific User

GET /agents/{agent_id}/memories/user/{user_id}

Returns approved memory records for one user and one agent.

Response example:

[
{
"id": "memory_abc",
"agent_id": "agent_123",
"user_id": "user_123",
"memory_content": "User prefers concise technical answers.",
"memory_type": "preference",
"confidence_score": 0.92,
"status": "approved",
"created_at": 1710000000,
"updated_at": 1710000100,
"approved_at": 1710000100,
"source_message_id": "msg_123"
}
]
Get Pending Memory Approvals

GET /memory-approvals/pending

Returns pending memory approvals for the authenticated user. Optionally filter by agent using ?agent_id={agent_id}.

Response example:

[
{
"id": "memory_abc",
"agent_id": "agent_123",
"user_id": "user_123",
"memory_content": "User prefers concise technical answers.",
"memory_type": "preference",
"confidence_score": 0.92,
"source_message": "Please keep answers short and technical.",
"created_at": 1710000000,
"expires_at": 1710604800
}
]
Approve or Reject a Memory

POST /memory-approvals/{memory_id}/action

Approves or rejects a pending memory record.

Request body:

{
"action": "approve"
}

Response example:

{
"success": true,
"message": "Memory approved successfully",
"memory_id": "memory_abc"
}
Delete a Memory

DELETE /memories/{memory_id}

Deletes a memory record by marking it as rejected.

Response example:

{
"success": true,
"message": "Memory deleted successfully",
"memory_id": "memory_abc"
}