API Reference
Memory API
Store and retrieve key-value memory for agents
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Store and retrieve key-value memory for agents
GET /api/memory?agentId=agent_123
| Parameter | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | ID of the agent |
{
"memory": {
"preferences": { "theme": "dark" },
"context": "Last conversation was about scheduling"
},
"agentId": "agent_123",
"count": 2,
"lastUpdated": "2026-03-19T00:00:00Z"
}
| Code | Description |
|---|---|
| 400 | agentId query parameter required |
| 401 | Unauthorized |
| 404 | Agent not found |
POST /api/memory
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | ID of the agent |
key | string | Yes | Memory key |
memory | any | Yes | Value to store (max 100 KB) |
{
"success": true,
"agentId": "agent_123",
"key": "preferences",
"saved": "2026-03-19T00:00:00Z"
}
| Code | Description |
|---|---|
| 400 | agentId required, memory data required, or value too large (max 100 KB) |
| 401 | Unauthorized |
| 404 | Agent not found |
POST /api/memory
| Field | Type | Required | Description |
|---|---|---|---|
agentId | string | Yes | ID of the agent |
memory | object | Yes | Object of key-value pairs to store (max 50 keys) |
{
"agentId": "agent_123",
"memory": {
"preferences": { "theme": "dark" },
"context": "Scheduling discussion"
}
}
{
"success": true,
"agentId": "agent_123",
"keysUpdated": 2,
"saved": "2026-03-19T00:00:00Z"
}
| Code | Description |
|---|---|
| 400 | agentId required, memory data required, or too many keys (max 50) |
| 401 | Unauthorized |
| 404 | Agent not found |
Was this page helpful?