# Memories API

> Facts and preferences the assistant saves and recalls for each user.

Part of the AGNT API reference. AGNT (https://agnt.ai) is the developer platform behind OpenAssistant (https://openassistant.us). Docs index: https://agnt.ai/llms.txt. Web page: https://agnt.ai/reference/api/memories

Base URL: `https://api.agnt.ai`. Auth: `Authorization: Bearer ak_live_...`.

## GET /memories

List memories

Returns the user's memories, filtered by `tags`, `type`, `scope` or a text search.

Acts as one user: send `X-User-Email`.

**Query parameters**

- `page` (integer)
- `perPage` (integer)
- `tags` (string): Comma-separated tag filter
- `type` (string)
- `search` (string)
- `scope` (enum) One of: `user`, `team`.
- `contactEmail` (string): Shorthand for tags=contact:<email>
- `companyId` (string): Shorthand for tags=company:<id>

**Responses**

- `200`: Paginated memory list
  - `ok` (enum, required) One of: `true`.
  - `memories` (object[], required)
    - `id` (string, required)
    - `account` (string, required)
    - `user` (string, required)
    - `kind` (enum) One of: `unstructured`, `structured`.
    - `resourceType` (string | null)
    - `tags` (string[], required)
    - `content` (string | null)
    - `data` (object | null)
    - `source` (enum, required) One of: `system`, `user`.
    - `scope` (enum) One of: `user`, `team`.
    - `visibility` (enum) One of: `author_only`, `coordinators`, `all`.
    - `authoredBy` (string | null)
    - `assistant` (string | null)
    - `team` (string | null)
    - `startDate` (string | null)
    - `endDate` (string | null)
    - `isActive` (boolean, required)
    - `isExpired` (boolean, required)
    - `pinned` (boolean)
    - `metadata` (object)
    - `createdAt` (string, required)
    - `updatedAt` (string, required)
  - `page` (integer)
  - `perPage` (integer)
  - `total` (integer)
- `401`: No user on the call: send X-User-Email with an account key, or use a user-scoped key
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/memories' \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com"
```

Example response:

```json
{
  "ok": true,
  "memories": [
    {
      "id": "6702c7f3a4b5c6d7e8f9a0b1",
      "user": "6702b1e8f9a0b1c2d3e4f5a6",
      "content": "Prefers vendor quotes summarized in a table with price, lead time and warranty.",
      "tags": [
        "general"
      ],
      "source": "user",
      "scope": "user",
      "isActive": true,
      "createdAt": "2026-10-01T15:04:05Z"
    }
  ]
}
```

## POST /memories

Create a memory

Saves a memory for the user. Tags come from a fixed vocabulary, and a `date-memory` requires `startDate`.

Acts as one user: send `X-User-Email`.

**Request body** (JSON)

- `content` (string, required): The fact to remember
- `tags` (string[]): At least one; defaults to general. Use general, profile, date-memory or assistant-style, or a prefix: contact:<email>, company:<id>, event:<id>, task:<id>, file:<id>, workflow:<id>, skill:<name>, repo:<owner/repo>, title:<text>, profile:<slot>.
- `scope` (enum): team shares it with a team the user belongs to One of: `user`, `team`.
- `team` (string): Team id, with scope team
- `startDate` (string): Required with the date-memory tag
- `endDate` (string)
- `metadata` (object)

**Responses**

- `201`: Created memory
  - `ok` (enum, required) One of: `true`.
  - `memory` (object, required)
    - `id` (string, required)
    - `account` (string, required)
    - `user` (string, required)
    - `kind` (enum) One of: `unstructured`, `structured`.
    - `resourceType` (string | null)
    - `tags` (string[], required)
    - `content` (string | null)
    - `data` (object | null)
    - `source` (enum, required) One of: `system`, `user`.
    - `scope` (enum) One of: `user`, `team`.
    - `visibility` (enum) One of: `author_only`, `coordinators`, `all`.
    - `authoredBy` (string | null)
    - `assistant` (string | null)
    - `team` (string | null)
    - `startDate` (string | null)
    - `endDate` (string | null)
    - `isActive` (boolean, required)
    - `isExpired` (boolean, required)
    - `pinned` (boolean)
    - `metadata` (object)
    - `createdAt` (string, required)
    - `updatedAt` (string, required)
- `400`: A tag outside the vocabulary, or a date-memory without startDate
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)
- `401`: No user on the call: send X-User-Email with an account key, or use a user-scoped key
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/memories' \
  -X POST \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com" \
  -H "Content-Type: application/json" \
  -d '{
  "content": "Prefers vendor quotes summarized in a table with price, lead time and warranty.",
  "tags": [
    "general"
  ]
}'
```

Example response:

```json
{
  "ok": true,
  "memory": {
    "id": "6702c7f3a4b5c6d7e8f9a0b1",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "content": "Prefers vendor quotes summarized in a table with price, lead time and warranty.",
    "tags": [
      "general"
    ],
    "source": "user",
    "scope": "user",
    "isActive": true,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## GET /memories/{memoryId}

Retrieve a memory

Retrieves one of the user's memories.

Acts as one user: send `X-User-Email`.

**Path parameters**

- `memoryId` (string, required)

**Responses**

- `200`: Memory
  - Same fields as the `201` response of `POST /memories`.
- `401`: No user on the call: send X-User-Email with an account key, or use a user-scoped key
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)
- `404`: Not found
  - `status` (integer, required)
  - `error_code` (string)
  - `error` (string, required)

```bash
curl 'https://api.agnt.ai/memories/<memoryId>' \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com"
```

Example response:

```json
{
  "ok": true,
  "memory": {
    "id": "6702c7f3a4b5c6d7e8f9a0b1",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "content": "Prefers vendor quotes summarized in a table with price, lead time and warranty.",
    "tags": [
      "general"
    ],
    "source": "user",
    "scope": "user",
    "isActive": true,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## PUT /memories/{memoryId}

Update a memory

Updates a memory. Only the fields you send change, and tags are validated as on create.

Acts as one user: send `X-User-Email`.

**Path parameters**

- `memoryId` (string, required)

**Request body** (JSON)

- `content` (string)
- `tags` (string[])
- `scope` (enum) One of: `user`, `team`.
- `team` (string | null)
- `startDate` (string | null)
- `endDate` (string | null)
- `metadata` (object)

**Responses**

- `200`: Updated memory
  - Same fields as the `201` response of `POST /memories`.
- `401`: No user on the call: send X-User-Email with an account key, or use a user-scoped key
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/memories/<memoryId>' \
  -X PUT \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com" \
  -H "Content-Type: application/json" \
  -d '{
  "content": "Prefers vendor quotes summarized in a table with price, lead time, warranty and insurance expiry.",
  "tags": [
    "general"
  ]
}'
```

Example response:

```json
{
  "ok": true,
  "memory": {
    "id": "6702c7f3a4b5c6d7e8f9a0b1",
    "user": "6702b1e8f9a0b1c2d3e4f5a6",
    "content": "Prefers vendor quotes summarized in a table with price, lead time and warranty.",
    "tags": [
      "general"
    ],
    "source": "user",
    "scope": "user",
    "isActive": true,
    "createdAt": "2026-10-01T15:04:05Z"
  }
}
```

## DELETE /memories/{memoryId}

Delete a memory

Deletes a memory.

Acts as one user: send `X-User-Email`.

**Path parameters**

- `memoryId` (string, required)

**Responses**

- `200`: Deleted
  - `ok` (enum, required) One of: `true`.
  - `memory` (object, required)
    - `id` (string, required)
    - `deleted` (boolean)
    - `message` (string)
- `401`: No user on the call: send X-User-Email with an account key, or use a user-scoped key
  - `status` (integer)
  - `error_code` (string)
  - `error` (string)

```bash
curl 'https://api.agnt.ai/memories/<memoryId>' \
  -X DELETE \
  -H "Authorization: Bearer ak_live_..." \
  -H "X-User-Email: user@example.com"
```

Example response:

```json
{
  "ok": true,
  "memory": {
    "id": "6660c4a1f2e3b7d8a9c01234"
  }
}
```
