# memory

Canonical URL: https://developers.iagenify.com/sdk/workflows/steps/memory/
Language: en

`type: "memory"`

Reads, writes or deletes one of the account's long-term notes — so a chain can remember something between runs.

Status: free · 3 actions · read by default

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `action` | string | read | `read` · `write` · `delete`. |
| `name` | string |  | Required for `write` and `delete`. |
| `content` | string |  | Required for `write`. |
| `description` | string |  | One line, shown in the index. |

```javascript
// Remember where the last run got to
{ id: "mark", type: "memory", config: {
    action: "write", name: "last-digest",
    description: "The date of the last digest sent",
    content: "{{input.week}}" } }

// Read it at the start of the next run
{ id: "since", type: "memory", config: { action: "read", name: "last-digest" } }
```

## Output {#output}

| action | output |
| --- | --- |
| `read` with a name | the note |
| `read` without one | `memories` — the index |
| `write` | the note, and whether it was created |
| `delete` | the name, and whether it was deleted |

## This is how a chain keeps state {#state}

> **A run starts with nothing**
>
> Each one is independent. A scheduled chain that must not repeat itself — a digest since the last digest — writes a note at the end and reads it at the start. There is no other state between runs.

## The notes are the account's {#shared}

The same ones an agent reads and writes, and the same ones [api.memory](/sdk/ref/memory) manages. A workflow writing one changes what every agent of that account knows — which is useful, and worth being deliberate about.

- [memory](/sdk/agent/tools/memory): The agent's version.
- [api.memory](/sdk/ref/memory): From code.
- [Workflow steps](/sdk/workflows/steps): The 23 types.

```python
# Remember where the last run got to
{"id": "mark", "type": "memory", "config": {
    "action": "write", "name": "last-digest",
    "description": "The date of the last digest sent",
    "content": "{{input.week}}"}}

# Read it at the start of the next run
{"id": "since", "type": "memory", "config": {"action": "read", "name": "last-digest"}}
```
