Create memory
Create a memory.
/v1/agents/:agentId/memoriesOverview
Memories are short notes an agent keeps between sessions, such as a user's preferences. Each belongs to one agent, and its userId cannot change. Use these endpoints to add, search, read, edit, and remove memories. Reading through the API does not change lastAccessedAt; the agent's own use does, and that decides which memory is removed first when the agent is full.
Endpoints
List memoriesGET/v1/agents/:agentId/memories
List an agent's memories.
Lists or searches an agent's memories, newest first, one page at a time. Pass nextCursor back as cursor for the next page. Reading memories here does not change their lastAccessedAt.
Request
Requires bearer authentication.
| Field | Type | Location | Required | Description |
|---|---|---|---|---|
agentId | string | path | required | ID of the agent. |
userId | string | query | Return only memories for this end user. Send an empty string for general memories, or leave it out for all memories. | |
search | string | query | Return only memories whose text matches these words. | |
cursor | string | query | nextCursor from the previous page. Leave it out for the first page. | |
limit | integer | query | Maximum number of memories to return. 1–100. Defaults to 50. |
Response
The created memory.
The created memory.
Returns 200 OK as application/json. A page of memories.
Response schema: MemoryList.
{
"data": [
{
"id": "mem_6Jd2Pq8LzR4wYk1C",
"tenantId": "ten_8Hq2Zr5WcY1bJt6D",
"agentId": "ag_4kP9sT2vXq7LmN3a",
"userId": "user_42",
"text": "Prefers concise answers.",
"createdAt": "2026-07-10T10:00:00.000Z",
"updatedAt": "2026-07-10T10:00:00.000Z",
"lastAccessedAt": "2026-07-10T10:00:00.000Z"
}
],
"nextCursor": null
}Errors
| Status | Codes | Description |
|---|---|---|
400 | validation_failed, invalid_cursor | The request is invalid |
401 | unauthorized | The credential is missing or invalid |
402 | subscription_required | An active subscription or usage credit is required |
404 | not_found | The resource was not found |
See REST errors for the error envelope and shared codes.
cURL
curl "$BLAZING_AGENTS_BASE_URL/v1/agents/ag_1234567890ABCDEF/memories" \
--header "Authorization: Bearer $BLAZING_AGENTS_API_KEY"Create memoryPOST/v1/agents/:agentId/memories
Create a memory.
Adds a memory to an agent. An agent keeps up to 500 memories; when it is full, the least recently used memory is removed to make room. The Location header points to the new memory.
Request
Requires bearer authentication and a JSON body.
| Field | Type | Location | Required | Description |
|---|---|---|---|---|
agentId | string | path | required | ID of the agent. |
text | string | body | required | The note to remember, up to 10 KiB. |
userId | string | body | The end user this memory belongs to. Only turns that pass the same userId see it. Leave it out or send an empty string for a general memory that every turn of the agent sees. It cannot change after creation. Defaults to "". |
Response
The created memory.
The created memory.
Returns 201 Created as application/json. The created memory. Sets Location: URL of the created memory.
Response schema: Memory.
{
"memory": {
"id": "mem_6Jd2Pq8LzR4wYk1C",
"tenantId": "ten_8Hq2Zr5WcY1bJt6D",
"agentId": "ag_4kP9sT2vXq7LmN3a",
"userId": "user_42",
"text": "Prefers concise answers.",
"createdAt": "2026-07-10T10:00:00.000Z",
"updatedAt": "2026-07-10T10:00:00.000Z",
"lastAccessedAt": "2026-07-10T10:00:00.000Z"
}
}Errors
| Status | Codes | Description |
|---|---|---|
400 | validation_failed | The request is invalid |
401 | unauthorized | The credential is missing or invalid |
402 | subscription_required | An active subscription or usage credit is required |
404 | not_found | The resource was not found |
See REST errors for the error envelope and shared codes.
cURL
curl --request POST "$BLAZING_AGENTS_BASE_URL/v1/agents/ag_1234567890ABCDEF/memories" \
--header "Authorization: Bearer $BLAZING_AGENTS_API_KEY" \
--header "Content-Type: application/json" \
--data '{"text":"Prefers concise answers.","userId":"user_42"}'Get memoryGET/v1/agents/:agentId/memories/:memoryId
Get a memory.
Retrieves one memory. Reading it here does not change its lastAccessedAt.
Request
Requires bearer authentication.
| Field | Type | Location | Required | Description |
|---|---|---|---|---|
agentId | string | path | required | ID of the agent that owns the memory. |
memoryId | string | path | required | ID of the memory. |
Response
The created memory.
The created memory.
Returns 200 OK as application/json. The memory.
Response schema: Memory.
{
"memory": {
"id": "mem_6Jd2Pq8LzR4wYk1C",
"tenantId": "ten_8Hq2Zr5WcY1bJt6D",
"agentId": "ag_4kP9sT2vXq7LmN3a",
"userId": "user_42",
"text": "Prefers concise answers.",
"createdAt": "2026-07-10T10:00:00.000Z",
"updatedAt": "2026-07-10T10:00:00.000Z",
"lastAccessedAt": "2026-07-10T10:00:00.000Z"
}
}Errors
| Status | Codes | Description |
|---|---|---|
400 | validation_failed | The request is invalid |
401 | unauthorized | The credential is missing or invalid |
402 | subscription_required | An active subscription or usage credit is required |
404 | not_found | The resource was not found |
See REST errors for the error envelope and shared codes.
cURL
curl "$BLAZING_AGENTS_BASE_URL/v1/agents/ag_1234567890ABCDEF/memories/mem_1234567890ABCDEF" \
--header "Authorization: Bearer $BLAZING_AGENTS_API_KEY"Update memoryPATCH/v1/agents/:agentId/memories/:memoryId
Update a memory.
Replaces a memory's text and marks it as used now, which moves it to the back of the line for removal when the agent is full. Its userId cannot change.
Request
Requires bearer authentication and a JSON body.
| Field | Type | Location | Required | Description |
|---|---|---|---|---|
agentId | string | path | required | ID of the agent that owns the memory. |
memoryId | string | path | required | ID of the memory. |
text | string | body | required | Replacement text for the memory, up to 10 KiB. |
Response
The created memory.
The created memory.
Returns 200 OK as application/json. The updated memory.
Response schema: Memory.
{
"memory": {
"id": "mem_6Jd2Pq8LzR4wYk1C",
"tenantId": "ten_8Hq2Zr5WcY1bJt6D",
"agentId": "ag_4kP9sT2vXq7LmN3a",
"userId": "user_42",
"text": "Prefers answers under five lines.",
"createdAt": "2026-07-10T10:00:00.000Z",
"updatedAt": "2026-07-10T10:15:00.000Z",
"lastAccessedAt": "2026-07-10T10:15:00.000Z"
}
}Errors
| Status | Codes | Description |
|---|---|---|
400 | validation_failed | The request is invalid |
401 | unauthorized | The credential is missing or invalid |
402 | subscription_required | An active subscription or usage credit is required |
404 | not_found | The resource was not found |
See REST errors for the error envelope and shared codes.
cURL
curl --request PATCH "$BLAZING_AGENTS_BASE_URL/v1/agents/ag_1234567890ABCDEF/memories/mem_1234567890ABCDEF" \
--header "Authorization: Bearer $BLAZING_AGENTS_API_KEY" \
--header "Content-Type: application/json" \
--data '{"text":"Prefers answers under five lines."}'Delete memoryDELETE/v1/agents/:agentId/memories/:memoryId
Delete a memory.
Permanently deletes a memory.
Request
Requires bearer authentication.
| Field | Type | Location | Required | Description |
|---|---|---|---|---|
agentId | string | path | required | ID of the agent that owns the memory. |
memoryId | string | path | required | ID of the memory. |
Response
The created memory.
The created memory.
Returns 204 No Content. The memory was deleted.
Errors
| Status | Codes | Description |
|---|---|---|
400 | validation_failed | The request is invalid |
401 | unauthorized | The credential is missing or invalid |
402 | subscription_required | An active subscription or usage credit is required |
404 | not_found | The resource was not found |
See REST errors for the error envelope and shared codes.
cURL
curl --request DELETE "$BLAZING_AGENTS_BASE_URL/v1/agents/ag_1234567890ABCDEF/memories/mem_1234567890ABCDEF" \
--header "Authorization: Bearer $BLAZING_AGENTS_API_KEY"Next
- Memory to let an agent remember across sessions.
- Service limits for memory size and count limits.