# Loom

A loom: an agent's long-term memory. It holds the threads one agent (or a group of agents) weaves across conversations, lives in a namespace, and is bound to an interaction's agents when a run starts.

**Kind:** an object, used in responses.

## Fields

Every field is present in a response; empty ones are `null`.

| Field | Type | Description |
|---|---|---|
| `name` | `string` | The loom's name, unique within its namespace. |
| `description` | `string \| null` | What the loom is for, in your own words. Null when none was given. |
| `scopeKey` | `string \| null` | Set on a loom an interaction's loom scope created for itself (one per interaction, per agent or per value of a scope input), and identifies which one it is. Null on a loom you created yourself and on one made for a single run. |
| `seedFromLoomId` | `uuid \| null` | The loom this one inherits from: the first time an agent wakes up with it, the source's shared knowledge is copied in. Set when an interaction with `seedFrom` creates the loom. |
| `seededAt` | `datetime \| null` | When seeding from `seedFromLoomId` began (UTC). It happens only once; null until then. |
| `settings` | [`LoomSettings`](https://docs.maitento.com/reference/types/loom-settings.md) | Night weaving, its quiet period and the model it uses. |
| `lastWovenAt` | `datetime \| null` | When a thread was last woven into this loom, by anyone (UTC). |
| `lastActivityAt` | `datetime \| null` | When an agent last took a turn with this loom bound (UTC). Night weaving waits for a quiet period after it. |
| `lastActivityProcessId` | `uuid \| null` | The run behind `lastActivityAt`. Night weaving uses that run's model credentials, and its usage is attributed to that run. |
| `lastNightWeavingAt` | `datetime \| null` | When night weaving last ran on this loom (UTC). Null if it never has. |
| `nightWeavingPending` | `boolean` | True while there is activity night weaving has not yet consolidated. |
| `nightWeavingNotBefore` | `datetime \| null` | After a night weaving that failed, the next attempt waits until this time (UTC). |
| `namespaceId` | `uuid` | The id of the namespace it belongs to. |
| `tenantId` | `uuid` | The id of the tenant it belongs to. |
| `id` | `uuid` | The unique id. Use it in `by-id` routes and wherever another object refers to this one. |
| `dateCreated` | `datetime` | When it was created, in UTC. |
| `dateUpdated` | `datetime` | When it was last changed, in UTC. |

## Example

```json
{
  "name": "...",
  "description": "...",
  "scopeKey": "...",
  "seedFromLoomId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "seededAt": "2026-10-26T12:00:00.0000000Z",
  "settings": {
    "nightWeaving": false,
    "quietMinutes": 0,
    "weaverModel": "...",
    "effectiveNightWeaving": false,
    "effectiveQuietPeriod": "00:05:00"
  },
  "lastWovenAt": "2026-10-26T12:00:00.0000000Z",
  "lastActivityAt": "2026-10-26T12:00:00.0000000Z",
  "lastActivityProcessId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "lastNightWeavingAt": "2026-10-26T12:00:00.0000000Z",
  "nightWeavingPending": false,
  "nightWeavingNotBefore": "2026-10-26T12:00:00.0000000Z",
  "namespaceId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "tenantId": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "id": "3f2b8c1e-5d4a-4e6b-9c7d-2a1b0c9d8e7f",
  "dateCreated": "2026-10-26T12:00:00.0000000Z",
  "dateUpdated": "2026-10-26T12:00:00.0000000Z"
}
```

## Where it's used

- [`looms.create`](https://docs.maitento.com/reference/api/looms.md) (`PUT /looms`)
- [`looms.get`](https://docs.maitento.com/reference/api/looms.md) (`GET /looms/by-id/{id}`)
- [`looms.list`](https://docs.maitento.com/reference/api/looms.md) (`GET /looms/by-namespace/{namespaceId}`)
- [`looms.update`](https://docs.maitento.com/reference/api/looms.md) (`PATCH /looms/by-id/{id}`)
- Inside [`BuildEntityOfLoom`](https://docs.maitento.com/reference/types/build-entity-of-loom.md)
- Inside [`LoomInspection`](https://docs.maitento.com/reference/types/loom-inspection.md)
