# Memory

URL: /business/nouns/memory · Id: `noun:memory`

> A Memory is a Worker’s own Collection of what it has learned and kept, read by its Functions.

A Memory is a [Worker](/business/nouns/worker)’s own [Collection](/business/nouns/collection) of what it has learned and kept, read by its [Functions](/business/nouns/function).

## Properties
<details>
<summary>Inherited from [Collection](/business/nouns/collection): 1 property</summary>

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | `json` | No | The saved query that defines a dynamic Collection. |

</details>

<details>
<summary>Inherited from [Thing](/business/nouns/thing): 4 properties</summary>

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The stable identifier, which never changes. |
| `type` | list of [Noun](/business/nouns/noun) | Yes | The Nouns this Thing is an instance of. |
| `state` | `string` | No | The current state in its lifecycle. |
| `outside` | `json` | No | The ids this Thing has in outside tools, one per Integration, so a re-run matches instead of duplicating. |

</details>

## Object
```json
{
  "$id": "https://api.sb/shiftnote.app/memories/memory_1",
  "$type": "Memory",
  "id": "Example id",
  "type": [
    "noun_1"
  ],
  "state": "Example state",
  "outside": {},
  "query": {}
}
```

## Relationships
- <a id="rel-held-by"></a>A Memory **is held by** one [Worker](/business/nouns/worker): a [Worker](/business/nouns/worker)’s own Memory of what it has learned, read by its [Functions](/business/nouns/function) and kept within its [Startup](/business/nouns/startup). `heldBy`, inverse [`remembers`](/business/nouns/worker#rel-remembers).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| <a id="create"></a>[Memory.create](/business/nouns/memory/create) | Creates a Memory. Inherited from [Noun](/business/nouns/noun). | None. | `Memory.created` | Two-way: `try`, `send`, `do` |
| <a id="get"></a>[Memory.get](/business/nouns/memory/get) | Returns one Memory by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Memory.list](/business/nouns/memory/list) | Returns Memories, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="update"></a>[Memory.update](/business/nouns/memory/update) | Changes the given properties of a Memory. Inherited from [Noun](/business/nouns/noun). | None. | `Memory.updated` | Two-way: `try`, `send`, `do` |
| <a id="delete"></a>[Memory.delete](/business/nouns/memory/delete) | Deletes a Memory; its history is kept. Inherited from [Noun](/business/nouns/noun). | None. | `Memory.deleted` | One-way: `send`, `do` |

## Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Memory.create` | Yes | Yes | Yes | No |
| `Memory.get` | Yes | Yes | Yes | Yes |
| `Memory.list` | Yes | Yes | Yes | Yes |
| `Memory.update` | Yes | Yes | Yes | No |
| `Memory.delete` | Yes | Yes | Yes | No |

## Call it

**Ask**

```text
Add a memory to RouteWise with a noun.
```

**API**

```bash
curl -X POST https://api.sb/routewise.dev/memories \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"memory_1","type":["noun_1"]}'
```

```json
{
  "api": "https://api.sb/routewise.dev",
  "memory": {
    "$id": "https://api.sb/routewise.dev/memories/memory_1",
    "$type": "Memory",
    "id": "Example id",
    "type": [
      "noun_1"
    ]
  },
  "action": {
    "$id": "https://api.sb/routewise.dev/actions/action_1",
    "operation": "Memory.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/routewise.dev/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const memory = await $.Memory.create({ id: 'memory_1', type: ['noun_1'] })
```

**CLI**

```bash
npx startup-builder do Memory.create --json '{"id":"memory_1","type":["noun_1"]}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Memory.create({ id: 'memory_1', type: ['noun_1'] })"
  }
}
```

## Example
The Memory of Sienna, the [Success Manager](/agents/customer/success-manager) of a meal-planning [App](/business/nouns/app), holds that one household skips weekend dinners and dislikes cilantro. Her [Functions](/business/nouns/function) read both before each suggestion.