> ## Documentation Index
> Fetch the complete documentation index at: https://docs.creao.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent memory

> Read, overwrite, and clear long-term memory for personal CREAO agents via the Developer API.

## Overview

Every personal CREAO agent has long-term memory (called **Playbooks** in the product UI). Memory is created automatically as the agent runs and learns reusable workflow rules. The Developer API lets you read that memory, overwrite it, or clear it.

Memory is scoped per agent. Changing one agent's memory never affects another.

## Read memory

```bash theme={null}
curl https://developer.creao.ai/v1/agents/00000000-0000-4000-8000-000000000000/memory \
  -H "Authorization: Bearer cr_sk_your_key_here"
```

```json theme={null}
{
  "items": [
    {
      "id": "7",
      "name": "region-check",
      "content": "Always validate region before deploy.",
      "trigger": "Deployment request",
      "rationale": "Learned from repeated corrections.",
      "status": "approved",
      "created_at": "2026-07-01T00:00:00.000Z"
    }
  ]
}
```

Optional query params:

* `status` — `pending`, `approved`, `rejected`, `all`, or a comma-separated list
* `limit` — default `500`, max `1000`

An agent with no memory returns `{ "items": [] }`.

## Overwrite memory

`PUT` replaces the entire memory set. New items are written first; previous items are deleted only after that write succeeds, so a failed overwrite leaves the existing memory untouched.

```bash theme={null}
curl -X PUT https://developer.creao.ai/v1/agents/00000000-0000-4000-8000-000000000000/memory \
  -H "Authorization: Bearer cr_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [
      {
        "name": "region-check",
        "content": "Always validate region before deploy.",
        "trigger": "Deployment request",
        "status": "approved"
      }
    ]
  }'
```

Rules:

* Max **100** items per request
* Each `content` value is capped at **8 KB**
* `status` defaults to `approved` when omitted (so items apply on the next run)
* Pass `"items": []` to clear memory via overwrite

## Clear memory

```bash theme={null}
curl -X DELETE https://developer.creao.ai/v1/agents/00000000-0000-4000-8000-000000000000/memory \
  -H "Authorization: Bearer cr_sk_your_key_here"
```

```json theme={null}
{
  "ok": true,
  "deleted_count": 3
}
```

## Errors

| Code                 | When                                                                |
| -------------------- | ------------------------------------------------------------------- |
| `AGENT_NOT_FOUND`    | Agent is missing, not personal, or not owned by the API key account |
| `FEATURE_DISABLED`   | Agent memory is not configured in this environment                  |
| `INVALID_INPUT`      | Bad UUID, status filter, or request body                            |
| `REFLEXIO_*` / `502` | Upstream memory service failed                                      |

See also the OpenAPI operations under [Agent Memory](/developer-api/agent-memory/get-agent-memory).
