# list()

Canonical URL: https://developers.iagenify.com/sdk/ref/memory/list/
Language: en

`api.memory.list({ limit }) → Promise<Memory[]>`

Every note on the account, most recently changed first, with its content. This is the screen you show the user.

Status: GET /api/ai/memories · free · an array

## Parameters {#parameters}

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `limit` | integer |  | How many. Defaults to `200`, which is also the cap and the maximum a account can hold. |

Since the cap and the maximum are the same number, the default returns everything. There is no pagination because there is nothing to paginate.

## Returns {#returns}

```javascript
[
  {
    id: "…",
    name: "tone-of-voice",
    description: "How this user wants to be written to",
    content: "Prefers short, direct answers in French.",
    type: "preference",
    source: "user",
    createdAt: "…",
    updatedAt: "…"
  }
]
```

An array, directly — not an envelope. An account with no notes gives an empty array.

## The content comes with it {#content}

Unlike what the agent gets — which is the index alone — this returns everything, content included. It is meant for a person looking at what is remembered about them.

```javascript
const notes = await api.memory.list();

for (const n of notes) {
  console.log(`${n.name} · ${n.type} · by ${n.source}`);
  console.log(`  ${n.description}`);
  console.log(`  ${n.content}`);
}
```

## Grouping by type {#group}

| type | Means |
| --- | --- |
| preference | How the user wants things done. |
| project | Something about the work in hand. |
| fact | Something stable and verifiable. |
| correction | Something the agent got wrong and was told about. |
| other | The default when nothing else fits. |

```javascript
const byType = new Map();
for (const n of await api.memory.list()) {
  byType.set(n.type, [...(byType.get(n.type) || []), n]);
}

// Corrections are the ones worth reviewing: each is something that went wrong once.
byType.get("correction")?.forEach((n) => console.log(n.name, "·", n.content));
```

## A review worth running {#review}

Memory decays in usefulness rather than in size: a note written about a project that ended is still read into context every time. Looking at what has not changed in a long while is the cheap version of pruning.

```javascript
const notes = await api.memory.list();
const quarter = Date.now() - 90 * 24 * 60 * 60 * 1000;

const old = notes.filter((n) => Date.parse(n.updatedAt) < quarter && n.type === "project");

for (const n of old) {
  console.log(`still remembered, last touched ${n.updatedAt}: ${n.name} — ${n.description}`);
}
```

> **Prune by hand, or let the user do it**
>
> A note is about the account holder, so deleting one on their behalf is a decision, not housekeeping. Showing them the list is usually the better move.

- [save()](/sdk/ref/memory/save): Writing or replacing one.
- [delete()](/sdk/ref/memory/delete): Removing one by name.

```python
[
    {
        "id": "…",
        "name": "tone-of-voice",
        "description": "How this user wants to be written to",
        "content": "Prefers short, direct answers in French.",
        "type": "preference",
        "source": "user",
        "createdAt": "…",
        "updatedAt": "…",
    }
]
```

```python
notes = api.memory.list()

for n in notes:
    print(f"{n['name']} · {n['type']} · by {n['source']}")
    print(f"  {n['description']}")
    print(f"  {n['content']}")
```

```python
from collections import defaultdict

by_type = defaultdict(list)
for n in api.memory.list():
    by_type[n["type"]].append(n)

# Corrections are the ones worth reviewing: each is something that went wrong once.
for n in by_type["correction"]:
    print(n["name"], "·", n["content"])
```

```python
from datetime import datetime, timedelta, timezone

notes = api.memory.list()
quarter = datetime.now(timezone.utc) - timedelta(days=90)

old = [n for n in notes
       if n["type"] == "project" and datetime.fromisoformat(n["updatedAt"].replace("Z", "+00:00")) < quarter]

for n in old:
    print(f"still remembered, last touched {n['updatedAt']}: {n['name']} — {n['description']}")
```
