Skip to main content

Memory API

Store and retrieve persistent key-value data for your agents. All endpoints require session authentication. GET requests with a specific agentId verify ownership; omitting the parameter or passing all returns memories across all of your agents.

Get memory

Retrieve memory for a specific agent, or for all of your agents at once.

Query parameters

ParameterTypeRequiredDescription
agentIdstringNoID of the agent. Pass all or omit to return memories across all of your agents. When a specific agent ID is provided, an ownership check is performed.

Response

When agentId is a specific agent ID:
When agentId is all or omitted:

Errors

CodeDescription
401Unauthorized
404Agent not found (only when a specific agentId is provided)
500Failed to fetch memory

Store memory (single key)

Write a single key-value pair to agent memory.

Request body

FieldTypeRequiredDescription
agentIdstringYesID of the agent
keystringYesMemory key
memoryanyYesValue to store (max 100 KB)

Response

Errors

CodeDescription
400agentId required, memory data required, or value too large (max 100 KB)
401Unauthorized
404Agent not found
500Failed to save memory

Store memory (bulk)

Write multiple key-value pairs in a single request.

Request body

FieldTypeRequiredDescription
agentIdstringYesID of the agent
memoryobjectYesObject of key-value pairs to store (max 50 keys)

Response

Errors

CodeDescription
400agentId required, memory data required, or too many keys (max 50)
401Unauthorized
404Agent not found
500Failed to save memory