> ## Documentation Index
> Fetch the complete documentation index at: https://raveculture-mintlify-api-spec-sync-1774445910.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory API

> Store and retrieve key-value memory for agents

# Memory API

Store and retrieve persistent key-value data for your agents. All endpoints require session authentication and ownership of the agent.

## Get memory

```http theme={null}
GET /api/memory?agentId=agent_123
```

### Query parameters

| Parameter | Type   | Required | Description     |
| --------- | ------ | -------- | --------------- |
| `agentId` | string | Yes      | ID of the agent |

### Response

```json theme={null}
{
  "memory": {
    "preferences": { "theme": "dark" },
    "context": "Last conversation was about scheduling"
  },
  "agentId": "agent_123",
  "count": 2,
  "lastUpdated": "2026-03-19T00:00:00Z"
}
```

### Errors

| Code | Description                        |
| ---- | ---------------------------------- |
| 400  | `agentId` query parameter required |
| 401  | Unauthorized                       |
| 404  | Agent not found                    |

## Store memory (single key)

```http theme={null}
POST /api/memory
```

Write a single key-value pair to agent memory.

### Request body

| 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) |

### Response

```json theme={null}
{
  "success": true,
  "agentId": "agent_123",
  "key": "preferences",
  "saved": "2026-03-19T00:00:00Z"
}
```

### Errors

| Code | Description                                                               |
| ---- | ------------------------------------------------------------------------- |
| 400  | `agentId` required, memory data required, or value too large (max 100 KB) |
| 401  | Unauthorized                                                              |
| 404  | Agent not found                                                           |

## Store memory (bulk)

```http theme={null}
POST /api/memory
```

Write multiple key-value pairs in a single request.

### Request body

| Field     | Type   | Required | Description                                      |
| --------- | ------ | -------- | ------------------------------------------------ |
| `agentId` | string | Yes      | ID of the agent                                  |
| `memory`  | object | Yes      | Object of key-value pairs to store (max 50 keys) |

```json theme={null}
{
  "agentId": "agent_123",
  "memory": {
    "preferences": { "theme": "dark" },
    "context": "Scheduling discussion"
  }
}
```

### Response

```json theme={null}
{
  "success": true,
  "agentId": "agent_123",
  "keysUpdated": 2,
  "saved": "2026-03-19T00:00:00Z"
}
```

### Errors

| Code | Description                                                         |
| ---- | ------------------------------------------------------------------- |
| 400  | `agentId` required, memory data required, or too many keys (max 50) |
| 401  | Unauthorized                                                        |
| 404  | Agent not found                                                     |
