# Memory

> What agents remember (view, edit, forget): 4 endpoints of the Teemli API.

Source: https://docs.teemli.com/developers/reference/memory/

Generated from [`api/openapi.yaml`](/developers/api/) (OpenAPI 3.1). Base URL: `https://api.teemli.com`. Auth: `Authorization: Bearer <token or tml_ API key>`. Errors are `application/problem+json`; writes accept an `Idempotency-Key` header.

What agents remember (view, edit, forget)

## What my agents remember

```http
GET /v1/orgs/{org}/memory
```

My shared facts, facts my agents learned, what AI employees learned from me, and (for
AI employees I manage) their general knowledge. Only I can see this; admins can't.
Newest first.

**API keys:** needs the `agents:read` scope.

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `agent_id` | query | string (uuid) | Facts learned by this agent |
| `scope` | query | MemoryScope |  |
| `q` | query | string | Text search |
| `limit` | query | integer | Page size. |
| `cursor` | query | string | Opaque cursor from a previous page's `next_cursor`. |

**Responses**

- `200` A page of memory items — MemoryPage
- `401` Missing, invalid or expired token — Problem

## Add a fact

```http
POST /v1/orgs/{org}/memory
```

Without `agent_id`: shared with all my agents. With `agent_id`: kept with that agent
(for me). With `agent_id` of an AI employee I manage and `for_everyone: true`: its
general knowledge for everyone.

**API keys:** needs the `agents:write` scope.

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `text` (required) | string |  |
| `agent_id` | string (uuid) |  |
| `for_everyone` | boolean |  |

**Responses**

- `201` Saved — MemoryItem
- `401` Missing, invalid or expired token — Problem
- `403` Authenticated but not allowed (e.g. unverified email, not the agent's controller, card routed to someone else) — Problem
- `422` Invalid input — Problem

## Edit a fact

```http
PATCH /v1/orgs/{org}/memory/{memory}
```

**API keys:** needs the `agents:write` scope.

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `memory` (required) | path | string (uuid) |  |

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `text` (required) | string |  |

**Responses**

- `200` Updated — MemoryItem
- `401` Missing, invalid or expired token — Problem
- `404` Not found (also returned for rows the caller may not see, and for disabled features) — Problem
- `422` Invalid input — Problem

## Forget a fact

```http
DELETE /v1/orgs/{org}/memory/{memory}
```

**API keys:** needs the `agents:write` scope.

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `memory` (required) | path | string (uuid) |  |

**Responses**

- `200` Deleted — object
- `401` Missing, invalid or expired token — Problem
- `404` Not found (also returned for rows the caller may not see, and for disabled features) — Problem
